diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2017-01-03 11:16:30 +0100 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2017-01-09 12:03:31 +0000 |
commit | 3d08f308f1ef6dc7ef3c1ea9cf7a9c7a067d024a (patch) | |
tree | e6124fee509370ecfbea1f2bcd0cb3482bbac8e0 /src | |
parent | 7991a70d2801066dc0d68854a7dcdb36fd602048 (diff) |
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 <eirik.aavitsland@qt.io>
Diffstat (limited to 'src')
-rw-r--r-- | src/gui/painting/qrgba64_p.h | 7 |
1 files changed, 6 insertions, 1 deletions
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<const uint64_t *>(&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(); |