[subset-plan] Simplify axes_location allocation

This commit is contained in:
Behdad Esfahbod 2023-01-11 12:32:04 -07:00
parent d54902c659
commit 8265277c2e
2 changed files with 3 additions and 5 deletions

View File

@ -166,7 +166,7 @@ static void _collect_layout_indices (hb_subset_plan_t *plan,
OT::hb_collect_feature_substitutes_with_var_context_t c =
{
&plan->axes_old_index_tag_map,
plan->axes_location,
&plan->axes_location,
feature_record_cond_idx_map,
feature_substitutes_map,
feature_indices,
@ -797,7 +797,7 @@ _normalize_axes_location (hb_face_t *face, hb_subset_plan_t *plan)
{
normalized_v = seg_maps->map (normalized_v);
}
plan->axes_location->set (axis_tag, normalized_v);
plan->axes_location.set (axis_tag, normalized_v);
if (normalized_v != 0)
plan->pinned_at_default = false;
@ -857,7 +857,6 @@ hb_subset_plan_create_or_fail (hb_face_t *face,
plan->gdef_varstore_inner_maps.init ();
plan->check_success (plan->axes_location = hb_hashmap_create<hb_tag_t, int> ());
plan->check_success (plan->user_axes_location = hb_hashmap_create<hb_tag_t, float> ());
if (plan->user_axes_location && input->axes_location)
*plan->user_axes_location = *input->axes_location;

View File

@ -56,7 +56,6 @@ struct hb_subset_plan_t
hb_map_destroy (reverse_glyph_map);
hb_map_destroy (axes_index_map);
hb_hashmap_destroy (axes_location);
hb_hashmap_destroy (user_axes_location);
#ifdef HB_EXPERIMENTAL_API
@ -155,7 +154,7 @@ struct hb_subset_plan_t
hb_hashmap_t<hb_tag_t, hb::unique_ptr<hb_blob_t>> sanitized_table_cache;
//normalized axes location map
hb_hashmap_t<hb_tag_t, int> *axes_location;
hb_hashmap_t<hb_tag_t, int> axes_location;
hb_vector_t<int> normalized_coords;
//user specified axes location map
hb_hashmap_t<hb_tag_t, float> *user_axes_location;