diff options
author | Allan Sandfeld Jensen <allan.jensen@theqtcompany.com> | 2015-04-13 16:06:57 +0200 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@theqtcompany.com> | 2015-04-16 19:24:06 +0000 |
commit | 964ccc58534aac436529007000d1c38d76c88834 (patch) | |
tree | d452d03dabe7c109527987b9f9385de5374c1b12 /src/gui/image | |
parent | 365c63e7b177701c0bf80a7cb138b7559b92f350 (diff) |
Remove separate SSE4 unpremultiply function
Merges the SSE4 specific unpremultiply with the normal version, and
adds a SSE2 fallback. There was no reason to split the two since
compile time options will ensure the right version is inlined.
Also adds short-cut for 0 and 255 values.
Change-Id: Ie5aa262f6964219fd3062d4a498f697cf79a4595
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/gui/image')
-rw-r--r-- | src/gui/image/qimage_conversions.cpp | 6 | ||||
-rw-r--r-- | src/gui/image/qimage_sse4.cpp | 3 |
2 files changed, 4 insertions, 5 deletions
diff --git a/src/gui/image/qimage_conversions.cpp b/src/gui/image/qimage_conversions.cpp index 28e3a48689..8cb886e09b 100644 --- a/src/gui/image/qimage_conversions.cpp +++ b/src/gui/image/qimage_conversions.cpp @@ -117,7 +117,7 @@ static const uint *QT_FASTCALL convertRGB32ToARGB32PM(uint *buffer, const uint * return buffer; } -#ifdef QT_COMPILER_SUPPORTS_SSE4_1 +#if defined(QT_COMPILER_SUPPORTS_SSE4_1) && !defined(__SSE4_1__) extern const uint *QT_FASTCALL convertRGB32FromARGB32PM_sse4(uint *buffer, const uint *src, int count, const QPixelLayout *, const QRgb *); #endif @@ -144,7 +144,7 @@ void convert_generic(QImageData *dest, const QImageData *src, Qt::ImageConversio if (src->format == QImage::Format_RGB32) convertToARGB32PM = convertRGB32ToARGB32PM; if (dest->format == QImage::Format_RGB32) { -#ifdef QT_COMPILER_SUPPORTS_SSE4_1 +#if defined(QT_COMPILER_SUPPORTS_SSE4_1) && !defined(__SSE4_1__) if (qCpuHasFeature(SSE4_1)) convertFromARGB32PM = convertRGB32FromARGB32PM_sse4; else @@ -193,7 +193,7 @@ bool convert_generic_inplace(QImageData *data, QImage::Format dst_format, Qt::Im if (data->format == QImage::Format_RGB32) convertToARGB32PM = convertRGB32ToARGB32PM; if (dst_format == QImage::Format_RGB32) { -#ifdef QT_COMPILER_SUPPORTS_SSE4_1 +#if defined(QT_COMPILER_SUPPORTS_SSE4_1) && !defined(__SSE4_1__) if (qCpuHasFeature(SSE4_1)) convertFromARGB32PM = convertRGB32FromARGB32PM_sse4; else diff --git a/src/gui/image/qimage_sse4.cpp b/src/gui/image/qimage_sse4.cpp index 5fad4f572a..fb63f5bff9 100644 --- a/src/gui/image/qimage_sse4.cpp +++ b/src/gui/image/qimage_sse4.cpp @@ -33,7 +33,6 @@ #include <qimage.h> #include <private/qdrawhelper_p.h> -#include <private/qdrawingprimitive_sse2_p.h> #include <private/qimage_p.h> #include <private/qsimd_p.h> @@ -45,7 +44,7 @@ const uint *QT_FASTCALL convertRGB32FromARGB32PM_sse4(uint *buffer, const uint * const QPixelLayout *, const QRgb *) { for (int i = 0; i < count; ++i) - buffer[i] = 0xff000000 | qUnpremultiply_sse4(src[i]); + buffer[i] = 0xff000000 | qUnpremultiply(src[i]); return buffer; } |