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.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.cpp')
-rw-r--r-- | src/gui/image/qimage.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/gui/image/qimage.cpp b/src/gui/image/qimage.cpp index 86e739dd4f..57e7c9a7ab 100644 --- a/src/gui/image/qimage.cpp +++ b/src/gui/image/qimage.cpp @@ -4595,7 +4595,9 @@ bool QImageData::convertInPlace(QImage::Format newFormat, Qt::ImageConversionFla InPlace_Image_Converter converter = *converterPtr; if (converter) return converter(this, flags); - else if (format > QImage::Format_Indexed8 && newFormat > QImage::Format_Indexed8) + else if (format > QImage::Format_Indexed8 && newFormat > QImage::Format_Indexed8 && !qimage_converter_map[format][newFormat]) + // Convert inplace generic, but only if there are no direct converters, + // any direct ones are probably better even if not inplace. return convert_generic_inplace(this, newFormat, flags); else return false; |