Remove tracing from closure
This commit is contained in:
parent
d9f6be3a61
commit
0772c06f96
|
@ -401,18 +401,6 @@ struct hb_no_trace_t {
|
||||||
#define TRACE_APPLY(this) hb_no_trace_t<bool> trace
|
#define TRACE_APPLY(this) hb_no_trace_t<bool> trace
|
||||||
#endif
|
#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<HB_DEBUG_CLOSURE, hb_void_t> trace \
|
|
||||||
(&c->debug_depth, c->get_name (), this, HB_FUNC, \
|
|
||||||
" ")
|
|
||||||
#else
|
|
||||||
#define TRACE_CLOSURE(this) hb_no_trace_t<hb_void_t> trace HB_UNUSED
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef HB_DEBUG_COLLECT_GLYPHS
|
#ifndef HB_DEBUG_COLLECT_GLYPHS
|
||||||
#define HB_DEBUG_COLLECT_GLYPHS (HB_DEBUG+0)
|
#define HB_DEBUG_COLLECT_GLYPHS (HB_DEBUG+0)
|
||||||
#endif
|
#endif
|
||||||
|
@ -476,7 +464,6 @@ struct hb_no_trace_t {
|
||||||
#ifndef HB_DEBUG_DISPATCH
|
#ifndef HB_DEBUG_DISPATCH
|
||||||
#define HB_DEBUG_DISPATCH ( \
|
#define HB_DEBUG_DISPATCH ( \
|
||||||
HB_DEBUG_APPLY + \
|
HB_DEBUG_APPLY + \
|
||||||
HB_DEBUG_CLOSURE + \
|
|
||||||
HB_DEBUG_COLLECT_GLYPHS + \
|
HB_DEBUG_COLLECT_GLYPHS + \
|
||||||
HB_DEBUG_SANITIZE + \
|
HB_DEBUG_SANITIZE + \
|
||||||
HB_DEBUG_SERIALIZE + \
|
HB_DEBUG_SERIALIZE + \
|
||||||
|
|
|
@ -46,7 +46,6 @@ struct SingleSubstFormat1
|
||||||
|
|
||||||
void closure (hb_closure_context_t *c) const
|
void closure (hb_closure_context_t *c) const
|
||||||
{
|
{
|
||||||
TRACE_CLOSURE (this);
|
|
||||||
for (Coverage::Iter iter (this+coverage); iter.more (); iter.next ())
|
for (Coverage::Iter iter (this+coverage); iter.more (); iter.next ())
|
||||||
{
|
{
|
||||||
/* TODO Switch to range-based API to work around malicious fonts.
|
/* 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
|
void closure (hb_closure_context_t *c) const
|
||||||
{
|
{
|
||||||
TRACE_CLOSURE (this);
|
|
||||||
unsigned int count = substitute.len;
|
unsigned int count = substitute.len;
|
||||||
for (Coverage::Iter iter (this+coverage); iter.more (); iter.next ())
|
for (Coverage::Iter iter (this+coverage); iter.more (); iter.next ())
|
||||||
{
|
{
|
||||||
|
@ -298,7 +296,6 @@ struct Sequence
|
||||||
{
|
{
|
||||||
void closure (hb_closure_context_t *c) const
|
void closure (hb_closure_context_t *c) const
|
||||||
{
|
{
|
||||||
TRACE_CLOSURE (this);
|
|
||||||
unsigned int count = substitute.len;
|
unsigned int count = substitute.len;
|
||||||
for (unsigned int i = 0; i < count; i++)
|
for (unsigned int i = 0; i < count; i++)
|
||||||
c->out->add (substitute[i]);
|
c->out->add (substitute[i]);
|
||||||
|
@ -369,7 +366,6 @@ struct MultipleSubstFormat1
|
||||||
|
|
||||||
void closure (hb_closure_context_t *c) const
|
void closure (hb_closure_context_t *c) const
|
||||||
{
|
{
|
||||||
TRACE_CLOSURE (this);
|
|
||||||
unsigned int count = sequence.len;
|
unsigned int count = sequence.len;
|
||||||
for (Coverage::Iter iter (this+coverage); iter.more (); iter.next ())
|
for (Coverage::Iter iter (this+coverage); iter.more (); iter.next ())
|
||||||
{
|
{
|
||||||
|
@ -490,7 +486,6 @@ struct AlternateSet
|
||||||
{
|
{
|
||||||
void closure (hb_closure_context_t *c) const
|
void closure (hb_closure_context_t *c) const
|
||||||
{
|
{
|
||||||
TRACE_CLOSURE (this);
|
|
||||||
unsigned int count = alternates.len;
|
unsigned int count = alternates.len;
|
||||||
for (unsigned int i = 0; i < count; i++)
|
for (unsigned int i = 0; i < count; i++)
|
||||||
c->out->add (alternates[i]);
|
c->out->add (alternates[i]);
|
||||||
|
@ -555,7 +550,6 @@ struct AlternateSubstFormat1
|
||||||
|
|
||||||
void closure (hb_closure_context_t *c) const
|
void closure (hb_closure_context_t *c) const
|
||||||
{
|
{
|
||||||
TRACE_CLOSURE (this);
|
|
||||||
unsigned int count = alternateSet.len;
|
unsigned int count = alternateSet.len;
|
||||||
for (Coverage::Iter iter (this+coverage); iter.more (); iter.next ())
|
for (Coverage::Iter iter (this+coverage); iter.more (); iter.next ())
|
||||||
{
|
{
|
||||||
|
@ -690,7 +684,6 @@ struct Ligature
|
||||||
|
|
||||||
void closure (hb_closure_context_t *c) const
|
void closure (hb_closure_context_t *c) const
|
||||||
{
|
{
|
||||||
TRACE_CLOSURE (this);
|
|
||||||
unsigned int count = component.lenP1;
|
unsigned int count = component.lenP1;
|
||||||
for (unsigned int i = 1; i < count; i++)
|
for (unsigned int i = 1; i < count; i++)
|
||||||
if (!c->glyphs->has (component[i]))
|
if (!c->glyphs->has (component[i]))
|
||||||
|
@ -798,7 +791,6 @@ struct LigatureSet
|
||||||
|
|
||||||
void closure (hb_closure_context_t *c) const
|
void closure (hb_closure_context_t *c) const
|
||||||
{
|
{
|
||||||
TRACE_CLOSURE (this);
|
|
||||||
unsigned int num_ligs = ligature.len;
|
unsigned int num_ligs = ligature.len;
|
||||||
for (unsigned int i = 0; i < num_ligs; i++)
|
for (unsigned int i = 0; i < num_ligs; i++)
|
||||||
(this+ligature[i]).closure (c);
|
(this+ligature[i]).closure (c);
|
||||||
|
@ -891,7 +883,6 @@ struct LigatureSubstFormat1
|
||||||
|
|
||||||
void closure (hb_closure_context_t *c) const
|
void closure (hb_closure_context_t *c) const
|
||||||
{
|
{
|
||||||
TRACE_CLOSURE (this);
|
|
||||||
unsigned int count = ligatureSet.len;
|
unsigned int count = ligatureSet.len;
|
||||||
for (Coverage::Iter iter (this+coverage); iter.more (); iter.next ())
|
for (Coverage::Iter iter (this+coverage); iter.more (); iter.next ())
|
||||||
{
|
{
|
||||||
|
@ -1068,7 +1059,6 @@ struct ReverseChainSingleSubstFormat1
|
||||||
|
|
||||||
void closure (hb_closure_context_t *c) const
|
void closure (hb_closure_context_t *c) const
|
||||||
{
|
{
|
||||||
TRACE_CLOSURE (this);
|
|
||||||
const OffsetArrayOf<Coverage> &lookahead = StructAfter<OffsetArrayOf<Coverage> > (backtrack);
|
const OffsetArrayOf<Coverage> &lookahead = StructAfter<OffsetArrayOf<Coverage> > (backtrack);
|
||||||
|
|
||||||
unsigned int count;
|
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
|
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))
|
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);
|
c->set_recurse_func (dispatch_closure_recurse_func);
|
||||||
|
|
||||||
|
@ -1312,7 +1301,7 @@ struct SubstLookup : Lookup
|
||||||
|
|
||||||
c->flush ();
|
c->flush ();
|
||||||
|
|
||||||
return_trace (ret);
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
hb_collect_glyphs_context_t::return_t collect_glyphs (hb_collect_glyphs_context_t *c) const
|
hb_collect_glyphs_context_t::return_t collect_glyphs (hb_collect_glyphs_context_t *c) const
|
||||||
|
|
|
@ -59,7 +59,7 @@ struct hb_intersects_context_t :
|
||||||
};
|
};
|
||||||
|
|
||||||
struct hb_closure_context_t :
|
struct hb_closure_context_t :
|
||||||
hb_dispatch_context_t<hb_closure_context_t, hb_void_t, HB_DEBUG_CLOSURE>
|
hb_dispatch_context_t<hb_closure_context_t, hb_void_t, 0>
|
||||||
{
|
{
|
||||||
const char *get_name () { return "CLOSURE"; }
|
const char *get_name () { return "CLOSURE"; }
|
||||||
typedef return_t (*recurse_func_t) (hb_closure_context_t *c, unsigned int lookup_index);
|
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
|
void closure (hb_closure_context_t *c, ContextClosureLookupContext &lookup_context) const
|
||||||
{
|
{
|
||||||
TRACE_CLOSURE (this);
|
|
||||||
const UnsizedArrayOf<LookupRecord> &lookupRecord = StructAfter<UnsizedArrayOf<LookupRecord> >
|
const UnsizedArrayOf<LookupRecord> &lookupRecord = StructAfter<UnsizedArrayOf<LookupRecord> >
|
||||||
(inputZ.as_array ((inputCount ? inputCount - 1 : 0)));
|
(inputZ.as_array ((inputCount ? inputCount - 1 : 0)));
|
||||||
context_closure_lookup (c,
|
context_closure_lookup (c,
|
||||||
|
@ -1376,7 +1375,6 @@ struct RuleSet
|
||||||
void closure (hb_closure_context_t *c,
|
void closure (hb_closure_context_t *c,
|
||||||
ContextClosureLookupContext &lookup_context) const
|
ContextClosureLookupContext &lookup_context) const
|
||||||
{
|
{
|
||||||
TRACE_CLOSURE (this);
|
|
||||||
unsigned int num_rules = rule.len;
|
unsigned int num_rules = rule.len;
|
||||||
for (unsigned int i = 0; i < num_rules; i++)
|
for (unsigned int i = 0; i < num_rules; i++)
|
||||||
(this+rule[i]).closure (c, lookup_context);
|
(this+rule[i]).closure (c, lookup_context);
|
||||||
|
@ -1455,8 +1453,6 @@ struct ContextFormat1
|
||||||
|
|
||||||
void closure (hb_closure_context_t *c) const
|
void closure (hb_closure_context_t *c) const
|
||||||
{
|
{
|
||||||
TRACE_CLOSURE (this);
|
|
||||||
|
|
||||||
struct ContextClosureLookupContext lookup_context = {
|
struct ContextClosureLookupContext lookup_context = {
|
||||||
{intersects_glyph},
|
{intersects_glyph},
|
||||||
nullptr
|
nullptr
|
||||||
|
@ -1567,7 +1563,6 @@ struct ContextFormat2
|
||||||
|
|
||||||
void closure (hb_closure_context_t *c) const
|
void closure (hb_closure_context_t *c) const
|
||||||
{
|
{
|
||||||
TRACE_CLOSURE (this);
|
|
||||||
if (!(this+coverage).intersects (c->glyphs))
|
if (!(this+coverage).intersects (c->glyphs))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
@ -1681,7 +1676,6 @@ struct ContextFormat3
|
||||||
|
|
||||||
void closure (hb_closure_context_t *c) const
|
void closure (hb_closure_context_t *c) const
|
||||||
{
|
{
|
||||||
TRACE_CLOSURE (this);
|
|
||||||
if (!(this+coverageZ[0]).intersects (c->glyphs))
|
if (!(this+coverageZ[0]).intersects (c->glyphs))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
@ -1950,7 +1944,6 @@ struct ChainRule
|
||||||
void closure (hb_closure_context_t *c,
|
void closure (hb_closure_context_t *c,
|
||||||
ChainContextClosureLookupContext &lookup_context) const
|
ChainContextClosureLookupContext &lookup_context) const
|
||||||
{
|
{
|
||||||
TRACE_CLOSURE (this);
|
|
||||||
const HeadlessArrayOf<HBUINT16> &input = StructAfter<HeadlessArrayOf<HBUINT16> > (backtrack);
|
const HeadlessArrayOf<HBUINT16> &input = StructAfter<HeadlessArrayOf<HBUINT16> > (backtrack);
|
||||||
const ArrayOf<HBUINT16> &lookahead = StructAfter<ArrayOf<HBUINT16> > (input);
|
const ArrayOf<HBUINT16> &lookahead = StructAfter<ArrayOf<HBUINT16> > (input);
|
||||||
const ArrayOf<LookupRecord> &lookup = StructAfter<ArrayOf<LookupRecord> > (lookahead);
|
const ArrayOf<LookupRecord> &lookup = StructAfter<ArrayOf<LookupRecord> > (lookahead);
|
||||||
|
@ -2046,7 +2039,6 @@ struct ChainRuleSet
|
||||||
}
|
}
|
||||||
void closure (hb_closure_context_t *c, ChainContextClosureLookupContext &lookup_context) const
|
void closure (hb_closure_context_t *c, ChainContextClosureLookupContext &lookup_context) const
|
||||||
{
|
{
|
||||||
TRACE_CLOSURE (this);
|
|
||||||
unsigned int num_rules = rule.len;
|
unsigned int num_rules = rule.len;
|
||||||
for (unsigned int i = 0; i < num_rules; i++)
|
for (unsigned int i = 0; i < num_rules; i++)
|
||||||
(this+rule[i]).closure (c, lookup_context);
|
(this+rule[i]).closure (c, lookup_context);
|
||||||
|
@ -2119,8 +2111,6 @@ struct ChainContextFormat1
|
||||||
|
|
||||||
void closure (hb_closure_context_t *c) const
|
void closure (hb_closure_context_t *c) const
|
||||||
{
|
{
|
||||||
TRACE_CLOSURE (this);
|
|
||||||
|
|
||||||
struct ChainContextClosureLookupContext lookup_context = {
|
struct ChainContextClosureLookupContext lookup_context = {
|
||||||
{intersects_glyph},
|
{intersects_glyph},
|
||||||
{nullptr, nullptr, nullptr}
|
{nullptr, nullptr, nullptr}
|
||||||
|
@ -2232,7 +2222,6 @@ struct ChainContextFormat2
|
||||||
}
|
}
|
||||||
void closure (hb_closure_context_t *c) const
|
void closure (hb_closure_context_t *c) const
|
||||||
{
|
{
|
||||||
TRACE_CLOSURE (this);
|
|
||||||
if (!(this+coverage).intersects (c->glyphs))
|
if (!(this+coverage).intersects (c->glyphs))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
@ -2382,7 +2371,6 @@ struct ChainContextFormat3
|
||||||
|
|
||||||
void closure (hb_closure_context_t *c) const
|
void closure (hb_closure_context_t *c) const
|
||||||
{
|
{
|
||||||
TRACE_CLOSURE (this);
|
|
||||||
const OffsetArrayOf<Coverage> &input = StructAfter<OffsetArrayOf<Coverage> > (backtrack);
|
const OffsetArrayOf<Coverage> &input = StructAfter<OffsetArrayOf<Coverage> > (backtrack);
|
||||||
|
|
||||||
if (!(this+input[0]).intersects (c->glyphs))
|
if (!(this+input[0]).intersects (c->glyphs))
|
||||||
|
|
Loading…
Reference in New Issue