diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2018-09-06 11:20:36 +0200 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2018-10-09 13:17:47 +0000 |
commit | b7c5c2e65bd00d2b6729a54ae7ba5ddd4e891a03 (patch) | |
tree | f61bd032ebbc71a905f29c70dbed925badd9b8f2 /src/gui/image | |
parent | 25830cf91298d2440e649b1f9e200a3433b8c679 (diff) |
Add NEON optimized ARGB32 unpremultiply routines
Mirroring similar routines recently added for SSE4.1
Change-Id: Ibb9d10cc34655ce1dc0e97fdff4e4f6a81d47d05
Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
Diffstat (limited to 'src/gui/image')
-rw-r--r-- | src/gui/image/qimage_conversions.cpp | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/src/gui/image/qimage_conversions.cpp b/src/gui/image/qimage_conversions.cpp index e1f66dceee..964dc0d5c6 100644 --- a/src/gui/image/qimage_conversions.cpp +++ b/src/gui/image/qimage_conversions.cpp @@ -119,6 +119,7 @@ void qGamma_correct_back_to_linear_cs(QImage *image) *****************************************************************************/ // The drawhelper conversions from/to RGB32 are passthroughs which is not always correct for general image conversion +#if !defined(__ARM_NEON__) static void QT_FASTCALL storeRGB32FromARGB32PM(uchar *dest, const uint *src, int index, int count, const QVector<QRgb> *, QDitherInfo *) { @@ -126,6 +127,7 @@ static void QT_FASTCALL storeRGB32FromARGB32PM(uchar *dest, const uint *src, int for (int i = 0; i < count; ++i) d[i] = 0xff000000 | qUnpremultiply(src[i]); } +#endif static void QT_FASTCALL storeRGB32FromARGB32(uchar *dest, const uint *src, int index, int count, const QVector<QRgb> *, QDitherInfo *) @@ -147,6 +149,9 @@ static const uint *QT_FASTCALL fetchRGB32ToARGB32PM(uint *buffer, const uchar *s #ifdef QT_COMPILER_SUPPORTS_SSE4_1 extern void QT_FASTCALL storeRGB32FromARGB32PM_sse4(uchar *dest, const uint *src, int index, int count, const QVector<QRgb> *, QDitherInfo *); +#elif defined(__ARM_NEON__) +extern void QT_FASTCALL storeRGB32FromARGB32PM_neon(uchar *dest, const uint *src, int index, int count, + const QVector<QRgb> *, QDitherInfo *); #endif void convert_generic(QImageData *dest, const QImageData *src, Qt::ImageConversionFlags flags) @@ -175,8 +180,12 @@ void convert_generic(QImageData *dest, const QImageData *src, Qt::ImageConversio if (qCpuHasFeature(SSE4_1)) store = storeRGB32FromARGB32PM_sse4; else -#endif store = storeRGB32FromARGB32PM; +#elif defined(__ARM_NEON__) + store = storeRGB32FromARGB32PM_neon; +#else + store = storeRGB32FromARGB32PM; +#endif } } if (srcLayout->hasAlphaChannel && !srcLayout->premultiplied && @@ -261,8 +270,12 @@ bool convert_generic_inplace(QImageData *data, QImage::Format dst_format, Qt::Im if (qCpuHasFeature(SSE4_1)) store = storeRGB32FromARGB32PM_sse4; else -#endif store = storeRGB32FromARGB32PM; +#elif defined(__ARM_NEON__) + store = storeRGB32FromARGB32PM_neon; +#else + store = storeRGB32FromARGB32PM; +#endif } } if (srcLayout->hasAlphaChannel && !srcLayout->premultiplied && |