[gsubgpos] Cache pos_glyphs allocation in closure

Saves some 3% in Gulzar-Regular subsetting.
This commit is contained in:
Behdad Esfahbod 2023-01-05 13:58:57 -07:00
parent a90f149e1b
commit 3961cc46bf
1 changed files with 3 additions and 1 deletions

View File

@ -189,6 +189,8 @@ struct hb_closure_context_t :
active_glyphs_stack.reset ();
}
public:
hb_set_t pos_glyphs; // Cache
private:
hb_map_t *done_lookups_glyph_count;
hb_hashmap_t<unsigned, hb::unique_ptr<hb_set_t>> *done_lookups_glyph_set;
@ -1539,7 +1541,7 @@ static void context_closure_recurse_lookups (hb_closure_context_t *c,
void *cache)
{
hb_set_t covered_seq_indicies;
hb_set_t pos_glyphs;
hb_set_t &pos_glyphs = c->pos_glyphs;
for (unsigned int i = 0; i < lookupCount; i++)
{
unsigned seqIndex = lookupRecord[i].sequenceIndex;