[subset] add an inprogress accelerator to plan.
This allows subset code to cache information into the accelerator during preprocess subset. Previously the accelerator was created at the end of subsetting.
This commit is contained in:
parent
81640fdffe
commit
2c0afde737
|
@ -926,6 +926,17 @@ hb_subset_plan_create_or_fail (hb_face_t *face,
|
|||
hb_subset_plan_destroy (plan);
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
|
||||
if (plan->attach_accelerator_data)
|
||||
{
|
||||
plan->inprogress_accelerator =
|
||||
hb_subset_accelerator_t::create (*plan->codepoint_to_glyph,
|
||||
*plan->unicodes,
|
||||
plan->has_seac);
|
||||
}
|
||||
|
||||
|
||||
return plan;
|
||||
}
|
||||
|
||||
|
|
|
@ -96,6 +96,9 @@ struct hb_subset_plan_t
|
|||
hb_hashmap_destroy (name_table_overrides);
|
||||
#endif
|
||||
|
||||
if (inprogress_accelerator)
|
||||
hb_subset_accelerator_t::destroy ((void*) inprogress_accelerator);
|
||||
|
||||
if (user_axes_location)
|
||||
{
|
||||
hb_object_destroy (user_axes_location);
|
||||
|
@ -209,6 +212,7 @@ struct hb_subset_plan_t
|
|||
#endif
|
||||
|
||||
const hb_subset_accelerator_t* accelerator;
|
||||
hb_subset_accelerator_t* inprogress_accelerator;
|
||||
|
||||
public:
|
||||
|
||||
|
|
|
@ -499,13 +499,14 @@ _subset_table (hb_subset_plan_t *plan,
|
|||
}
|
||||
}
|
||||
|
||||
static void _attach_accelerator_data (const hb_subset_plan_t* plan,
|
||||
static void _attach_accelerator_data (hb_subset_plan_t* plan,
|
||||
hb_face_t* face /* IN/OUT */)
|
||||
{
|
||||
hb_subset_accelerator_t* accel =
|
||||
hb_subset_accelerator_t::create (*plan->codepoint_to_glyph,
|
||||
*plan->unicodes,
|
||||
plan->has_seac);
|
||||
if (!plan->inprogress_accelerator) return;
|
||||
|
||||
// Transfer the accelerator from the plan to us.
|
||||
hb_subset_accelerator_t* accel = plan->inprogress_accelerator;
|
||||
plan->inprogress_accelerator = nullptr;
|
||||
|
||||
if (accel->in_error ())
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue