From baac34de6fcbdcc6ee5eb06c3db16c7eda32f121 Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Fri, 15 Sep 2023 10:17:01 +0200 Subject: Switch QRgbaFloat api to hardcoded float parameter and return values This makes it source compatible with Qt 6.5 by allowing us to change FastType to something other than float, which we have done for Qt 6.6 on systems with AVX float16 instructions. Pick-to: 6.6 6.6.0 Change-Id: I7ebf0c178ba0ff7f04f6788d182a1a000fe31c0c Reviewed-by: Allan Sandfeld Jensen --- src/gui/painting/qrgbafloat.h | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) (limited to 'src/gui/painting') diff --git a/src/gui/painting/qrgbafloat.h b/src/gui/painting/qrgbafloat.h index 160623eb1e..da74328f71 100644 --- a/src/gui/painting/qrgbafloat.h +++ b/src/gui/painting/qrgbafloat.h @@ -61,19 +61,19 @@ public: constexpr bool isOpaque() const { return a >= FastType(1.0f); } constexpr bool isTransparent() const { return a <= FastType(0.0f); } - constexpr FastType red() const { return r; } - constexpr FastType green() const { return g; } - constexpr FastType blue() const { return b; } - constexpr FastType alpha() const { return a; } - void setRed(FastType _red) { r = F(_red); } - void setGreen(FastType _green) { g = F(_green); } - void setBlue(FastType _blue) { b = F(_blue); } - void setAlpha(FastType _alpha) { a = F(_alpha); } - - constexpr FastType redNormalized() const { return clamp01(r); } - constexpr FastType greenNormalized() const { return clamp01(g); } - constexpr FastType blueNormalized() const { return clamp01(b); } - constexpr FastType alphaNormalized() const { return clamp01(a); } + constexpr float red() const { return r; } + constexpr float green() const { return g; } + constexpr float blue() const { return b; } + constexpr float alpha() const { return a; } + void setRed(float _red) { r = F(_red); } + void setGreen(float _green) { g = F(_green); } + void setBlue(float _blue) { b = F(_blue); } + void setAlpha(float _alpha) { a = F(_alpha); } + + constexpr float redNormalized() const { return clamp01(r); } + constexpr float greenNormalized() const { return clamp01(g); } + constexpr float blueNormalized() const { return clamp01(b); } + constexpr float alphaNormalized() const { return clamp01(a); } constexpr quint8 red8() const { return qRound(redNormalized() * FastType(255.0f)); } constexpr quint8 green8() const { return qRound(greenNormalized() * FastType(255.0f)); } -- cgit v1.2.3