From 0772c06f96c3f5a319485c390416531b8125251b Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Fri, 18 Jan 2019 12:53:06 -0500 Subject: [PATCH] Remove tracing from closure --- src/hb-debug.hh | 13 ------------- src/hb-ot-layout-gsub-table.hh | 15 ++------------- src/hb-ot-layout-gsubgpos.hh | 14 +------------- 3 files changed, 3 insertions(+), 39 deletions(-) diff --git a/src/hb-debug.hh b/src/hb-debug.hh index 41a85b58c..eaf444146 100644 --- a/src/hb-debug.hh +++ b/src/hb-debug.hh @@ -401,18 +401,6 @@ struct hb_no_trace_t { #define TRACE_APPLY(this) hb_no_trace_t trace #endif -#ifndef HB_DEBUG_CLOSURE -#define HB_DEBUG_CLOSURE (HB_DEBUG+0) -#endif -#if HB_DEBUG_CLOSURE -#define TRACE_CLOSURE(this) \ - hb_auto_trace_t trace \ - (&c->debug_depth, c->get_name (), this, HB_FUNC, \ - " ") -#else -#define TRACE_CLOSURE(this) hb_no_trace_t trace HB_UNUSED -#endif - #ifndef HB_DEBUG_COLLECT_GLYPHS #define HB_DEBUG_COLLECT_GLYPHS (HB_DEBUG+0) #endif @@ -476,7 +464,6 @@ struct hb_no_trace_t { #ifndef HB_DEBUG_DISPATCH #define HB_DEBUG_DISPATCH ( \ HB_DEBUG_APPLY + \ - HB_DEBUG_CLOSURE + \ HB_DEBUG_COLLECT_GLYPHS + \ HB_DEBUG_SANITIZE + \ HB_DEBUG_SERIALIZE + \ diff --git a/src/hb-ot-layout-gsub-table.hh b/src/hb-ot-layout-gsub-table.hh index 7037cbacd..710ea01cb 100644 --- a/src/hb-ot-layout-gsub-table.hh +++ b/src/hb-ot-layout-gsub-table.hh @@ -46,7 +46,6 @@ struct SingleSubstFormat1 void closure (hb_closure_context_t *c) const { - TRACE_CLOSURE (this); for (Coverage::Iter iter (this+coverage); iter.more (); iter.next ()) { /* TODO Switch to range-based API to work around malicious fonts. @@ -147,7 +146,6 @@ struct SingleSubstFormat2 void closure (hb_closure_context_t *c) const { - TRACE_CLOSURE (this); unsigned int count = substitute.len; for (Coverage::Iter iter (this+coverage); iter.more (); iter.next ()) { @@ -298,7 +296,6 @@ struct Sequence { void closure (hb_closure_context_t *c) const { - TRACE_CLOSURE (this); unsigned int count = substitute.len; for (unsigned int i = 0; i < count; i++) c->out->add (substitute[i]); @@ -369,7 +366,6 @@ struct MultipleSubstFormat1 void closure (hb_closure_context_t *c) const { - TRACE_CLOSURE (this); unsigned int count = sequence.len; for (Coverage::Iter iter (this+coverage); iter.more (); iter.next ()) { @@ -490,7 +486,6 @@ struct AlternateSet { void closure (hb_closure_context_t *c) const { - TRACE_CLOSURE (this); unsigned int count = alternates.len; for (unsigned int i = 0; i < count; i++) c->out->add (alternates[i]); @@ -555,7 +550,6 @@ struct AlternateSubstFormat1 void closure (hb_closure_context_t *c) const { - TRACE_CLOSURE (this); unsigned int count = alternateSet.len; for (Coverage::Iter iter (this+coverage); iter.more (); iter.next ()) { @@ -690,7 +684,6 @@ struct Ligature void closure (hb_closure_context_t *c) const { - TRACE_CLOSURE (this); unsigned int count = component.lenP1; for (unsigned int i = 1; i < count; i++) if (!c->glyphs->has (component[i])) @@ -798,7 +791,6 @@ struct LigatureSet void closure (hb_closure_context_t *c) const { - TRACE_CLOSURE (this); unsigned int num_ligs = ligature.len; for (unsigned int i = 0; i < num_ligs; i++) (this+ligature[i]).closure (c); @@ -891,7 +883,6 @@ struct LigatureSubstFormat1 void closure (hb_closure_context_t *c) const { - TRACE_CLOSURE (this); unsigned int count = ligatureSet.len; for (Coverage::Iter iter (this+coverage); iter.more (); iter.next ()) { @@ -1068,7 +1059,6 @@ struct ReverseChainSingleSubstFormat1 void closure (hb_closure_context_t *c) const { - TRACE_CLOSURE (this); const OffsetArrayOf &lookahead = StructAfter > (backtrack); unsigned int count; @@ -1302,9 +1292,8 @@ struct SubstLookup : Lookup hb_closure_context_t::return_t closure (hb_closure_context_t *c, unsigned int this_index) const { - TRACE_CLOSURE (this); if (!c->should_visit_lookup (this_index)) - return_trace (HB_VOID); + return hb_closure_context_t::default_return_value (); c->set_recurse_func (dispatch_closure_recurse_func); @@ -1312,7 +1301,7 @@ struct SubstLookup : Lookup c->flush (); - return_trace (ret); + return ret; } hb_collect_glyphs_context_t::return_t collect_glyphs (hb_collect_glyphs_context_t *c) const diff --git a/src/hb-ot-layout-gsubgpos.hh b/src/hb-ot-layout-gsubgpos.hh index dd44e746a..7c31b28c8 100644 --- a/src/hb-ot-layout-gsubgpos.hh +++ b/src/hb-ot-layout-gsubgpos.hh @@ -59,7 +59,7 @@ struct hb_intersects_context_t : }; struct hb_closure_context_t : - hb_dispatch_context_t + hb_dispatch_context_t { const char *get_name () { return "CLOSURE"; } typedef return_t (*recurse_func_t) (hb_closure_context_t *c, unsigned int lookup_index); @@ -1296,7 +1296,6 @@ struct Rule void closure (hb_closure_context_t *c, ContextClosureLookupContext &lookup_context) const { - TRACE_CLOSURE (this); const UnsizedArrayOf &lookupRecord = StructAfter > (inputZ.as_array ((inputCount ? inputCount - 1 : 0))); context_closure_lookup (c, @@ -1376,7 +1375,6 @@ struct RuleSet void closure (hb_closure_context_t *c, ContextClosureLookupContext &lookup_context) const { - TRACE_CLOSURE (this); unsigned int num_rules = rule.len; for (unsigned int i = 0; i < num_rules; i++) (this+rule[i]).closure (c, lookup_context); @@ -1455,8 +1453,6 @@ struct ContextFormat1 void closure (hb_closure_context_t *c) const { - TRACE_CLOSURE (this); - struct ContextClosureLookupContext lookup_context = { {intersects_glyph}, nullptr @@ -1567,7 +1563,6 @@ struct ContextFormat2 void closure (hb_closure_context_t *c) const { - TRACE_CLOSURE (this); if (!(this+coverage).intersects (c->glyphs)) return; @@ -1681,7 +1676,6 @@ struct ContextFormat3 void closure (hb_closure_context_t *c) const { - TRACE_CLOSURE (this); if (!(this+coverageZ[0]).intersects (c->glyphs)) return; @@ -1950,7 +1944,6 @@ struct ChainRule void closure (hb_closure_context_t *c, ChainContextClosureLookupContext &lookup_context) const { - TRACE_CLOSURE (this); const HeadlessArrayOf &input = StructAfter > (backtrack); const ArrayOf &lookahead = StructAfter > (input); const ArrayOf &lookup = StructAfter > (lookahead); @@ -2046,7 +2039,6 @@ struct ChainRuleSet } void closure (hb_closure_context_t *c, ChainContextClosureLookupContext &lookup_context) const { - TRACE_CLOSURE (this); unsigned int num_rules = rule.len; for (unsigned int i = 0; i < num_rules; i++) (this+rule[i]).closure (c, lookup_context); @@ -2119,8 +2111,6 @@ struct ChainContextFormat1 void closure (hb_closure_context_t *c) const { - TRACE_CLOSURE (this); - struct ChainContextClosureLookupContext lookup_context = { {intersects_glyph}, {nullptr, nullptr, nullptr} @@ -2232,7 +2222,6 @@ struct ChainContextFormat2 } void closure (hb_closure_context_t *c) const { - TRACE_CLOSURE (this); if (!(this+coverage).intersects (c->glyphs)) return; @@ -2382,7 +2371,6 @@ struct ChainContextFormat3 void closure (hb_closure_context_t *c) const { - TRACE_CLOSURE (this); const OffsetArrayOf &input = StructAfter > (backtrack); if (!(this+input[0]).intersects (c->glyphs))