[subset-plan] Simplify colrv1_layers allocation

pull/4027/head
Behdad Esfahbod 2 years ago
parent 89905368ca
commit b74a265196
  1. 2
      src/OT/Color/COLR/COLR.hh
  2. 3
      src/hb-subset-plan.cc
  3. 3
      src/hb-subset-plan.hh

@ -550,7 +550,7 @@ struct PaintColrLayers
TRACE_SUBSET (this);
auto *out = c->serializer->embed (this);
if (unlikely (!out)) return_trace (false);
return_trace (c->serializer->check_assign (out->firstLayerIndex, c->plan->colrv1_layers->get (firstLayerIndex),
return_trace (c->serializer->check_assign (out->firstLayerIndex, c->plan->colrv1_layers.get (firstLayerIndex),
HB_SERIALIZE_ERROR_INT_OVERFLOW));
return_trace (true);

@ -657,7 +657,7 @@ _populate_gids_to_retain (hb_subset_plan_t* plan,
hb_set_t cur_glyphset = plan->_glyphset_mathed;
if (!drop_tables->has (HB_OT_TAG_COLR))
{
_colr_closure (plan->source, plan->colrv1_layers, plan->colr_palettes, &cur_glyphset);
_colr_closure (plan->source, &plan->colrv1_layers, plan->colr_palettes, &cur_glyphset);
_remove_invalid_gids (&cur_glyphset, plan->source->get_num_glyphs ());
}
@ -857,7 +857,6 @@ hb_subset_plan_create_or_fail (hb_face_t *face,
plan->reverse_glyph_map = hb_map_create ();
plan->glyph_map_gsub = hb_map_create ();
plan->colrv1_layers = hb_map_create ();
plan->colr_palettes = hb_map_create ();
plan->check_success (plan->layout_variation_idx_delta_map = hb_hashmap_create<unsigned, hb_pair_t<unsigned, int>> ());
plan->gdef_varstore_inner_maps.init ();

@ -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_map_destroy (colrv1_layers);
hb_map_destroy (colr_palettes);
hb_map_destroy (axes_index_map);
hb_map_destroy (axes_old_index_tag_map);
@ -159,7 +158,7 @@ struct hb_subset_plan_t
hb_hashmap_t<unsigned, const OT::Feature*> gpos_feature_substitutes_map;
//active layers/palettes we'd like to retain
hb_map_t *colrv1_layers;
hb_map_t colrv1_layers;
hb_map_t *colr_palettes;
//Old layout item variation index -> (New varidx, delta) mapping

Loading…
Cancel
Save