[subset-plan] Simplify sanitized_table_cache allocation
This commit is contained in:
parent
9e24873c1e
commit
89905368ca
|
@ -862,7 +862,6 @@ hb_subset_plan_create_or_fail (hb_face_t *face,
|
|||
plan->check_success (plan->layout_variation_idx_delta_map = hb_hashmap_create<unsigned, hb_pair_t<unsigned, int>> ());
|
||||
plan->gdef_varstore_inner_maps.init ();
|
||||
|
||||
plan->check_success (plan->sanitized_table_cache = hb_hashmap_create<hb_tag_t, hb::unique_ptr<hb_blob_t>> ());
|
||||
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)
|
||||
|
|
|
@ -64,7 +64,6 @@ struct hb_subset_plan_t
|
|||
hb_map_destroy (axes_old_index_tag_map);
|
||||
|
||||
hb_hashmap_destroy (axes_location);
|
||||
hb_hashmap_destroy (sanitized_table_cache);
|
||||
hb_hashmap_destroy (hmtx_map);
|
||||
hb_hashmap_destroy (vmtx_map);
|
||||
hb_hashmap_destroy (layout_variation_idx_delta_map);
|
||||
|
@ -169,7 +168,7 @@ struct hb_subset_plan_t
|
|||
//gdef varstore retained varidx mapping
|
||||
hb_vector_t<hb_inc_bimap_t> gdef_varstore_inner_maps;
|
||||
|
||||
hb_hashmap_t<hb_tag_t, hb::unique_ptr<hb_blob_t>>* sanitized_table_cache;
|
||||
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_vector_t<int> normalized_coords;
|
||||
|
@ -204,7 +203,7 @@ struct hb_subset_plan_t
|
|||
{
|
||||
hb_lock_t (accelerator ? &accelerator->sanitized_table_cache_lock : nullptr);
|
||||
|
||||
auto *cache = accelerator ? &accelerator->sanitized_table_cache : sanitized_table_cache;
|
||||
auto *cache = accelerator ? &accelerator->sanitized_table_cache : &sanitized_table_cache;
|
||||
if (cache
|
||||
&& !cache->in_error ()
|
||||
&& cache->has (+T::tableTag)) {
|
||||
|
|
Loading…
Reference in New Issue