From 241eac9559465fa79f396570af4e87f455b7e9d5 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Wed, 28 Jan 2015 20:55:42 -0800 Subject: [PATCH] Hide internals of lookup accelerators --- src/hb-ot-layout-gsub-table.hh | 5 +++-- src/hb-ot-layout-private.hh | 5 +++++ src/hb-ot-layout.cc | 6 +++--- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/src/hb-ot-layout-gsub-table.hh b/src/hb-ot-layout-gsub-table.hh index 5d67be0..aaf3b51 100644 --- a/src/hb-ot-layout-gsub-table.hh +++ b/src/hb-ot-layout-gsub-table.hh @@ -1195,11 +1195,12 @@ struct SubstLookup : Lookup } } - inline bool would_apply (hb_would_apply_context_t *c, const hb_set_digest_t *digest) const + inline bool would_apply (hb_would_apply_context_t *c, + const hb_ot_layout_lookup_accelerator_t *accel) const { TRACE_WOULD_APPLY (this); if (unlikely (!c->len)) return TRACE_RETURN (false); - if (!digest->may_have (c->glyphs[0])) return TRACE_RETURN (false); + if (!accel->may_have (c->glyphs[0])) return TRACE_RETURN (false); return TRACE_RETURN (dispatch (c)); } diff --git a/src/hb-ot-layout-private.hh b/src/hb-ot-layout-private.hh index 3f7c858..47fecd2 100644 --- a/src/hb-ot-layout-private.hh +++ b/src/hb-ot-layout-private.hh @@ -130,6 +130,11 @@ struct hb_ot_layout_lookup_accelerator_t { } + inline bool may_have (hb_codepoint_t g) const { + return digest.may_have (g); + } + + private: hb_set_digest_t digest; }; diff --git a/src/hb-ot-layout.cc b/src/hb-ot-layout.cc index 602b94e..46809fc 100644 --- a/src/hb-ot-layout.cc +++ b/src/hb-ot-layout.cc @@ -699,7 +699,7 @@ hb_ot_layout_lookup_would_substitute_fast (hb_face_t *face, const OT::SubstLookup& l = hb_ot_layout_from_face (face)->gsub->get_lookup (lookup_index); - return l.would_apply (&c, &hb_ot_layout_from_face (face)->gsub_accels[lookup_index].digest); + return l.would_apply (&c, &hb_ot_layout_from_face (face)->gsub_accels[lookup_index]); } void @@ -861,7 +861,7 @@ apply_string (OT::hb_apply_context_t *c, while (buffer->idx < buffer->len) { - if (accel.digest.may_have (buffer->cur().codepoint) && + if (accel.may_have (buffer->cur().codepoint) && (buffer->cur().mask & c->lookup_mask) && apply_once (c, lookup)) ret = true; @@ -884,7 +884,7 @@ apply_string (OT::hb_apply_context_t *c, buffer->idx = buffer->len - 1; do { - if (accel.digest.may_have (buffer->cur().codepoint) && + if (accel.may_have (buffer->cur().codepoint) && (buffer->cur().mask & c->lookup_mask) && apply_once (c, lookup)) ret = true; -- 2.7.4