diff options
author | Allan Sandfeld Jensen <allan.jensen@digia.com> | 2015-04-07 11:20:08 +0200 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@theqtcompany.com> | 2015-04-15 11:25:41 +0000 |
commit | 7432c7c08a6709a12a143d48fbaa9927962edae8 (patch) | |
tree | 8e4bec4c675cef7429edca53ab53477d33209ae0 /src/gui/image | |
parent | 884679a7cc74b85d6c565316520304a9c73b5f04 (diff) |
Cleanup and optimization of qimage smoothscale
Cleaning up smoothscale code. Upscaling is improved using existing
optimized interpolation methods, and downscale is given SSE4.1
optimized versions.
Change-Id: I7cdc256c26850948aef7dae26fda1622be6b8179
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
Diffstat (limited to 'src/gui/image')
-rw-r--r-- | src/gui/image/qimage.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/gui/image/qimage.cpp b/src/gui/image/qimage.cpp index 5cc1cf760f..f20800440d 100644 --- a/src/gui/image/qimage.cpp +++ b/src/gui/image/qimage.cpp @@ -4248,11 +4248,15 @@ int QImage::bitPlaneCount() const static QImage smoothScaled(const QImage &source, int w, int h) { QImage src = source; - bool canSkipConversion = (src.format() == QImage::Format_RGB32 || src.format() == QImage::Format_ARGB32_Premultiplied); + switch (src.format()) { + case QImage::Format_RGB32: + case QImage::Format_ARGB32_Premultiplied: #if Q_BYTE_ORDER == Q_LITTLE_ENDIAN - canSkipConversion = canSkipConversion || (src.format() == QImage::Format_RGBX8888 || src.format() == QImage::Format_RGBA8888_Premultiplied); + case QImage::Format_RGBX8888: #endif - if (!canSkipConversion) { + case QImage::Format_RGBA8888_Premultiplied: + break; + default: if (src.hasAlphaChannel()) src = src.convertToFormat(QImage::Format_ARGB32_Premultiplied); else |