From 33b006cc51b0d27cbe1d8ed498bbf2b548cb6554 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Mon, 5 Nov 2018 23:19:04 -0500 Subject: [PATCH] [ot-layout] Simplify some access --- src/hb-ot-layout-gdef-table.hh | 2 +- src/hb-ot-layout-gpos-table.hh | 9 +++++---- src/hb-ot-layout-gsub-table.hh | 9 +++++---- src/hb-ot-layout-gsubgpos.hh | 2 +- src/hb-ot-layout.hh | 12 +----------- 5 files changed, 13 insertions(+), 21 deletions(-) diff --git a/src/hb-ot-layout-gdef-table.hh b/src/hb-ot-layout-gdef-table.hh index 5847953d3..ea5f1c07d 100644 --- a/src/hb-ot-layout-gdef-table.hh +++ b/src/hb-ot-layout-gdef-table.hh @@ -410,7 +410,7 @@ struct GDEF struct accelerator_t { - HB_INTERNAL inline void init (hb_face_t *face); + HB_INTERNAL void init (hb_face_t *face); inline void fini (void) { diff --git a/src/hb-ot-layout-gpos-table.hh b/src/hb-ot-layout-gpos-table.hh index 399ede434..743a97931 100644 --- a/src/hb-ot-layout-gpos-table.hh +++ b/src/hb-ot-layout-gpos-table.hh @@ -1736,18 +1736,21 @@ GPOS::position_finish_offsets (hb_font_t *font HB_UNUSED, hb_buffer_t *buffer) } +struct GPOS_accelerator_t : GPOS::accelerator_t {}; + + /* Out-of-class implementation for methods recursing */ template /*static*/ inline typename context_t::return_t PosLookup::dispatch_recurse_func (context_t *c, unsigned int lookup_index) { - const PosLookup &l = _get_gpos_relaxed (c->face)->get_lookup (lookup_index); + const PosLookup &l = c->face->table.GPOS.get_relaxed ()->table->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_relaxed (c->face).get_lookup (lookup_index); + const PosLookup &l = c->face->table.GPOS.get_relaxed ()->table->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); @@ -1758,8 +1761,6 @@ template return ret; } -struct GPOS_accelerator_t : GPOS::accelerator_t {}; - } /* namespace OT */ diff --git a/src/hb-ot-layout-gsub-table.hh b/src/hb-ot-layout-gsub-table.hh index d24ea59af..cef642180 100644 --- a/src/hb-ot-layout-gsub-table.hh +++ b/src/hb-ot-layout-gsub-table.hh @@ -1487,6 +1487,9 @@ struct GSUB : GSUBGPOS }; +struct GSUB_accelerator_t : GSUB::accelerator_t {}; + + /* Out-of-class implementation for methods recursing */ /*static*/ inline bool ExtensionSubst::is_reverse (void) const @@ -1500,13 +1503,13 @@ struct GSUB : GSUBGPOS template /*static*/ inline typename context_t::return_t SubstLookup::dispatch_recurse_func (context_t *c, unsigned int lookup_index) { - const SubstLookup &l = _get_gsub_relaxed (c->face).get_lookup (lookup_index); + const SubstLookup &l = c->face->table.GSUB.get_relaxed ()->table->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_relaxed (c->face).get_lookup (lookup_index); + const SubstLookup &l = c->face->table.GSUB.get_relaxed ()->table->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); @@ -1517,8 +1520,6 @@ template return ret; } -struct GSUB_accelerator_t : GSUB::accelerator_t {}; - } /* namespace OT */ diff --git a/src/hb-ot-layout-gsubgpos.hh b/src/hb-ot-layout-gsubgpos.hh index 0d9eeae58..eccbcf420 100644 --- a/src/hb-ot-layout-gsubgpos.hh +++ b/src/hb-ot-layout-gsubgpos.hh @@ -491,7 +491,7 @@ struct hb_ot_apply_context_t : iter_input (), iter_context (), font (font_), face (font->face), buffer (buffer_), recurse_func (nullptr), - gdef (_get_gdef (face)), + gdef (*face->table.GDEF->table), var_store (gdef.get_var_store ()), direction (buffer_->props.direction), lookup_mask (1), diff --git a/src/hb-ot-layout.hh b/src/hb-ot-layout.hh index b29f87c5a..437ae4776 100644 --- a/src/hb-ot-layout.hh +++ b/src/hb-ot-layout.hh @@ -38,19 +38,9 @@ #include "hb-set-digest.hh" -namespace OT -{ - struct GDEF; - struct GSUB; - struct GPOS; -} - -HB_INTERNAL const OT::GDEF& _get_gdef (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); - struct hb_ot_shape_plan_t; + /* * kern */