From 399909468204b76769857508e74f802d648ca0a5 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Sun, 26 Aug 2018 09:12:25 -0700 Subject: [PATCH] [OT] Use relaxed ops for recursing into GSUB/GPOS lookups again --- src/hb-ot-layout-gpos-table.hh | 4 ++-- src/hb-ot-layout-gsub-table.hh | 4 ++-- src/hb-ot-layout.cc | 12 ++++++++++-- src/hb-ot-layout.hh | 4 ++-- 4 files changed, 16 insertions(+), 8 deletions(-) diff --git a/src/hb-ot-layout-gpos-table.hh b/src/hb-ot-layout-gpos-table.hh index 7d3c3ba..08a99b3 100644 --- a/src/hb-ot-layout-gpos-table.hh +++ b/src/hb-ot-layout-gpos-table.hh @@ -1630,13 +1630,13 @@ GPOS::position_finish_offsets (hb_font_t *font HB_UNUSED, hb_buffer_t *buffer) template /*static*/ inline typename context_t::return_t PosLookup::dispatch_recurse_func (context_t *c, unsigned int lookup_index) { - const PosLookup &l = _get_gpos (c->face)->get_lookup (lookup_index); + const PosLookup &l = _get_gpos_relaxed (c->face)->get_lookup (lookup_index); return l.dispatch (c); } /*static*/ inline bool PosLookup::apply_recurse_func (hb_ot_apply_context_t *c, unsigned int lookup_index) { - const PosLookup &l = _get_gpos (c->face).get_lookup (lookup_index); + const PosLookup &l = _get_gpos_relaxed (c->face).get_lookup (lookup_index); unsigned int saved_lookup_props = c->lookup_props; unsigned int saved_lookup_index = c->lookup_index; c->set_lookup_index (lookup_index); diff --git a/src/hb-ot-layout-gsub-table.hh b/src/hb-ot-layout-gsub-table.hh index 991b556..8911a5e 100644 --- a/src/hb-ot-layout-gsub-table.hh +++ b/src/hb-ot-layout-gsub-table.hh @@ -1351,13 +1351,13 @@ GSUB::substitute_start (hb_font_t *font, hb_buffer_t *buffer) template /*static*/ inline typename context_t::return_t SubstLookup::dispatch_recurse_func (context_t *c, unsigned int lookup_index) { - const SubstLookup &l = _get_gsub (c->face).get_lookup (lookup_index); + const SubstLookup &l = _get_gsub_relaxed (c->face).get_lookup (lookup_index); return l.dispatch (c); } /*static*/ inline bool SubstLookup::apply_recurse_func (hb_ot_apply_context_t *c, unsigned int lookup_index) { - const SubstLookup &l = _get_gsub (c->face).get_lookup (lookup_index); + const SubstLookup &l = _get_gsub_relaxed (c->face).get_lookup (lookup_index); unsigned int saved_lookup_props = c->lookup_props; unsigned int saved_lookup_index = c->lookup_index; c->set_lookup_index (lookup_index); diff --git a/src/hb-ot-layout.cc b/src/hb-ot-layout.cc index 6e9b5f8..4d2aeee 100644 --- a/src/hb-ot-layout.cc +++ b/src/hb-ot-layout.cc @@ -66,21 +66,29 @@ static hb_blob_t * _get_gsub_blob (hb_face_t *face) if (unlikely (!hb_ot_shaper_face_data_ensure (face))) return hb_blob_get_empty (); return hb_ot_face_data (face)->table.GSUB->blob; } -inline const OT::GSUB& _get_gsub (hb_face_t *face) +static inline const OT::GSUB& _get_gsub (hb_face_t *face) { if (unlikely (!hb_ot_shaper_face_data_ensure (face))) return Null(OT::GSUB); return *hb_ot_face_data (face)->table.GSUB->table; } +inline const OT::GSUB& _get_gsub_relaxed (hb_face_t *face) +{ + return *hb_ot_face_data (face)->table.GSUB.get_relaxed ()->table; +} static hb_blob_t * _get_gpos_blob (hb_face_t *face) { if (unlikely (!hb_ot_shaper_face_data_ensure (face))) return hb_blob_get_empty (); return hb_ot_face_data (face)->table.GPOS->blob; } -inline const OT::GPOS& _get_gpos (hb_face_t *face) +static inline const OT::GPOS& _get_gpos (hb_face_t *face) { if (unlikely (!hb_ot_shaper_face_data_ensure (face))) return Null(OT::GPOS); return *hb_ot_face_data (face)->table.GPOS->table; } +inline const OT::GPOS& _get_gpos_relaxed (hb_face_t *face) +{ + return *hb_ot_face_data (face)->table.GPOS.get_relaxed ()->table; +} /* diff --git a/src/hb-ot-layout.hh b/src/hb-ot-layout.hh index 7abaaaa..8498139 100644 --- a/src/hb-ot-layout.hh +++ b/src/hb-ot-layout.hh @@ -45,8 +45,8 @@ namespace OT } HB_INTERNAL const OT::GDEF& _get_gdef (hb_face_t *face); -HB_INTERNAL const OT::GSUB& _get_gsub (hb_face_t *face); -HB_INTERNAL const OT::GPOS& _get_gpos (hb_face_t *face); +HB_INTERNAL const OT::GSUB& _get_gsub_relaxed (hb_face_t *face); +HB_INTERNAL const OT::GPOS& _get_gpos_relaxed (hb_face_t *face); /* Private API corresponding to hb-ot-layout.h: */ -- 2.7.4