diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2018-02-02 13:17:28 +0100 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2018-04-03 08:13:17 +0000 |
commit | ae8e27b58a8e00ae3c2ebbbdebc0f6a9493ede2b (patch) | |
tree | 5155603352fe893b469c6725ff1deb0f7951b702 /src/gui/image/qimage_conversions.cpp | |
parent | ffb2c2ac6c3ba40acbe13a39899a72049585b427 (diff) |
Remove bit details from QPixelLayout
They were only used for rgb swap and checking for the presence of an
alpha channel.
Change-Id: I013aa9035ccf4362fa3d9ecda41723e4ec5a44cb
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
Diffstat (limited to 'src/gui/image/qimage_conversions.cpp')
-rw-r--r-- | src/gui/image/qimage_conversions.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/gui/image/qimage_conversions.cpp b/src/gui/image/qimage_conversions.cpp index 9a8cbf43c9..39d97f4bd9 100644 --- a/src/gui/image/qimage_conversions.cpp +++ b/src/gui/image/qimage_conversions.cpp @@ -156,7 +156,7 @@ void convert_generic(QImageData *dest, const QImageData *src, Qt::ImageConversio const StorePixelsFunc store = qStorePixels[destLayout->bpp]; ConvertFunc convertToARGB32PM = srcLayout->convertToARGB32PM; ConvertFunc convertFromARGB32PM = destLayout->convertFromARGB32PM; - if (srcLayout->alphaWidth == 0 && destLayout->convertFromRGB32) { + if (!srcLayout->hasAlphaChannel && destLayout->convertFromRGB32) { // If the source doesn't have an alpha channel, we can use the faster convertFromRGB32 method. convertFromARGB32PM = destLayout->convertFromRGB32; } else { @@ -173,7 +173,7 @@ void convert_generic(QImageData *dest, const QImageData *src, Qt::ImageConversio } } if ((src->format == QImage::Format_ARGB32 || src->format == QImage::Format_RGBA8888) && - destLayout->alphaWidth == 0 && destLayout->convertFromRGB32) { + !destLayout->hasAlphaChannel && destLayout->convertFromRGB32) { // Avoid unnecessary premultiply and unpremultiply when converting from unpremultiplied src format. convertToARGB32PM = qPixelLayouts[src->format + 1].convertToARGB32PM; if (dest->format == QImage::Format_RGB32) @@ -225,7 +225,7 @@ bool convert_generic_inplace(QImageData *data, QImage::Format dst_format, Qt::Im const StorePixelsFunc store = qStorePixels[destLayout->bpp]; ConvertFunc convertToARGB32PM = srcLayout->convertToARGB32PM; ConvertFunc convertFromARGB32PM = destLayout->convertFromARGB32PM; - if (srcLayout->alphaWidth == 0 && destLayout->convertFromRGB32) { + if (!srcLayout->hasAlphaChannel && destLayout->convertFromRGB32) { // If the source doesn't have an alpha channel, we can use the faster convertFromRGB32 method. convertFromARGB32PM = destLayout->convertFromRGB32; } else { @@ -241,7 +241,7 @@ bool convert_generic_inplace(QImageData *data, QImage::Format dst_format, Qt::Im } } if ((data->format == QImage::Format_ARGB32 || data->format == QImage::Format_RGBA8888) && - destLayout->alphaWidth == 0 && destLayout->convertFromRGB32) { + !destLayout->hasAlphaChannel && destLayout->convertFromRGB32) { // Avoid unnecessary premultiply and unpremultiply when converting from unpremultiplied src format. convertToARGB32PM = qPixelLayouts[data->format + 1].convertToARGB32PM; if (dst_format == QImage::Format_RGB32) |