[subset-plan] Simplify axes_location allocation

pull/4024/head
Behdad Esfahbod 2 years ago
parent d54902c659
commit 8265277c2e
  1. 5
      src/hb-subset-plan.cc
  2. 3
      src/hb-subset-plan.hh

@ -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;

@ -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;

Loading…
Cancel
Save