From 893991fc9d2d3a57c4c148f3a9c3b98263cf3aed Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Tue, 16 Apr 2013 21:50:33 -0400 Subject: [PATCH] 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. --- src/hb-ot-layout.cc | 6 ++++++ src/hb-ot-shape-complex-arabic-fallback.hh | 4 +++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/hb-ot-layout.cc b/src/hb-ot-layout.cc index 8161ce3..c80ca7d 100644 --- a/src/hb-ot-layout.cc +++ b/src/hb-ot-layout.cc @@ -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; } diff --git a/src/hb-ot-shape-complex-arabic-fallback.hh b/src/hb-ot-shape-complex-arabic-fallback.hh index 5e151f7..996e40e 100644 --- a/src/hb-ot-shape-complex-arabic-fallback.hh +++ b/src/hb-ot-shape-complex-arabic-fallback.hh @@ -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_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); -- 2.7.4