[OT] Use relaxed ops for recursing into GSUB/GPOS lookups again

This commit is contained in:
Behdad Esfahbod 2018-08-26 09:12:25 -07:00
parent d8c57e85d9
commit 3999094682
4 changed files with 16 additions and 8 deletions

View File

@ -1630,13 +1630,13 @@ GPOS::position_finish_offsets (hb_font_t *font HB_UNUSED, hb_buffer_t *buffer)
template <typename context_t> template <typename context_t>
/*static*/ inline typename context_t::return_t PosLookup::dispatch_recurse_func (context_t *c, unsigned int lookup_index) /*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); return l.dispatch (c);
} }
/*static*/ inline bool PosLookup::apply_recurse_func (hb_ot_apply_context_t *c, unsigned int lookup_index) /*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_props = c->lookup_props;
unsigned int saved_lookup_index = c->lookup_index; unsigned int saved_lookup_index = c->lookup_index;
c->set_lookup_index (lookup_index); c->set_lookup_index (lookup_index);

View File

@ -1351,13 +1351,13 @@ GSUB::substitute_start (hb_font_t *font, hb_buffer_t *buffer)
template <typename context_t> template <typename context_t>
/*static*/ inline typename context_t::return_t SubstLookup::dispatch_recurse_func (context_t *c, unsigned int lookup_index) /*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); return l.dispatch (c);
} }
/*static*/ inline bool SubstLookup::apply_recurse_func (hb_ot_apply_context_t *c, unsigned int lookup_index) /*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_props = c->lookup_props;
unsigned int saved_lookup_index = c->lookup_index; unsigned int saved_lookup_index = c->lookup_index;
c->set_lookup_index (lookup_index); c->set_lookup_index (lookup_index);

View File

@ -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 (); if (unlikely (!hb_ot_shaper_face_data_ensure (face))) return hb_blob_get_empty ();
return hb_ot_face_data (face)->table.GSUB->blob; 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); if (unlikely (!hb_ot_shaper_face_data_ensure (face))) return Null(OT::GSUB);
return *hb_ot_face_data (face)->table.GSUB->table; 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) 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 (); if (unlikely (!hb_ot_shaper_face_data_ensure (face))) return hb_blob_get_empty ();
return hb_ot_face_data (face)->table.GPOS->blob; 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); if (unlikely (!hb_ot_shaper_face_data_ensure (face))) return Null(OT::GPOS);
return *hb_ot_face_data (face)->table.GPOS->table; 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;
}
/* /*

View File

@ -45,8 +45,8 @@ namespace OT
} }
HB_INTERNAL const OT::GDEF& _get_gdef (hb_face_t *face); 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::GSUB& _get_gsub_relaxed (hb_face_t *face);
HB_INTERNAL const OT::GPOS& _get_gpos (hb_face_t *face); HB_INTERNAL const OT::GPOS& _get_gpos_relaxed (hb_face_t *face);
/* Private API corresponding to hb-ot-layout.h: */ /* Private API corresponding to hb-ot-layout.h: */