4991 {
4992 CharacterRange current = full_range;
4994
4995 ZoneSplayTree<Config>::Locator loc;
4996 bool inserted = tree()->Insert(current.from(), &loc);
4999 loc.set_value(
5001 return;
5002 }
5003
5004
5005 ZoneSplayTree<Config>::Locator loc;
5006 if (tree()->FindGreatestLessThan(current.from(), &loc)) {
5007 Entry* entry = &loc.value();
5008
5009
5010
5011
5012 if (entry->from() < current.from() && entry->to() >= current.from()) {
5013
5014
5015 CharacterRange
left =
5018
5019
5020 entry->set_to(
left.to());
5021
5022
5023
5024 ZoneSplayTree<Config>::Locator loc;
5025 bool inserted = tree()->Insert(
right.from(), &loc);
5029 }
5030 }
5031 while (current.is_valid()) {
5032 if (tree()->FindLeastGreaterThan(current.from(), &loc) &&
5033 (loc.value().from() <= current.to()) &&
5034 (loc.value().to() >= current.from())) {
5035 Entry* entry = &loc.value();
5036
5037
5038
5039 if (current.from() < entry->from()) {
5040 ZoneSplayTree<Config>::Locator ins;
5041 bool inserted = tree()->Insert(current.from(), &ins);
5044 ins.set_value(
Entry(current.from(), entry->from() - 1,
5046 current.set_from(entry->from());
5047 }
5048 ASSERT(current.from() == entry->from());
5049
5050
5051 if (entry->to() > current.to()) {
5052 ZoneSplayTree<Config>::Locator ins;
5053 bool inserted = tree()->Insert(current.to() + 1, &ins);
5056 ins.set_value(
Entry(current.to() + 1, entry->to(), entry->out_set()));
5057 entry->set_to(current.to());
5058 }
5059 ASSERT(entry->to() <= current.to());
5060
5061
5062
5063 entry->AddValue(
value, zone);
5064 ASSERT(entry->to() + 1 > current.from());
5065 current.set_from(entry->to() + 1);
5066 } else {
5067
5068 ZoneSplayTree<Config>::Locator ins;
5069 bool inserted = tree()->Insert(current.from(), &ins);
5072 ins.set_value(
5074 break;
5075 }
5076 }
5077}
static void is_empty(skiatest::Reporter *reporter, const SkPath &p)
static CharacterRange Range(int32_t from, int32_t to)