Port apply to use hb_trace_t
This commit is contained in:
parent
969c9705ae
commit
6c42cddfe5
|
@ -1487,11 +1487,10 @@ struct PosLookup : Lookup
|
|||
inline bool apply_once (hb_ot_layout_context_t *layout,
|
||||
hb_buffer_t *buffer,
|
||||
unsigned int context_length,
|
||||
unsigned int nesting_level_left,
|
||||
unsigned int apply_depth) const
|
||||
unsigned int nesting_level_left) const
|
||||
{
|
||||
unsigned int lookup_type = get_type ();
|
||||
hb_apply_context_t context[1];
|
||||
hb_apply_context_t context[1] = {{}};
|
||||
|
||||
context->layout = layout;
|
||||
context->buffer = buffer;
|
||||
|
@ -1528,7 +1527,7 @@ struct PosLookup : Lookup
|
|||
bool done;
|
||||
if (~IN_MASK (buffer->in_pos) & mask)
|
||||
{
|
||||
done = apply_once (layout, buffer, NO_CONTEXT, MAX_NESTING_LEVEL, 0);
|
||||
done = apply_once (layout, buffer, NO_CONTEXT, MAX_NESTING_LEVEL);
|
||||
ret |= done;
|
||||
}
|
||||
else
|
||||
|
@ -1612,7 +1611,7 @@ static inline bool position_lookup (APPLY_ARG_DEF, unsigned int lookup_index)
|
|||
if (unlikely (context->context_length < 1))
|
||||
return false;
|
||||
|
||||
return l.apply_once (context->layout, context->buffer, context->context_length, context->nesting_level_left - 1, apply_depth + 1);
|
||||
return l.apply_once (context->layout, context->buffer, context->context_length, context->nesting_level_left - 1);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -772,11 +772,10 @@ struct SubstLookup : Lookup
|
|||
inline bool apply_once (hb_ot_layout_context_t *layout,
|
||||
hb_buffer_t *buffer,
|
||||
unsigned int context_length,
|
||||
unsigned int nesting_level_left,
|
||||
unsigned int apply_depth) const
|
||||
unsigned int nesting_level_left) const
|
||||
{
|
||||
unsigned int lookup_type = get_type ();
|
||||
hb_apply_context_t context[1];
|
||||
hb_apply_context_t context[1] = {{}};
|
||||
|
||||
context->layout = layout;
|
||||
context->buffer = buffer;
|
||||
|
@ -828,7 +827,7 @@ struct SubstLookup : Lookup
|
|||
while (buffer->in_pos < buffer->in_length)
|
||||
{
|
||||
if ((~IN_MASK (buffer->in_pos) & mask) &&
|
||||
apply_once (layout, buffer, NO_CONTEXT, MAX_NESTING_LEVEL, 0))
|
||||
apply_once (layout, buffer, NO_CONTEXT, MAX_NESTING_LEVEL))
|
||||
ret = true;
|
||||
else
|
||||
_hb_buffer_next_glyph (buffer);
|
||||
|
@ -844,7 +843,7 @@ struct SubstLookup : Lookup
|
|||
do
|
||||
{
|
||||
if ((~IN_MASK (buffer->in_pos) & mask) &&
|
||||
apply_once (layout, buffer, NO_CONTEXT, MAX_NESTING_LEVEL, 0))
|
||||
apply_once (layout, buffer, NO_CONTEXT, MAX_NESTING_LEVEL))
|
||||
ret = true;
|
||||
else
|
||||
buffer->in_pos--;
|
||||
|
@ -931,7 +930,7 @@ static inline bool substitute_lookup (APPLY_ARG_DEF, unsigned int lookup_index)
|
|||
if (unlikely (context->context_length < 1))
|
||||
return false;
|
||||
|
||||
return l.apply_once (context->layout, context->buffer, context->context_length, context->nesting_level_left - 1, apply_depth + 1);
|
||||
return l.apply_once (context->layout, context->buffer, context->context_length, context->nesting_level_left - 1);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -36,18 +36,14 @@
|
|||
#endif
|
||||
|
||||
#define TRACE_APPLY() \
|
||||
HB_STMT_START { \
|
||||
if (HB_DEBUG_APPLY) \
|
||||
_hb_trace ("APPLY", HB_FUNC, this, apply_depth, HB_DEBUG_APPLY); \
|
||||
} HB_STMT_END
|
||||
hb_trace_t<HB_DEBUG_APPLY> trace (&context->debug_depth); \
|
||||
trace.log ("APPLY", HB_FUNC, this);
|
||||
|
||||
|
||||
#define APPLY_ARG_DEF \
|
||||
hb_apply_context_t *context, \
|
||||
unsigned int apply_depth HB_UNUSED
|
||||
hb_apply_context_t *context
|
||||
#define APPLY_ARG \
|
||||
context, \
|
||||
(HB_DEBUG_APPLY ? apply_depth + 1 : 0)
|
||||
context
|
||||
|
||||
struct hb_apply_context_t
|
||||
{
|
||||
|
@ -57,6 +53,7 @@ struct hb_apply_context_t
|
|||
unsigned int nesting_level_left;
|
||||
unsigned int lookup_flag;
|
||||
unsigned int property; /* propety of first glyph (TODO remove) */
|
||||
unsigned int debug_depth;
|
||||
};
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue