From d88da0b2b0a8abaaa521bef864378fe1dbf86709 Mon Sep 17 00:00:00 2001 From: Eskil Abrahamsen Blomfeldt Date: Thu, 19 May 2022 09:58:31 +0200 Subject: 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 Reviewed-by: Lars Knoll --- src/3rdparty/harfbuzz-ng/src/hb-open-type.hh | 49 ++++++++++++++++------------ 1 file changed, 29 insertions(+), 20 deletions(-) (limited to 'src/3rdparty/harfbuzz-ng/src/hb-open-type.hh') 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 () const { return v; } + operator typename std::conditional::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 ::value && sizeof (Type2) < sizeof (int) && sizeof (Type) < sizeof (int))> int cmp (Type2 a) const @@ -122,6 +122,15 @@ typedef IntType HBINT32; /* 32-bit signed integer. */ * Works for unsigned, but not signed, since we rely on compiler for sign-extension. */ typedef IntType 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 s->push (); - bool ret = c->dispatch (src_base+src, hb_forward (ds)...); + bool ret = c->dispatch (src_base+src, std::forward (ds)...); if (ret || !has_null) s->add_link (*this, s->pop_pack ()); @@ -349,7 +358,7 @@ struct OffsetTo : Offset *this = 0; Type* obj = c->push (); - bool ret = obj->serialize (c, hb_forward (ds)...); + bool ret = obj->serialize (c, std::forward (ds)...); if (ret) c->add_link (*this, c->pop_pack ()); @@ -375,7 +384,7 @@ struct OffsetTo : Offset c->push (); - bool ret = c->copy (src_base+src, hb_forward (ds)...); + bool ret = c->copy (src_base+src, std::forward (ds)...); c->add_link (*this, c->pop_pack (), whence, dst_bias); @@ -401,7 +410,7 @@ struct OffsetTo : Offset TRACE_SANITIZE (this); return_trace (sanitize_shallow (c, base) && (this->is_null () || - c->dispatch (StructAtOffset (base, *this), hb_forward (ds)...) || + c->dispatch (StructAtOffset (base, *this), std::forward (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::value) return_trace (true); for (unsigned int i = 0; i < count; i++) - if (unlikely (!c->dispatch (arrayZ[i], hb_forward (ds)...))) + if (unlikely (!c->dispatch (arrayZ[i], std::forward (ds)...))) return_trace (false); return_trace (true); } @@ -556,7 +565,7 @@ struct UnsizedListOfOffset16To : UnsizedArray16OfOffsetTo - ::sanitize (c, count, this, hb_forward (ds)...))); + ::sanitize (c, count, this, std::forward (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::value) return_trace (true); unsigned int count = len; for (unsigned int i = 0; i < count; i++) - if (unlikely (!c->dispatch (arrayZ[i], hb_forward (ds)...))) + if (unlikely (!c->dispatch (arrayZ[i], std::forward (ds)...))) return_trace (false); return_trace (true); } @@ -759,7 +768,7 @@ struct List16OfOffset16To : Array16OfOffset16To bool sanitize (hb_sanitize_context_t *c, Ts&&... ds) const { TRACE_SANITIZE (this); - return_trace (Array16OfOffset16To::sanitize (c, this, hb_forward (ds)...)); + return_trace (Array16OfOffset16To::sanitize (c, this, std::forward (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::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 (ds)...))) + if (unlikely (!c->dispatch (arrayZ[i], std::forward (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::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 (ds)...))) + if (unlikely (!c->dispatch (arrayZ[i], std::forward (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::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 (ds)...))) + if (unlikely (!(*this)[i].sanitize (c, std::forward (ds)...))) return_trace (false); return_trace (true); } -- cgit v1.2.3