From 4119f73c21f5fae7635d0c0658732b339711a76c Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Wed, 8 Jun 2022 06:34:48 -0600 Subject: [PATCH] [subset/layout] Rename dispatch_closure_lookups_recurse_func to dispatch_recurse_func<> --- src/OT/Layout/GSUB/SubstLookup.hh | 4 ---- src/hb-ot-layout-gpos-table.hh | 7 +++---- src/hb-ot-layout-gsub-table.hh | 4 +++- src/hb-ot-layout-gsubgpos.hh | 2 ++ 4 files changed, 8 insertions(+), 9 deletions(-) diff --git a/src/OT/Layout/GSUB/SubstLookup.hh b/src/OT/Layout/GSUB/SubstLookup.hh index b7299501f..180615cf1 100644 --- a/src/OT/Layout/GSUB/SubstLookup.hh +++ b/src/OT/Layout/GSUB/SubstLookup.hh @@ -73,8 +73,6 @@ struct SubstLookup : Lookup return hb_closure_lookups_context_t::default_return_value (); } - c->set_recurse_func (dispatch_closure_lookups_recurse_func); - hb_closure_lookups_context_t::return_t ret = dispatch (c); return ret; } @@ -204,8 +202,6 @@ struct SubstLookup : Lookup return ret; } - HB_INTERNAL static hb_closure_lookups_context_t::return_t dispatch_closure_lookups_recurse_func (hb_closure_lookups_context_t *c, unsigned lookup_index); - template typename context_t::return_t dispatch (context_t *c, Ts&&... ds) const { return Lookup::dispatch (c, std::forward (ds)...); } diff --git a/src/hb-ot-layout-gpos-table.hh b/src/hb-ot-layout-gpos-table.hh index 6aa0966ec..1a6787765 100644 --- a/src/hb-ot-layout-gpos-table.hh +++ b/src/hb-ot-layout-gpos-table.hh @@ -2918,7 +2918,6 @@ struct PosLookup : Lookup c->set_lookup_inactive (this_index); return hb_closure_lookups_context_t::default_return_value (); } - c->set_recurse_func (dispatch_closure_lookups_recurse_func); hb_closure_lookups_context_t::return_t ret = dispatch (c); return ret; @@ -2934,8 +2933,6 @@ struct PosLookup : Lookup template static typename context_t::return_t dispatch_recurse_func (context_t *c, unsigned int lookup_index); - HB_INTERNAL static hb_closure_lookups_context_t::return_t dispatch_closure_lookups_recurse_func (hb_closure_lookups_context_t *c, unsigned this_index); - template typename context_t::return_t dispatch (context_t *c, Ts&&... ds) const { return Lookup::dispatch (c, std::forward (ds)...); } @@ -3120,7 +3117,9 @@ template return l.dispatch (c); } -/*static*/ inline hb_closure_lookups_context_t::return_t PosLookup::dispatch_closure_lookups_recurse_func (hb_closure_lookups_context_t *c, unsigned this_index) +template <> +inline hb_closure_lookups_context_t::return_t +PosLookup::dispatch_recurse_func (hb_closure_lookups_context_t *c, unsigned this_index) { const PosLookup &l = c->face->table.GPOS.get_relaxed ()->table->get_lookup (this_index); return l.closure_lookups (c, this_index); diff --git a/src/hb-ot-layout-gsub-table.hh b/src/hb-ot-layout-gsub-table.hh index 59a638a5e..462542025 100644 --- a/src/hb-ot-layout-gsub-table.hh +++ b/src/hb-ot-layout-gsub-table.hh @@ -59,7 +59,9 @@ template return l.dispatch (c); } -/*static*/ inline hb_closure_lookups_context_t::return_t SubstLookup::dispatch_closure_lookups_recurse_func (hb_closure_lookups_context_t *c, unsigned this_index) +template <> +inline hb_closure_lookups_context_t::return_t +SubstLookup::dispatch_recurse_func (hb_closure_lookups_context_t *c, unsigned this_index) { const SubstLookup &l = c->face->table.GSUB.get_relaxed ()->table->get_lookup (this_index); return l.closure_lookups (c, this_index); diff --git a/src/hb-ot-layout-gsubgpos.hh b/src/hb-ot-layout-gsubgpos.hh index adfec335f..31da49865 100644 --- a/src/hb-ot-layout-gsubgpos.hh +++ b/src/hb-ot-layout-gsubgpos.hh @@ -3948,6 +3948,8 @@ struct GSUBGPOS hb_set_t visited_lookups, inactive_lookups; OT::hb_closure_lookups_context_t c (face, glyphs, &visited_lookups, &inactive_lookups); + c.set_recurse_func (TLookup::template dispatch_recurse_func); + for (unsigned lookup_index : + hb_iter (lookup_indexes)) reinterpret_cast (get_lookup (lookup_index)).closure_lookups (&c, lookup_index);