From 7d479900cd11bc88148cd601ee43bc5492ce5843 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Wed, 18 Jan 2012 21:19:32 -0500 Subject: [PATCH] Refactor the two remaining uses of _hb_ot_layout_skip_mark() --- src/hb-ot-layout-gsub-table.hh | 2 +- src/hb-ot-layout-gsubgpos-private.hh | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/hb-ot-layout-gsub-table.hh b/src/hb-ot-layout-gsub-table.hh index 77f440013..f7ec3cc0f 100644 --- a/src/hb-ot-layout-gsub-table.hh +++ b/src/hb-ot-layout-gsub-table.hh @@ -392,7 +392,7 @@ struct Ligature for (unsigned int i = 1; i < count; i++) { - while (_hb_ot_layout_skip_mark (c->face, &c->buffer->info[c->buffer->idx], c->lookup_props, NULL)) + while (c->should_mark_skip_current_glyph ()) { c->buffer->info[c->buffer->idx].lig_comp() = i; c->buffer->info[c->buffer->idx].lig_id() = lig_id; diff --git a/src/hb-ot-layout-gsubgpos-private.hh b/src/hb-ot-layout-gsubgpos-private.hh index 211f0f4cb..f1d03dc9b 100644 --- a/src/hb-ot-layout-gsubgpos-private.hh +++ b/src/hb-ot-layout-gsubgpos-private.hh @@ -67,7 +67,6 @@ struct hb_apply_context_t unsigned int lookup_props; unsigned int property; /* propety of first glyph */ - struct mark_skipping_forward_iterator_t { inline mark_skipping_forward_iterator_t (hb_apply_context_t *c_, @@ -146,6 +145,10 @@ struct hb_apply_context_t unsigned int num_items; }; + inline bool should_mark_skip_current_glyph (void) const + { + return _hb_ot_layout_skip_mark (face, &buffer->info[buffer->idx], lookup_props, NULL); + } @@ -314,7 +317,7 @@ static inline bool apply_lookup (hb_apply_context_t *c, */ for (unsigned int i = 0; i < count; /* NOP */) { - while (_hb_ot_layout_skip_mark (c->face, &c->buffer->info[c->buffer->idx], c->lookup_props, NULL)) + while (c->should_mark_skip_current_glyph ()) { if (unlikely (c->buffer->idx == end)) return true;