summaryrefslogtreecommitdiffstats
path: root/src/gui/painting/qrgba64_p.h
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2022-07-04 14:42:45 +0200
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2022-07-05 16:25:55 +0200
commitd85dff3775b00dde079c50bcf417cae5ed884512 (patch)
treeb099e3b2239a5104052da7bd9c48670bae15480b /src/gui/painting/qrgba64_p.h
parentf7b4eaba590251339eea9a9ec981e80db55f263b (diff)
Remove Q_DECL_VECTORCALL when SSE2 is not available
It expands to sseregparm in gcc, and then can't build with SSE2 disabled. Pick-to: 6.4 6.3 6.2 Fixes: QTBUG-104726 Change-Id: I063ed87ed7f7ba683a19cd3f6e8a25c5111ef72a Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/gui/painting/qrgba64_p.h')
-rw-r--r--src/gui/painting/qrgba64_p.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/gui/painting/qrgba64_p.h b/src/gui/painting/qrgba64_p.h
index e848ae0148..ae8b6fd8cb 100644
--- a/src/gui/painting/qrgba64_p.h
+++ b/src/gui/painting/qrgba64_p.h
@@ -81,18 +81,22 @@ static inline QRgba64 multiplyAlpha65535(QRgba64 rgba64, uint alpha65535)
#endif
}
+#if defined(__SSE2__) || defined(__ARM_NEON__)
template<typename T>
static inline T Q_DECL_VECTORCALL multiplyAlpha255(T rgba64, uint alpha255)
{
-#if defined(__SSE2__) || defined(__ARM_NEON__)
return multiplyAlpha65535(rgba64, alpha255 * 257);
+}
#else
+template<typename T>
+static inline T multiplyAlpha255(T rgba64, uint alpha255)
+{
return QRgba64::fromRgba64(qt_div_255(rgba64.red() * alpha255),
qt_div_255(rgba64.green() * alpha255),
qt_div_255(rgba64.blue() * alpha255),
qt_div_255(rgba64.alpha() * alpha255));
-#endif
}
+#endif
#if defined __SSE2__
static inline __m128i Q_DECL_VECTORCALL interpolate255(__m128i x, uint alpha1, __m128i y, uint alpha2)