From 22b5c39e8e0f4d8cb8a2b2d661e0451e01b75929 Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Thu, 5 Feb 2015 16:09:00 +0100 Subject: 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 --- src/gui/image/qimage_sse2.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/gui/image/qimage_sse2.cpp') 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; } -- cgit v1.2.3