[subset-plan] Simplify glyph_map_gsub allocation

pull/4027/head
Behdad Esfahbod 2 years ago
parent bd4b040e7f
commit b2007abff7
  1. 4
      src/hb-ot-layout-common.hh
  2. 3
      src/hb-subset-plan.cc
  3. 3
      src/hb-subset-plan.hh

@ -1532,7 +1532,7 @@ struct ClassDefFormat1_3
const Coverage* glyph_filter = nullptr) const const Coverage* glyph_filter = nullptr) const
{ {
TRACE_SUBSET (this); TRACE_SUBSET (this);
const hb_map_t &glyph_map = *c->plan->glyph_map_gsub; const hb_map_t &glyph_map = c->plan->glyph_map_gsub;
hb_sorted_vector_t<hb_pair_t<hb_codepoint_t, hb_codepoint_t>> glyph_and_klass; hb_sorted_vector_t<hb_pair_t<hb_codepoint_t, hb_codepoint_t>> glyph_and_klass;
hb_set_t orig_klasses; hb_set_t orig_klasses;
@ -1777,7 +1777,7 @@ struct ClassDefFormat2_4
const Coverage* glyph_filter = nullptr) const const Coverage* glyph_filter = nullptr) const
{ {
TRACE_SUBSET (this); TRACE_SUBSET (this);
const hb_map_t &glyph_map = *c->plan->glyph_map_gsub; const hb_map_t &glyph_map = c->plan->glyph_map_gsub;
const hb_set_t &glyph_set = *c->plan->glyphset_gsub (); const hb_set_t &glyph_set = *c->plan->glyphset_gsub ();
hb_sorted_vector_t<hb_pair_t<hb_codepoint_t, hb_codepoint_t>> glyph_and_klass; hb_sorted_vector_t<hb_pair_t<hb_codepoint_t, hb_codepoint_t>> glyph_and_klass;

@ -855,7 +855,6 @@ hb_subset_plan_create_or_fail (hb_face_t *face,
plan->codepoint_to_glyph = hb_map_create (); plan->codepoint_to_glyph = hb_map_create ();
plan->glyph_map = hb_map_create (); plan->glyph_map = hb_map_create ();
plan->reverse_glyph_map = hb_map_create (); plan->reverse_glyph_map = hb_map_create ();
plan->glyph_map_gsub = hb_map_create ();
plan->gdef_varstore_inner_maps.init (); plan->gdef_varstore_inner_maps.init ();
@ -920,7 +919,7 @@ hb_subset_plan_create_or_fail (hb_face_t *face,
_create_glyph_map_gsub ( _create_glyph_map_gsub (
&plan->_glyphset_gsub, &plan->_glyphset_gsub,
plan->glyph_map, plan->glyph_map,
plan->glyph_map_gsub); &plan->glyph_map_gsub);
// Now that we have old to new gid map update the unicode to new gid list. // Now that we have old to new gid map update the unicode to new gid list.
for (unsigned i = 0; i < plan->unicode_to_new_gid_list.length; i++) for (unsigned i = 0; i < plan->unicode_to_new_gid_list.length; i++)

@ -54,7 +54,6 @@ struct hb_subset_plan_t
hb_map_destroy (codepoint_to_glyph); hb_map_destroy (codepoint_to_glyph);
hb_map_destroy (glyph_map); hb_map_destroy (glyph_map);
hb_map_destroy (reverse_glyph_map); hb_map_destroy (reverse_glyph_map);
hb_map_destroy (glyph_map_gsub);
hb_map_destroy (axes_index_map); hb_map_destroy (axes_index_map);
hb_map_destroy (axes_old_index_tag_map); hb_map_destroy (axes_old_index_tag_map);
@ -119,7 +118,7 @@ struct hb_subset_plan_t
// Old -> New glyph id mapping // Old -> New glyph id mapping
hb_map_t *glyph_map; hb_map_t *glyph_map;
hb_map_t *reverse_glyph_map; hb_map_t *reverse_glyph_map;
hb_map_t *glyph_map_gsub; hb_map_t glyph_map_gsub;
// Plan is only good for a specific source/dest so keep them with it // Plan is only good for a specific source/dest so keep them with it
hb_face_t *source; hb_face_t *source;

Loading…
Cancel
Save