[ot-layout] Simplify some access

This commit is contained in:
Behdad Esfahbod 2018-11-05 23:19:04 -05:00
parent db35409f0d
commit 33b006cc51
5 changed files with 13 additions and 21 deletions

View File

@ -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)
{

View File

@ -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 <typename context_t>
/*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 <typename context_t>
return ret;
}
struct GPOS_accelerator_t : GPOS::accelerator_t {};
} /* namespace OT */

View File

@ -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 <typename context_t>
/*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 <typename context_t>
return ret;
}
struct GSUB_accelerator_t : GSUB::accelerator_t {};
} /* namespace OT */

View File

@ -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),

View File

@ -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
*/