[subset-plan] Simplify colr_palettes allocation
This commit is contained in:
parent
b74a265196
commit
9c45d98f73
|
@ -339,7 +339,7 @@ struct ColorStop
|
|||
TRACE_SUBSET (this);
|
||||
auto *out = c->serializer->embed (*this);
|
||||
if (unlikely (!out)) return_trace (false);
|
||||
return_trace (c->serializer->check_assign (out->paletteIndex, c->plan->colr_palettes->get (paletteIndex),
|
||||
return_trace (c->serializer->check_assign (out->paletteIndex, c->plan->colr_palettes.get (paletteIndex),
|
||||
HB_SERIALIZE_ERROR_INT_OVERFLOW));
|
||||
}
|
||||
|
||||
|
@ -581,7 +581,7 @@ struct PaintSolid
|
|||
TRACE_SUBSET (this);
|
||||
auto *out = c->serializer->embed (*this);
|
||||
if (unlikely (!out)) return_trace (false);
|
||||
return_trace (c->serializer->check_assign (out->paletteIndex, c->plan->colr_palettes->get (paletteIndex),
|
||||
return_trace (c->serializer->check_assign (out->paletteIndex, c->plan->colr_palettes.get (paletteIndex),
|
||||
HB_SERIALIZE_ERROR_INT_OVERFLOW));
|
||||
}
|
||||
|
||||
|
@ -1931,7 +1931,7 @@ struct COLR
|
|||
if (unlikely (!c->plan->new_gid_for_old_gid (out_layers[i].glyphId, &new_gid)))
|
||||
return hb_pair_t<bool, hb_vector_t<LayerRecord>> (false, out_layers);
|
||||
out_layers[i].glyphId = new_gid;
|
||||
out_layers[i].colorIdx = c->plan->colr_palettes->get (layers[i].colorIdx);
|
||||
out_layers[i].colorIdx = c->plan->colr_palettes.get (layers[i].colorIdx);
|
||||
}
|
||||
|
||||
return hb_pair_t<bool, hb_vector_t<LayerRecord>> (true, out_layers);
|
||||
|
|
|
@ -239,7 +239,7 @@ struct CPAL
|
|||
TRACE_SUBSET (this);
|
||||
if (!numPalettes) return_trace (false);
|
||||
|
||||
const hb_map_t *color_index_map = c->plan->colr_palettes;
|
||||
const hb_map_t *color_index_map = &c->plan->colr_palettes;
|
||||
if (color_index_map->is_empty ()) return_trace (false);
|
||||
|
||||
hb_set_t retained_color_indices;
|
||||
|
|
|
@ -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->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 (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
|
|||
|
||||
//active layers/palettes we'd like to retain
|
||||
hb_map_t colrv1_layers;
|
||||
hb_map_t *colr_palettes;
|
||||
hb_map_t colr_palettes;
|
||||
|
||||
//Old layout item variation index -> (New varidx, delta) mapping
|
||||
hb_hashmap_t<unsigned, hb_pair_t<unsigned, int>> *layout_variation_idx_delta_map;
|
||||
|
|
Loading…
Reference in New Issue