diff options
author | Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io> | 2022-05-19 09:58:31 +0200 |
---|---|---|
committer | Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io> | 2022-05-23 19:25:46 +0000 |
commit | d88da0b2b0a8abaaa521bef864378fe1dbf86709 (patch) | |
tree | 4795f260c1ceaaeeb2cbe64f8314d604e0a7cbe7 /src/3rdparty/harfbuzz-ng/src/hb-open-type.hh | |
parent | 0d97723ee2778203af0cfd13599572110fb69dd5 (diff) |
Update Harfbuzz to version 4.2.1
[ChangeLog][QtGui][Text] Updated the Harfbuzz code included with
Qt to version 4.2.1.
Pick-to: 6.2 6.3
Fixes: QTBUG-103603
Change-Id: I45fdde8fd0772e4470304c5f6f5a876666356d04
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'src/3rdparty/harfbuzz-ng/src/hb-open-type.hh')
-rw-r--r-- | src/3rdparty/harfbuzz-ng/src/hb-open-type.hh | 49 |
1 files changed, 29 insertions, 20 deletions
diff --git a/src/3rdparty/harfbuzz-ng/src/hb-open-type.hh b/src/3rdparty/harfbuzz-ng/src/hb-open-type.hh index 49653ce97e..7e524177f6 100644 --- a/src/3rdparty/harfbuzz-ng/src/hb-open-type.hh +++ b/src/3rdparty/harfbuzz-ng/src/hb-open-type.hh @@ -64,7 +64,7 @@ struct IntType IntType& operator = (Type i) { v = i; return *this; } /* For reason we define cast out operator for signed/unsigned, instead of Type, see: * https://github.com/harfbuzz/harfbuzz/pull/2875/commits/09836013995cab2b9f07577a179ad7b024130467 */ - operator hb_conditional<hb_is_signed (Type), signed, unsigned> () const { return v; } + operator typename std::conditional<std::is_signed<Type>::value, signed, unsigned>::type () const { return v; } bool operator == (const IntType &o) const { return (Type) v == (Type) o.v; } bool operator != (const IntType &o) const { return !(*this == o); } @@ -86,7 +86,7 @@ struct IntType return pb->cmp (*pa); } template <typename Type2, - hb_enable_if (hb_is_integral (Type2) && + hb_enable_if (std::is_integral<Type2>::value && sizeof (Type2) < sizeof (int) && sizeof (Type) < sizeof (int))> int cmp (Type2 a) const @@ -122,6 +122,15 @@ typedef IntType<int32_t> HBINT32; /* 32-bit signed integer. */ * Works for unsigned, but not signed, since we rely on compiler for sign-extension. */ typedef IntType<uint32_t, 3> HBUINT24; /* 24-bit unsigned integer. */ +/* 15-bit unsigned number; top bit used for extension. */ +struct HBUINT15 : HBUINT16 +{ + /* TODO Flesh out; actually mask top bit. */ + HBUINT15& operator = (uint16_t i ) { HBUINT16::operator= (i); return *this; } + public: + DEFINE_SIZE_STATIC (2); +}; + /* 16-bit signed integer (HBINT16) that describes a quantity in FUnits. */ typedef HBINT16 FWORD; @@ -182,9 +191,9 @@ struct Tag : HBUINT32 }; /* Glyph index number, same as uint16 (length = 16 bits) */ -struct HBGlyphID : HBUINT16 +struct HBGlyphID16 : HBUINT16 { - HBGlyphID& operator = (uint16_t i) { HBUINT16::operator= (i); return *this; } + HBGlyphID16& operator = (uint16_t i) { HBUINT16::operator= (i); return *this; } }; /* Script/language-system/feature index */ @@ -332,7 +341,7 @@ struct OffsetTo : Offset<OffsetType, has_null> s->push (); - bool ret = c->dispatch (src_base+src, hb_forward<Ts> (ds)...); + bool ret = c->dispatch (src_base+src, std::forward<Ts> (ds)...); if (ret || !has_null) s->add_link (*this, s->pop_pack ()); @@ -349,7 +358,7 @@ struct OffsetTo : Offset<OffsetType, has_null> *this = 0; Type* obj = c->push<Type> (); - bool ret = obj->serialize (c, hb_forward<Ts> (ds)...); + bool ret = obj->serialize (c, std::forward<Ts> (ds)...); if (ret) c->add_link (*this, c->pop_pack ()); @@ -375,7 +384,7 @@ struct OffsetTo : Offset<OffsetType, has_null> c->push (); - bool ret = c->copy (src_base+src, hb_forward<Ts> (ds)...); + bool ret = c->copy (src_base+src, std::forward<Ts> (ds)...); c->add_link (*this, c->pop_pack (), whence, dst_bias); @@ -401,7 +410,7 @@ struct OffsetTo : Offset<OffsetType, has_null> TRACE_SANITIZE (this); return_trace (sanitize_shallow (c, base) && (this->is_null () || - c->dispatch (StructAtOffset<Type> (base, *this), hb_forward<Ts> (ds)...) || + c->dispatch (StructAtOffset<Type> (base, *this), std::forward<Ts> (ds)...) || neuter (c))); } @@ -509,9 +518,9 @@ struct UnsizedArrayOf { TRACE_SANITIZE (this); if (unlikely (!sanitize_shallow (c, count))) return_trace (false); - if (!sizeof... (Ts) && hb_is_trivially_copyable (Type)) return_trace (true); + if (!sizeof... (Ts) && std::is_trivially_copyable<Type>::value) return_trace (true); for (unsigned int i = 0; i < count; i++) - if (unlikely (!c->dispatch (arrayZ[i], hb_forward<Ts> (ds)...))) + if (unlikely (!c->dispatch (arrayZ[i], std::forward<Ts> (ds)...))) return_trace (false); return_trace (true); } @@ -556,7 +565,7 @@ struct UnsizedListOfOffset16To : UnsizedArray16OfOffsetTo<Type, OffsetType, has_ { TRACE_SANITIZE (this); return_trace ((UnsizedArray16OfOffsetTo<Type, OffsetType, has_null> - ::sanitize (c, count, this, hb_forward<Ts> (ds)...))); + ::sanitize (c, count, this, std::forward<Ts> (ds)...))); } }; @@ -698,10 +707,10 @@ struct ArrayOf { TRACE_SANITIZE (this); if (unlikely (!sanitize_shallow (c))) return_trace (false); - if (!sizeof... (Ts) && hb_is_trivially_copyable (Type)) return_trace (true); + if (!sizeof... (Ts) && std::is_trivially_copyable<Type>::value) return_trace (true); unsigned int count = len; for (unsigned int i = 0; i < count; i++) - if (unlikely (!c->dispatch (arrayZ[i], hb_forward<Ts> (ds)...))) + if (unlikely (!c->dispatch (arrayZ[i], std::forward<Ts> (ds)...))) return_trace (false); return_trace (true); } @@ -759,7 +768,7 @@ struct List16OfOffset16To : Array16OfOffset16To<Type> bool sanitize (hb_sanitize_context_t *c, Ts&&... ds) const { TRACE_SANITIZE (this); - return_trace (Array16OfOffset16To<Type>::sanitize (c, this, hb_forward<Ts> (ds)...)); + return_trace (Array16OfOffset16To<Type>::sanitize (c, this, std::forward<Ts> (ds)...)); } }; @@ -826,10 +835,10 @@ struct HeadlessArrayOf { TRACE_SANITIZE (this); if (unlikely (!sanitize_shallow (c))) return_trace (false); - if (!sizeof... (Ts) && hb_is_trivially_copyable (Type)) return_trace (true); + if (!sizeof... (Ts) && std::is_trivially_copyable<Type>::value) return_trace (true); unsigned int count = get_length (); for (unsigned int i = 0; i < count; i++) - if (unlikely (!c->dispatch (arrayZ[i], hb_forward<Ts> (ds)...))) + if (unlikely (!c->dispatch (arrayZ[i], std::forward<Ts> (ds)...))) return_trace (false); return_trace (true); } @@ -875,10 +884,10 @@ struct ArrayOfM1 { TRACE_SANITIZE (this); if (unlikely (!sanitize_shallow (c))) return_trace (false); - if (!sizeof... (Ts) && hb_is_trivially_copyable (Type)) return_trace (true); + if (!sizeof... (Ts) && std::is_trivially_copyable<Type>::value) return_trace (true); unsigned int count = lenM1 + 1; for (unsigned int i = 0; i < count; i++) - if (unlikely (!c->dispatch (arrayZ[i], hb_forward<Ts> (ds)...))) + if (unlikely (!c->dispatch (arrayZ[i], std::forward<Ts> (ds)...))) return_trace (false); return_trace (true); } @@ -1061,10 +1070,10 @@ struct VarSizedBinSearchArrayOf { TRACE_SANITIZE (this); if (unlikely (!sanitize_shallow (c))) return_trace (false); - if (!sizeof... (Ts) && hb_is_trivially_copyable (Type)) return_trace (true); + if (!sizeof... (Ts) && std::is_trivially_copyable<Type>::value) return_trace (true); unsigned int count = get_length (); for (unsigned int i = 0; i < count; i++) - if (unlikely (!(*this)[i].sanitize (c, hb_forward<Ts> (ds)...))) + if (unlikely (!(*this)[i].sanitize (c, std::forward<Ts> (ds)...))) return_trace (false); return_trace (true); } |