OSDN Git Service

use QImage::Format_ARGB32_Premultiplied image format for raster pixmaps unless pixel...
authorIvailo Monev <xakepa10@gmail.com>
Tue, 1 Mar 2022 11:02:03 +0000 (13:02 +0200)
committerIvailo Monev <xakepa10@gmail.com>
Tue, 1 Mar 2022 11:02:03 +0000 (13:02 +0200)
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
src/gui/image/qpixmap_raster.cpp

index 83a50bb..d2a5c11 100644 (file)
@@ -50,11 +50,10 @@ QPixmapData *QRasterPixmapData::createCompatiblePixmapData() const
 
 void QRasterPixmapData::resize(int width, int height)
 {
-    QImage::Format format;
-    if (pixelType() == BitmapType)
+    QImage::Format format = QImage::Format_ARGB32_Premultiplied;
+    if (pixelType() == BitmapType) {
         format = QImage::Format_MonoLSB;
-    else
-        format = QImage::systemFormat();
+    }
 
     image = QImage(width, height, format);
     w = width;
@@ -89,8 +88,6 @@ void QRasterPixmapData::fromImage(const QImage &sourceImage,
     QImage::Format format = QImage::Format_ARGB32_Premultiplied;
     if (pixelType() == BitmapType) {
         format = QImage::Format_MonoLSB;
-    } else if ((flags & Qt::NoOpaqueDetection) == 0 && !sourceImage.d->checkForAlphaPixels()) {
-        format = QImage::systemFormat();
     }
 
     image = sourceImage.convertToFormat(format);