[OT] Use relaxed ops for recursing into GSUB/GPOS lookups again
authorBehdad Esfahbod <behdad@behdad.org>
Sun, 26 Aug 2018 16:12:25 +0000 (09:12 -0700)
committerBehdad Esfahbod <behdad@behdad.org>
Sun, 26 Aug 2018 16:12:25 +0000 (09:12 -0700)
src/hb-ot-layout-gpos-table.hh
src/hb-ot-layout-gsub-table.hh
src/hb-ot-layout.cc
src/hb-ot-layout.hh

index 7d3c3ba..08a99b3 100644 (file)
@@ -1630,13 +1630,13 @@ GPOS::position_finish_offsets (hb_font_t *font HB_UNUSED, hb_buffer_t *buffer)
 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 (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);
index 991b556..8911a5e 100644 (file)
@@ -1351,13 +1351,13 @@ GSUB::substitute_start (hb_font_t *font, hb_buffer_t *buffer)
 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 (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);
index 6e9b5f8..4d2aeee 100644 (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 ();
   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;
+}
 
 
 /*
index 7abaaaa..8498139 100644 (file)
@@ -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: */