From 3d08f308f1ef6dc7ef3c1ea9cf7a9c7a067d024a Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Tue, 3 Jan 2017 11:16:30 +0100 Subject: Fix toArgb32 on NEON The color components were not correctly shuffled to ARGB host-order form. Discovered and tested with tst_QPainter::blendARGBonRGB on ARM. Change-Id: I2ef9b6129dd83f3c6be0b30c0a5e3684564e6b2f Reviewed-by: Eirik Aavitsland --- src/gui/painting/qrgba64_p.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/gui/painting/qrgba64_p.h') diff --git a/src/gui/painting/qrgba64_p.h b/src/gui/painting/qrgba64_p.h index 91b5926e43..2a17d8a624 100644 --- a/src/gui/painting/qrgba64_p.h +++ b/src/gui/painting/qrgba64_p.h @@ -214,7 +214,12 @@ inline uint toArgb32(QRgba64 rgba64) return toArgb32(v); #elif defined __ARM_NEON__ uint16x4_t v = vreinterpret_u16_u64(vld1_u64(reinterpret_cast(&rgba64))); - v = vext_u16(v, v, 1); +#if Q_BYTE_ORDER == Q_LITTLE_ENDIAN + const uint8x8_t shuffleMask = { 4, 5, 2, 3, 0, 1, 6, 7 }; + v = vreinterpret_u16_u8(vtbl1_u8(vreinterpret_u8_u16(v), shuffleMask)); +#else + v = vext_u16(v, v, 3); +#endif return toArgb32(v); #else return rgba64.toArgb32(); -- cgit v1.2.3