diff options
author | Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io> | 2023-02-27 12:11:51 +0100 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2023-03-02 05:21:49 +0000 |
commit | 7f8020f1f7177d8f3a626e0b746f07dd7727b7e6 (patch) | |
tree | 8cdf4986c75789e01b7538a16d47e5452d439732 /src/3rdparty/harfbuzz-ng/src/hb-bit-set-invertible.hh | |
parent | 474e2c9208a9cc7398b1882dd73b4034da6d44b6 (diff) | |
download | qtbase-7f8020f1f7177d8f3a626e0b746f07dd7727b7e6.tar.gz |
Update Harfbuzz to 7.0.1
This is the 6.4-specific update of Harfbuzz, since Harfbuzz
was currently on an older version in 6.4 compared to other
branches.
This also backports the change to the qtextlayout test that
was done on other branches for the 6.0.0 update.
Fixes: QTBUG-111535
Change-Id: Ie8217f1541a02d3800142b88cf0007be0ed0d1e2
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 13549fa7c2d27ba588471f97a640f4dbcf86b10c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'src/3rdparty/harfbuzz-ng/src/hb-bit-set-invertible.hh')
-rw-r--r-- | src/3rdparty/harfbuzz-ng/src/hb-bit-set-invertible.hh | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/src/3rdparty/harfbuzz-ng/src/hb-bit-set-invertible.hh b/src/3rdparty/harfbuzz-ng/src/hb-bit-set-invertible.hh index 4a4ce34053..1eb1b1c209 100644 --- a/src/3rdparty/harfbuzz-ng/src/hb-bit-set-invertible.hh +++ b/src/3rdparty/harfbuzz-ng/src/hb-bit-set-invertible.hh @@ -38,10 +38,10 @@ struct hb_bit_set_invertible_t bool inverted = false; hb_bit_set_invertible_t () = default; - hb_bit_set_invertible_t (hb_bit_set_invertible_t& o) = default; - hb_bit_set_invertible_t (hb_bit_set_invertible_t&& o) = default; + hb_bit_set_invertible_t (const hb_bit_set_invertible_t& o) = default; + hb_bit_set_invertible_t (hb_bit_set_invertible_t&& other) : hb_bit_set_invertible_t () { hb_swap (*this, other); } hb_bit_set_invertible_t& operator= (const hb_bit_set_invertible_t& o) = default; - hb_bit_set_invertible_t& operator= (hb_bit_set_invertible_t&& o) = default; + hb_bit_set_invertible_t& operator= (hb_bit_set_invertible_t&& other) { hb_swap (*this, other); return *this; } friend void swap (hb_bit_set_invertible_t &a, hb_bit_set_invertible_t &b) { if (likely (!a.s.successful || !b.s.successful)) @@ -56,6 +56,7 @@ struct hb_bit_set_invertible_t bool in_error () const { return s.in_error (); } explicit operator bool () const { return !is_empty (); } + void alloc (unsigned sz) { s.alloc (sz); } void reset () { s.reset (); @@ -73,12 +74,19 @@ struct hb_bit_set_invertible_t inverted = !inverted; } + bool is_inverted () const + { + return inverted; + } + bool is_empty () const { hb_codepoint_t v = INVALID; next (&v); return v == INVALID; } + uint32_t hash () const { return s.hash () ^ (uint32_t) inverted; } + hb_codepoint_t get_min () const { hb_codepoint_t v = INVALID; @@ -97,7 +105,7 @@ struct hb_bit_set_invertible_t void add (hb_codepoint_t g) { unlikely (inverted) ? s.del (g) : s.add (g); } bool add_range (hb_codepoint_t a, hb_codepoint_t b) - { return unlikely (inverted) ? (s.del_range (a, b), true) : s.add_range (a, b); } + { return unlikely (inverted) ? ((void) s.del_range (a, b), true) : s.add_range (a, b); } template <typename T> void add_array (const T *array, unsigned int count, unsigned int stride=sizeof(T)) @@ -120,10 +128,8 @@ struct hb_bit_set_invertible_t bool get (hb_codepoint_t g) const { return s.get (g) ^ inverted; } /* Has interface. */ - static constexpr bool SENTINEL = false; - typedef bool value_t; - value_t operator [] (hb_codepoint_t k) const { return get (k); } - bool has (hb_codepoint_t k) const { return (*this)[k] != SENTINEL; } + bool operator [] (hb_codepoint_t k) const { return get (k); } + bool has (hb_codepoint_t k) const { return (*this)[k]; } /* Predicate. */ bool operator () (hb_codepoint_t k) const { return has (k); } |