Revert "[subset/closure] Batch recursions in scheduled stages"

This reverts commit f2aaeeb301.
pull/4324/head
Behdad Esfahbod 2 years ago
parent 5e42f7bb6d
commit d00b88737e
  1. 9
      src/hb-ot-layout-gsub-table.hh
  2. 15
      src/hb-ot-layout-gsubgpos.hh

@ -53,14 +53,9 @@ template <typename context_t>
/*static*/ typename hb_closure_context_t::return_t SubstLookup::closure_glyphs_recurse_func (hb_closure_context_t *c, unsigned lookup_index, hb_set_t *covered_seq_indices, unsigned seq_index, unsigned end_index) /*static*/ typename hb_closure_context_t::return_t SubstLookup::closure_glyphs_recurse_func (hb_closure_context_t *c, unsigned lookup_index, hb_set_t *covered_seq_indices, unsigned seq_index, unsigned end_index)
{ {
const SubstLookup &l = c->face->table.GSUB.get_relaxed ()->table->get_lookup (lookup_index); const SubstLookup &l = c->face->table.GSUB.get_relaxed ()->table->get_lookup (lookup_index);
if (covered_seq_indices && l.may_have_non_1to1 ()) if (l.may_have_non_1to1 ())
hb_set_add_range (covered_seq_indices, seq_index, end_index); hb_set_add_range (covered_seq_indices, seq_index, end_index);
return l.dispatch (c);
if (covered_seq_indices)
c->schedule (lookup_index);
else
l.dispatch (c);
return hb_empty_t ();
} }
template <> template <>

@ -183,22 +183,8 @@ struct hb_closure_context_t :
void set_recurse_func (recurse_func_t func) { recurse_func = func; } void set_recurse_func (recurse_func_t func) { recurse_func = func; }
void schedule (unsigned lookup_index)
{
scheduled.add (lookup_index);
}
void flush () void flush ()
{ {
hb_set_t scheduled_copy;
while (scheduled)
{
scheduled_copy = scheduled;
scheduled.clear ();
for (unsigned lookup_index : scheduled_copy)
recurse (lookup_index, nullptr, 0, 0);
}
output->del_range (face->get_num_glyphs (), HB_SET_VALUE_INVALID); /* Remove invalid glyphs. */ output->del_range (face->get_num_glyphs (), HB_SET_VALUE_INVALID); /* Remove invalid glyphs. */
glyphs->union_ (*output); glyphs->union_ (*output);
output->clear (); output->clear ();
@ -210,7 +196,6 @@ struct hb_closure_context_t :
hb_map_t *done_lookups_glyph_count; hb_map_t *done_lookups_glyph_count;
hb_hashmap_t<unsigned, hb::unique_ptr<hb_set_t>> *done_lookups_glyph_set; hb_hashmap_t<unsigned, hb::unique_ptr<hb_set_t>> *done_lookups_glyph_set;
unsigned int lookup_count = 0; unsigned int lookup_count = 0;
hb_set_t scheduled;
}; };

Loading…
Cancel
Save