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;
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
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);
}
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;
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);
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--;
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);
}
#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
{
unsigned int nesting_level_left;
unsigned int lookup_flag;
unsigned int property; /* propety of first glyph (TODO remove) */
+ unsigned int debug_depth;
};