From d40c079fed8a15a3ab556290afbfc19dce19727f Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Wed, 5 Feb 2025 12:30:56 +0000 Subject: [PATCH] [morx] Use hb_bit_set_t instead of hb_set_t directly --- src/hb-aat-layout-common.hh | 5 +++-- src/hb-aat-layout-morx-table.hh | 16 ++++++++-------- src/hb-buffer.hh | 6 +++--- 3 files changed, 14 insertions(+), 13 deletions(-) diff --git a/src/hb-aat-layout-common.hh b/src/hb-aat-layout-common.hh index 828a35933..8de1f7f62 100644 --- a/src/hb-aat-layout-common.hh +++ b/src/hb-aat-layout-common.hh @@ -31,6 +31,7 @@ #include "hb-aat-map.hh" #include "hb-open-type.hh" #include "hb-cache.hh" +#include "hb-bit-set.hh" #include "hb-bit-page.hh" @@ -65,10 +66,10 @@ struct hb_aat_apply_context_t : const ankr *ankr_table; const OT::GDEF *gdef_table; const hb_sorted_vector_t *range_flags = nullptr; - hb_set_t buffer_glyph_set; + hb_bit_set_t buffer_glyph_set; const hb_set_t *left_set = nullptr; const hb_set_t *right_set = nullptr; - const hb_set_t *machine_glyph_set = nullptr; + const hb_bit_set_t *machine_glyph_set = nullptr; hb_aat_class_cache_t *machine_class_cache = nullptr; hb_mask_t subtable_flags = 0; diff --git a/src/hb-aat-layout-morx-table.hh b/src/hb-aat-layout-morx-table.hh index f0f5b2141..9518f7690 100644 --- a/src/hb-aat-layout-morx-table.hh +++ b/src/hb-aat-layout-morx-table.hh @@ -177,7 +177,7 @@ struct RearrangementSubtable StateTableDriver driver (machine, c->face); - if (!c->buffer_glyph_set.may_intersect (*c->machine_glyph_set)) + if (!c->buffer_glyph_set.intersects (*c->machine_glyph_set)) { (void) c->buffer->message (c->font, "skipped chainsubtable because no glyph matches"); return_trace (false); @@ -347,7 +347,7 @@ struct ContextualSubtable StateTableDriver driver (machine, c->face); - if (!c->buffer_glyph_set.may_intersect (*c->machine_glyph_set)) + if (!c->buffer_glyph_set.intersects (*c->machine_glyph_set)) { (void) c->buffer->message (c->font, "skipped chainsubtable because no glyph matches"); return_trace (false); @@ -623,7 +623,7 @@ struct LigatureSubtable StateTableDriver driver (machine, c->face); - if (!c->buffer_glyph_set.may_intersect (*c->machine_glyph_set)) + if (!c->buffer_glyph_set.intersects (*c->machine_glyph_set)) { (void) c->buffer->message (c->font, "skipped chainsubtable because no glyph matches"); return_trace (false); @@ -664,7 +664,7 @@ struct NoncontextualSubtable { TRACE_APPLY (this); - if (!c->buffer_glyph_set.may_intersect (*c->machine_glyph_set)) + if (!c->buffer_glyph_set.intersects (*c->machine_glyph_set)) return_trace (false); const OT::GDEF &gdef (*c->gdef_table); @@ -917,7 +917,7 @@ struct InsertionSubtable StateTableDriver driver (machine, c->face); - if (!c->buffer_glyph_set.may_intersect (*c->machine_glyph_set)) + if (!c->buffer_glyph_set.intersects (*c->machine_glyph_set)) { (void) c->buffer->message (c->font, "skipped chainsubtable because no glyph matches"); return_trace (false); @@ -979,7 +979,7 @@ struct hb_accelerate_subtables_context_t : friend struct hb_aat_layout_lookup_accelerator_t; public: - hb_set_t glyph_set; + hb_bit_set_t glyph_set; mutable hb_aat_class_cache_t class_cache; template @@ -1221,7 +1221,7 @@ struct Chain hb_map ([subtable_flags] (const hb_aat_map_t::range_flags_t _) -> bool { return subtable_flags & (_.flags); }))) goto skip; c->subtable_flags = subtable_flags; - c->machine_glyph_set = accel ? &accel->subtables[i].glyph_set : &Null(hb_set_t); + c->machine_glyph_set = accel ? &accel->subtables[i].glyph_set : &Null(hb_bit_set_t); c->machine_class_cache = accel ? &accel->subtables[i].class_cache : nullptr; if (!(coverage & ChainSubtable::AllDirections) && @@ -1452,7 +1452,7 @@ struct mortmorx c->buffer->unsafe_to_concat (); - c->buffer_glyph_set = c->buffer->set (); + c->buffer_glyph_set = c->buffer->bit_set (); c->set_lookup_index (0); const Chain *chain = &firstChain; diff --git a/src/hb-buffer.hh b/src/hb-buffer.hh index 4a4a9631a..45ddb4336 100644 --- a/src/hb-buffer.hh +++ b/src/hb-buffer.hh @@ -32,7 +32,7 @@ #include "hb.hh" #include "hb-unicode.hh" -#include "hb-set.hh" +#include "hb-bit-set.hh" #include "hb-set-digest.hh" @@ -198,9 +198,9 @@ struct hb_buffer_t d.add_array (&info[0].codepoint, len, sizeof (info[0])); return d; } - hb_set_t set () const + hb_bit_set_t bit_set () const { - hb_set_t d; + hb_bit_set_t d; d.add_array (&info[0].codepoint, len, sizeof (info[0])); return d; }