diff --git a/src/hb-ot-layout-gsubgpos.hh b/src/hb-ot-layout-gsubgpos.hh index 07744aefbe57d9838722a36bc7fbd680d00b2f3f..a11d5dcc549789d0b4e77e971fdf3c3bf4521f7b 100644 --- a/src/hb-ot-layout-gsubgpos.hh +++ b/src/hb-ot-layout-gsubgpos.hh @@ -2612,6 +2612,23 @@ struct Extension * GSUB/GPOS Common */ +struct hb_ot_layout_lookup_accelerator_t +{ + template + inline void init (const TLookup &lookup) + { + digest.init (); + lookup.add_coverage (&digest); + } + inline void fini (void) {} + + inline bool may_have (hb_codepoint_t g) const + { return digest.may_have (g); } + + private: + hb_set_digest_t digest; +}; + struct GSUBGPOS { inline bool has_data (void) const { return version.to_int () != 0; } diff --git a/src/hb-ot-layout.cc b/src/hb-ot-layout.cc index fc83873ceb5096f4240411323e53d2b433595811..572e4cb927f8a31698f39ccb5acb950419b61856 100644 --- a/src/hb-ot-layout.cc +++ b/src/hb-ot-layout.cc @@ -1094,7 +1094,7 @@ struct GSUBProxy accels (hb_ot_face_data (face)->GSUB->accels) {} const OT::GSUB &table; - const hb_ot_layout_lookup_accelerator_t *accels; + const OT::hb_ot_layout_lookup_accelerator_t *accels; }; struct GPOSProxy @@ -1108,13 +1108,13 @@ struct GPOSProxy accels (hb_ot_face_data (face)->GPOS->accels) {} const OT::GPOS &table; - const hb_ot_layout_lookup_accelerator_t *accels; + const OT::hb_ot_layout_lookup_accelerator_t *accels; }; static inline bool apply_forward (OT::hb_ot_apply_context_t *c, - const hb_ot_layout_lookup_accelerator_t &accel, + const OT::hb_ot_layout_lookup_accelerator_t &accel, const OT::hb_get_subtables_context_t::array_t &subtables) { bool ret = false; @@ -1144,7 +1144,7 @@ apply_forward (OT::hb_ot_apply_context_t *c, static inline bool apply_backward (OT::hb_ot_apply_context_t *c, - const hb_ot_layout_lookup_accelerator_t &accel, + const OT::hb_ot_layout_lookup_accelerator_t &accel, const OT::hb_get_subtables_context_t::array_t &subtables) { bool ret = false; @@ -1174,7 +1174,7 @@ template static inline void apply_string (OT::hb_ot_apply_context_t *c, const typename Proxy::Lookup &lookup, - const hb_ot_layout_lookup_accelerator_t &accel) + const OT::hb_ot_layout_lookup_accelerator_t &accel) { hb_buffer_t *buffer = c->buffer; @@ -1270,7 +1270,7 @@ void hb_ot_map_t::position (const hb_ot_shape_plan_t *plan, hb_font_t *font, hb_ void hb_ot_layout_substitute_lookup (OT::hb_ot_apply_context_t *c, const OT::SubstLookup &lookup, - const hb_ot_layout_lookup_accelerator_t &accel) + const OT::hb_ot_layout_lookup_accelerator_t &accel) { apply_string (c, lookup, accel); } diff --git a/src/hb-ot-layout.hh b/src/hb-ot-layout.hh index f5ffe3112c37aadbffde5916b3ffb8ecb5b75daf..64b3d7480d67b2466ab10a133f9dfc0592d11349 100644 --- a/src/hb-ot-layout.hh +++ b/src/hb-ot-layout.hh @@ -112,32 +112,16 @@ hb_ot_layout_substitute_start (hb_font_t *font, hb_buffer_t *buffer); -struct hb_ot_layout_lookup_accelerator_t -{ - template - inline void init (const TLookup &lookup) - { - digest.init (); - lookup.add_coverage (&digest); - } - inline void fini (void) {} - - inline bool may_have (hb_codepoint_t g) const - { return digest.may_have (g); } - - private: - hb_set_digest_t digest; -}; - namespace OT { struct hb_ot_apply_context_t; struct SubstLookup; + struct hb_ot_layout_lookup_accelerator_t; } HB_INTERNAL void hb_ot_layout_substitute_lookup (OT::hb_ot_apply_context_t *c, const OT::SubstLookup &lookup, - const hb_ot_layout_lookup_accelerator_t &accel); + const OT::hb_ot_layout_lookup_accelerator_t &accel); /* Should be called before all the position_lookup's are done. */ diff --git a/src/hb-ot-shape-complex-arabic-fallback.hh b/src/hb-ot-shape-complex-arabic-fallback.hh index 0ef60f64347f669b7f0e26b0cf8a686d5d251876..2aa0367280a99d03da82d47d425237bedc1576ae 100644 --- a/src/hb-ot-shape-complex-arabic-fallback.hh +++ b/src/hb-ot-shape-complex-arabic-fallback.hh @@ -201,7 +201,7 @@ struct arabic_fallback_plan_t hb_mask_t mask_array[ARABIC_FALLBACK_MAX_LOOKUPS]; OT::SubstLookup *lookup_array[ARABIC_FALLBACK_MAX_LOOKUPS]; - hb_ot_layout_lookup_accelerator_t accel_array[ARABIC_FALLBACK_MAX_LOOKUPS]; + OT::hb_ot_layout_lookup_accelerator_t accel_array[ARABIC_FALLBACK_MAX_LOOKUPS]; }; #if (defined(_WIN32) || defined(__CYGWIN__)) && !defined(HB_NO_WIN1256)