From e58b190292f85c9676fe14cf63d2831d4d6e6bab Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Fri, 31 Aug 2018 16:46:35 -0700 Subject: [PATCH] [subset] De-templatize hb_subset_context_t We're going to (finally) use virtual methods for hb_serialize_context_t customization, so don't need to carry a Serializer template variable around... Simplifies code. --- src/hb-machinery.hh | 2 +- src/hb-ot-layout-gsub-table.hh | 5 ++--- src/hb-subset.hh | 7 +++---- 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/src/hb-machinery.hh b/src/hb-machinery.hh index 0452693dd..26392b323 100644 --- a/src/hb-machinery.hh +++ b/src/hb-machinery.hh @@ -473,7 +473,7 @@ struct hb_serialize_context_t } template - inline Type *start_embed (void) + inline Type *start_embed (void) const { Type *ret = reinterpret_cast (this->head); return ret; diff --git a/src/hb-ot-layout-gsub-table.hh b/src/hb-ot-layout-gsub-table.hh index d7f898304..7f8489f39 100644 --- a/src/hb-ot-layout-gsub-table.hh +++ b/src/hb-ot-layout-gsub-table.hh @@ -1308,11 +1308,10 @@ struct GSUB : GSUBGPOS inline const SubstLookup& get_lookup (unsigned int i) const { return CastR (GSUBGPOS::get_lookup (i)); } - template - inline bool subset (hb_subset_context_t *c) + inline bool subset (hb_subset_context_t *c) { TRACE_SUBSET (this); - //struct GSUB *out = c->serializer->start_embed (); + struct GSUB *out = c->serializer->start_embed (); //XXX if (unlikely (!GSUBGPOS::subset (c))) return_trace (false); return_trace (true); } diff --git a/src/hb-subset.hh b/src/hb-subset.hh index 5202f73b0..9cdd388d7 100644 --- a/src/hb-subset.hh +++ b/src/hb-subset.hh @@ -36,9 +36,8 @@ #include "hb-subset-input.hh" #include "hb-subset-plan.hh" -template struct hb_subset_context_t : - hb_dispatch_context_t, bool, HB_DEBUG_SUBSET> + hb_dispatch_context_t { inline const char *get_name (void) { return "SUBSET"; } template @@ -47,11 +46,11 @@ struct hb_subset_context_t : bool stop_sublookup_iteration (bool r) const { return false; } hb_subset_plan_t *plan; - Serializer *serializer; + hb_serialize_context_t *serializer; unsigned int debug_depth; hb_subset_context_t (hb_subset_plan_t *plan_, - Serializer *serializer_) : + hb_serialize_context_t *serializer_) : plan (plan_), serializer (serializer_), debug_depth (0) {}