[shape-plan] Simplify _glyphset_colred allocation

This commit is contained in:
Behdad Esfahbod 2023-01-11 11:04:17 -07:00
parent efafe7aa3b
commit 5fc91de2c0
3 changed files with 5 additions and 7 deletions

View File

@ -1456,7 +1456,7 @@ struct ClipList
if (unlikely (!c->serializer->extend_min (out))) return_trace (false);
if (!c->serializer->check_assign (out->format, format, HB_SERIALIZE_ERROR_INT_OVERFLOW)) return_trace (false);
const hb_set_t& glyphset = *c->plan->_glyphset_colred;
const hb_set_t& glyphset = c->plan->_glyphset_colred;
const hb_map_t &glyph_map = *c->plan->glyph_map;
hb_map_t new_gid_offset_map;
@ -1641,7 +1641,7 @@ struct BaseGlyphList : SortedArray32Of<BaseGlyphPaintRecord>
TRACE_SUBSET (this);
auto *out = c->serializer->start_embed (this);
if (unlikely (!c->serializer->extend_min (out))) return_trace (false);
const hb_set_t* glyphset = c->plan->_glyphset_colred;
const hb_set_t* glyphset = &c->plan->_glyphset_colred;
for (const auto& _ : as_array ())
{
@ -1882,7 +1882,7 @@ struct COLR
TRACE_SUBSET (this);
const hb_map_t &reverse_glyph_map = *c->plan->reverse_glyph_map;
const hb_set_t& glyphset = *c->plan->_glyphset_colred;
const hb_set_t& glyphset = c->plan->_glyphset_colred;
auto base_it =
+ hb_range (c->plan->num_output_glyphs ())

View File

@ -661,7 +661,7 @@ _populate_gids_to_retain (hb_subset_plan_t* plan,
_remove_invalid_gids (&cur_glyphset, plan->source->get_num_glyphs ());
}
hb_set_set (plan->_glyphset_colred, &cur_glyphset);
plan->_glyphset_colred = cur_glyphset;
/* Populate a full set of glyphs to retain by adding all referenced
* composite glyphs. */
@ -852,7 +852,6 @@ hb_subset_plan_create_or_fail (hb_face_t *face,
plan->source = hb_face_reference (face);
plan->dest = hb_face_builder_create ();
plan->_glyphset_colred = hb_set_create ();
plan->codepoint_to_glyph = hb_map_create ();
plan->glyph_map = hb_map_create ();
plan->reverse_glyph_map = hb_map_create ();

View File

@ -58,7 +58,6 @@ struct hb_subset_plan_t
hb_map_destroy (glyph_map);
hb_map_destroy (reverse_glyph_map);
hb_map_destroy (glyph_map_gsub);
hb_set_destroy (_glyphset_colred);
hb_map_destroy (colrv1_layers);
hb_map_destroy (colr_palettes);
hb_map_destroy (axes_index_map);
@ -143,7 +142,7 @@ struct hb_subset_plan_t
hb_set_t _glyphset;
hb_set_t _glyphset_gsub;
hb_set_t _glyphset_mathed;
hb_set_t *_glyphset_colred;
hb_set_t _glyphset_colred;
//active lookups we'd like to retain
hb_map_t gsub_lookups;