Initialize set digests

We were not initializing the digests properly and as a result they were
being initialized to zero, making digest1 to never do any useful work.

Speeds up Amiri shaping significantly.
This commit is contained in:
Behdad Esfahbod 2013-04-16 21:50:33 -04:00
parent 4d2813d3e9
commit 893991fc9d
2 changed files with 9 additions and 1 deletions

View File

@ -70,9 +70,15 @@ _hb_ot_layout_create (hb_face_t *face)
}
for (unsigned int i = 0; i < layout->gsub_lookup_count; i++)
{
layout->gsub_digests[i].init ();
layout->gsub->get_lookup (i).add_coverage (&layout->gsub_digests[i]);
}
for (unsigned int i = 0; i < layout->gpos_lookup_count; i++)
{
layout->gpos_digests[i].init ();
layout->gpos->get_lookup (i).add_coverage (&layout->gpos_digests[i]);
}
return layout;
}

View File

@ -212,7 +212,9 @@ arabic_fallback_plan_create (const hb_ot_shape_plan_t *plan,
if (unlikely (!fallback_plan))
return const_cast<arabic_fallback_plan_t *> (&arabic_fallback_plan_nil);
for (unsigned int i = 0; i < ARABIC_NUM_FALLBACK_FEATURES; i++) {
for (unsigned int i = 0; i < ARABIC_NUM_FALLBACK_FEATURES; i++)
{
fallback_plan->digest_array[i].init ();
fallback_plan->mask_array[i] = plan->map.get_1_mask (arabic_fallback_features[i]);
if (fallback_plan->mask_array[i]) {
fallback_plan->lookup_array[i] = arabic_fallback_synthesize_lookup (plan, font, i);