OSDN Git Service

implement DestStoreProc for Format_RGB32 and Format_ARGB32_Premultiplied
authorIvailo Monev <xakepa10@gmail.com>
Wed, 27 Jan 2021 18:24:40 +0000 (20:24 +0200)
committerIvailo Monev <xakepa10@gmail.com>
Wed, 27 Jan 2021 19:02:27 +0000 (21:02 +0200)
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
src/gui/painting/qdrawhelper.cpp

index 9e00b68..479093b 100644 (file)
@@ -239,6 +239,12 @@ static void QT_FASTCALL destStoreARGB32(QRasterBuffer *rasterBuffer, int x, int
     }
 }
 
+static void QT_FASTCALL destStoreRGB32(QRasterBuffer *rasterBuffer, int x, int y, const uint *buffer, int length)
+{
+    quint32 *data = (quint32*)rasterBuffer->scanLine(y) + x;
+    ::memcpy(data, buffer, length * sizeof(quint32));
+}
+
 static void QT_FASTCALL destStoreRGB16(QRasterBuffer *rasterBuffer, int x, int y, const uint *buffer, int length)
 {
     quint16 *data = (quint16*)rasterBuffer->scanLine(y) + x;
@@ -251,9 +257,9 @@ static DestStoreProc destStoreProc[QImage::NImageFormats] =
     destStoreMono, // Format_Mono,
     destStoreMonoLsb, // Format_MonoLSB
     0, // Format_Indexed8
-    0, // Format_RGB32
+    destStoreRGB32, // Format_RGB32
     destStoreARGB32, // Format_ARGB32,
-    0, // Format_ARGB32_Premultiplied
+    destStoreRGB32, // Format_ARGB32_Premultiplied
     destStoreRGB16, // Format_RGB16
 };