Fix big-endian build

Declare rbSwap<QImage::Format_RGBA8888>, so we don't end up in a
fallback definition not used by little-endian.

Task-number: QTBUG-69951
Change-Id: I8512bba76da7d59a27593d37c70283d881c3e8fc
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
bb10
Allan Sandfeld Jensen 2018-08-21 10:41:17 +02:00
parent cf0ea18ac4
commit 07eda676e4
1 changed files with 13 additions and 0 deletions

View File

@ -640,6 +640,19 @@ void QT_FASTCALL rbSwap<QImage::Format_RGBA8888>(uchar *d, const uchar *s, int c
{
return rbSwap_rgb32(d, s, count);
}
#else
template<>
void QT_FASTCALL rbSwap<QImage::Format_RGBA8888>(uchar *d, const uchar *s, int count)
{
const uint *src = reinterpret_cast<const uint *>(s);
uint *dest = reinterpret_cast<uint *>(d);
for (int i = 0; i < count; ++i) {
const uint c = src[i];
const uint rb = c & 0xff00ff00;
const uint ga = c & 0x00ff00ff;
dest[i] = ga | (rb << 16) | (rb >> 16);
}
}
#endif
static void QT_FASTCALL rbSwap_rgb30(uchar *d, const uchar *s, int count)