[OTLayout] Start porting sanitize() to process()

This commit is contained in:
Behdad Esfahbod 2012-11-23 17:29:05 -05:00
parent f48ec0e834
commit 2c53bd3c3e
2 changed files with 15 additions and 5 deletions

View File

@ -168,12 +168,22 @@ ASSERT_STATIC (Type::min_size + 1 <= sizeof (_Null##Type))
#define TRACE_SANITIZE(this) \
hb_auto_trace_t<HB_DEBUG_SANITIZE, bool> trace \
(&c->debug_depth, "SANITIZE", this, HB_FUNC, \
(&c->debug_depth, c->get_name (), this, HB_FUNC, \
"");
struct hb_sanitize_context_t
{
inline const char *get_name (void) { return "SANITIZE"; }
static const unsigned int max_debug_depth = HB_DEBUG_SANITIZE;
typedef bool return_t;
template <typename T>
inline return_t process (const T &obj) { return obj.sanitize (this); }
static return_t default_return_value (void) { return true; }
bool stop_sublookup_iteration (const return_t r) const { return false; }
return_t recurse (unsigned int lookup_index)
{ return default_return_value (); }
inline void init (hb_blob_t *b)
{
this->blob = hb_blob_reference (b);

View File

@ -50,7 +50,7 @@ namespace OT {
#define TRACE_CLOSURE(this) \
hb_auto_trace_t<HB_DEBUG_CLOSURE, void_t> trace \
(&c->debug_depth, "CLOSURE", this, HB_FUNC, \
(&c->debug_depth, c->get_name (), this, HB_FUNC, \
"");
struct hb_closure_context_t
@ -99,7 +99,7 @@ struct hb_closure_context_t
#define TRACE_WOULD_APPLY(this) \
hb_auto_trace_t<HB_DEBUG_WOULD_APPLY, bool> trace \
(&c->debug_depth, "WOULD_APPLY", this, HB_FUNC, \
(&c->debug_depth, c->get_name (), this, HB_FUNC, \
"%d glyphs", c->len);
struct hb_would_apply_context_t
@ -138,7 +138,7 @@ struct hb_would_apply_context_t
#define TRACE_COLLECT_GLYPHS(this) \
hb_auto_trace_t<HB_DEBUG_COLLECT_GLYPHS, void_t> trace \
(&c->debug_depth, "COLLECT_GLYPHS", this, HB_FUNC, \
(&c->debug_depth, c->get_name (), this, HB_FUNC, \
"");
struct hb_collect_glyphs_context_t
@ -206,7 +206,7 @@ struct hb_get_coverage_context_t
#define TRACE_APPLY(this) \
hb_auto_trace_t<HB_DEBUG_APPLY, bool> trace \
(&c->debug_depth, "APPLY", this, HB_FUNC, \
(&c->debug_depth, c->get_name (), this, HB_FUNC, \
"idx %d codepoint %u", c->buffer->idx, c->buffer->cur().codepoint);
struct hb_apply_context_t