diff options
author | Allan Sandfeld Jensen <allan.jensen@theqtcompany.com> | 2015-02-05 16:09:00 +0100 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@theqtcompany.com> | 2015-02-13 13:20:52 +0000 |
commit | 22b5c39e8e0f4d8cb8a2b2d661e0451e01b75929 (patch) | |
tree | 554d84acb212c909154da63063ada27c1d6fbbd5 /src/gui/image/qimage_sse2.cpp | |
parent | e9f30968ad777bc2d7fcd85adc4e9d38d70398d8 (diff) |
Optimize generic conversion and remove now obsolete direct conversions
There are many direct QImage conversions that doesn't need to be direct
but only are because they are faster than the generic conversion. This
patch optimizes the generic conversions and then removes all the direct
conversions that are now no faster than the generic.
Change-Id: I3dc5f44cc7f6358fd66420e9974eebaf2c7ca59c
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
Diffstat (limited to 'src/gui/image/qimage_sse2.cpp')
-rw-r--r-- | src/gui/image/qimage_sse2.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/gui/image/qimage_sse2.cpp b/src/gui/image/qimage_sse2.cpp index 6424e67cfc..4a719d4c26 100644 --- a/src/gui/image/qimage_sse2.cpp +++ b/src/gui/image/qimage_sse2.cpp @@ -43,7 +43,7 @@ QT_BEGIN_NAMESPACE bool convert_ARGB_to_ARGB_PM_inplace_sse2(QImageData *data, Qt::ImageConversionFlags) { - Q_ASSERT(data->format == QImage::Format_ARGB32); + Q_ASSERT(data->format == QImage::Format_ARGB32 || data->format == QImage::Format_RGBA8888); // extra pixels on each line const int spare = data->width & 3; @@ -92,7 +92,10 @@ bool convert_ARGB_to_ARGB_PM_inplace_sse2(QImageData *data, Qt::ImageConversionF d = reinterpret_cast<__m128i*>(p+pad); } - data->format = QImage::Format_ARGB32_Premultiplied; + if (data->format == QImage::Format_ARGB32) + data->format = QImage::Format_ARGB32_Premultiplied; + else + data->format = QImage::Format_RGBA8888_Premultiplied; return true; } |