[dispatch] Don't require debug_depth for untraced objects

pull/2473/head
Behdad Esfahbod 5 years ago
parent 5bc4cedde6
commit 70d6696cc6
  1. 1
      src/hb-dispatch.hh
  2. 4
      src/hb-ot-layout-common.hh
  3. 20
      src/hb-ot-layout-gsubgpos.hh
  4. 4
      src/hb-ot-layout.cc

@ -44,6 +44,7 @@ struct hb_dispatch_context_t
Context* thiz () { return static_cast< Context *> (this); } Context* thiz () { return static_cast< Context *> (this); }
public: public:
const char *get_name () { return "UNKNOWN"; } const char *get_name () { return "UNKNOWN"; }
static constexpr unsigned debug_depth = 0;
static constexpr unsigned max_debug_depth = MaxDebugDepth; static constexpr unsigned max_debug_depth = MaxDebugDepth;
typedef Return return_t; typedef Return return_t;
template <typename T, typename F> template <typename T, typename F>

@ -160,15 +160,13 @@ struct hb_collect_variation_indices_context_t :
hb_set_t *layout_variation_indices; hb_set_t *layout_variation_indices;
const hb_set_t *glyph_set; const hb_set_t *glyph_set;
const hb_map_t *gpos_lookups; const hb_map_t *gpos_lookups;
unsigned int debug_depth;
hb_collect_variation_indices_context_t (hb_set_t *layout_variation_indices_, hb_collect_variation_indices_context_t (hb_set_t *layout_variation_indices_,
const hb_set_t *glyph_set_, const hb_set_t *glyph_set_,
const hb_map_t *gpos_lookups_) : const hb_map_t *gpos_lookups_) :
layout_variation_indices (layout_variation_indices_), layout_variation_indices (layout_variation_indices_),
glyph_set (glyph_set_), glyph_set (glyph_set_),
gpos_lookups (gpos_lookups_), gpos_lookups (gpos_lookups_) {}
debug_depth (0) {}
}; };
template<typename OutputArray> template<typename OutputArray>

@ -50,11 +50,9 @@ struct hb_intersects_context_t :
bool stop_sublookup_iteration (return_t r) const { return r; } bool stop_sublookup_iteration (return_t r) const { return r; }
const hb_set_t *glyphs; const hb_set_t *glyphs;
unsigned int debug_depth;
hb_intersects_context_t (const hb_set_t *glyphs_) : hb_intersects_context_t (const hb_set_t *glyphs_) :
glyphs (glyphs_), glyphs (glyphs_) {}
debug_depth (0) {}
}; };
struct hb_closure_context_t : struct hb_closure_context_t :
@ -100,7 +98,6 @@ struct hb_closure_context_t :
hb_set_t output[1]; hb_set_t output[1];
recurse_func_t recurse_func; recurse_func_t recurse_func;
unsigned int nesting_level_left; unsigned int nesting_level_left;
unsigned int debug_depth;
hb_closure_context_t (hb_face_t *face_, hb_closure_context_t (hb_face_t *face_,
hb_set_t *glyphs_, hb_set_t *glyphs_,
@ -110,7 +107,6 @@ struct hb_closure_context_t :
glyphs (glyphs_), glyphs (glyphs_),
recurse_func (nullptr), recurse_func (nullptr),
nesting_level_left (nesting_level_left_), nesting_level_left (nesting_level_left_),
debug_depth (0),
done_lookups (done_lookups_), done_lookups (done_lookups_),
lookup_count (0) lookup_count (0)
{} {}
@ -174,7 +170,6 @@ struct hb_closure_lookups_context_t :
const hb_set_t *glyphs; const hb_set_t *glyphs;
recurse_func_t recurse_func; recurse_func_t recurse_func;
unsigned int nesting_level_left; unsigned int nesting_level_left;
unsigned int debug_depth;
hb_closure_lookups_context_t (hb_face_t *face_, hb_closure_lookups_context_t (hb_face_t *face_,
const hb_set_t *glyphs_, const hb_set_t *glyphs_,
@ -185,7 +180,6 @@ struct hb_closure_lookups_context_t :
glyphs (glyphs_), glyphs (glyphs_),
recurse_func (nullptr), recurse_func (nullptr),
nesting_level_left (nesting_level_left_), nesting_level_left (nesting_level_left_),
debug_depth (0),
visited_lookups (visited_lookups_), visited_lookups (visited_lookups_),
inactive_lookups (inactive_lookups_), inactive_lookups (inactive_lookups_),
lookup_count (0) {} lookup_count (0) {}
@ -210,7 +204,6 @@ struct hb_would_apply_context_t :
const hb_codepoint_t *glyphs; const hb_codepoint_t *glyphs;
unsigned int len; unsigned int len;
bool zero_context; bool zero_context;
unsigned int debug_depth;
hb_would_apply_context_t (hb_face_t *face_, hb_would_apply_context_t (hb_face_t *face_,
const hb_codepoint_t *glyphs_, const hb_codepoint_t *glyphs_,
@ -219,8 +212,7 @@ struct hb_would_apply_context_t :
face (face_), face (face_),
glyphs (glyphs_), glyphs (glyphs_),
len (len_), len (len_),
zero_context (zero_context_), zero_context (zero_context_) {}
debug_depth (0) {}
}; };
struct hb_collect_glyphs_context_t : struct hb_collect_glyphs_context_t :
@ -276,7 +268,6 @@ struct hb_collect_glyphs_context_t :
recurse_func_t recurse_func; recurse_func_t recurse_func;
hb_set_t *recursed_lookups; hb_set_t *recursed_lookups;
unsigned int nesting_level_left; unsigned int nesting_level_left;
unsigned int debug_depth;
hb_collect_glyphs_context_t (hb_face_t *face_, hb_collect_glyphs_context_t (hb_face_t *face_,
hb_set_t *glyphs_before, /* OUT. May be NULL */ hb_set_t *glyphs_before, /* OUT. May be NULL */
@ -291,8 +282,7 @@ struct hb_collect_glyphs_context_t :
output (glyphs_output ? glyphs_output : hb_set_get_empty ()), output (glyphs_output ? glyphs_output : hb_set_get_empty ()),
recurse_func (nullptr), recurse_func (nullptr),
recursed_lookups (hb_set_create ()), recursed_lookups (hb_set_create ()),
nesting_level_left (nesting_level_left_), nesting_level_left (nesting_level_left_) {}
debug_depth (0) {}
~hb_collect_glyphs_context_t () { hb_set_destroy (recursed_lookups); } ~hb_collect_glyphs_context_t () { hb_set_destroy (recursed_lookups); }
void set_recurse_func (recurse_func_t func) { recurse_func = func; } void set_recurse_func (recurse_func_t func) { recurse_func = func; }
@ -315,11 +305,9 @@ struct hb_collect_coverage_context_t :
} }
hb_collect_coverage_context_t (set_t *set_) : hb_collect_coverage_context_t (set_t *set_) :
set (set_), set (set_) {}
debug_depth (0) {}
set_t *set; set_t *set;
unsigned int debug_depth;
}; };

@ -1977,11 +1977,9 @@ struct hb_get_glyph_alternates_dispatch_t :
bool stop_sublookup_iteration (return_t r) const { return r; } bool stop_sublookup_iteration (return_t r) const { return r; }
hb_face_t *face; hb_face_t *face;
unsigned int debug_depth;
hb_get_glyph_alternates_dispatch_t (hb_face_t *face) : hb_get_glyph_alternates_dispatch_t (hb_face_t *face) :
face (face), face (face) {}
debug_depth (0) {}
private: private:
template <typename T, typename ...Ts> auto template <typename T, typename ...Ts> auto

Loading…
Cancel
Save