summaryrefslogtreecommitdiffstats
path: root/src/gui/painting
diff options
context:
space:
mode:
authorKim Motoyoshi Kalland <kim.kalland@nokia.com>2009-11-03 14:59:41 (GMT)
committerKim Motoyoshi Kalland <kim.kalland@nokia.com>2009-11-03 15:20:24 (GMT)
commita4e7db378ecd11bc858f76beb33c56ccebef6308 (patch)
treefaadd890335128718820a1e25d35bbe01fa4d179 /src/gui/painting
parent7b7c804723f1bbd71d436ab12f5e68a0f87c71d7 (diff)
downloadQt-a4e7db378ecd11bc858f76beb33c56ccebef6308.zip
Qt-a4e7db378ecd11bc858f76beb33c56ccebef6308.tar.gz
Qt-a4e7db378ecd11bc858f76beb33c56ccebef6308.tar.bz2
Fixed fillRect on QImage::Format_ARGB32 images.
With composition mode set to QPainter::CompositionMode_Source, the raster paint engine's fillRect function filled images which had non-premultiplied format with premultiplied colours. This was fixed by converting the premultiplied colour back to non-premultiplied before writing to the image. Task-number: QTBUG-5189 Reviewed-by: Trond
Diffstat (limited to 'src/gui/painting')
-rw-r--r--src/gui/painting/qdrawhelper.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/gui/painting/qdrawhelper.cpp b/src/gui/painting/qdrawhelper.cpp
index 53edbb0..41602a1 100644
--- a/src/gui/painting/qdrawhelper.cpp
+++ b/src/gui/painting/qdrawhelper.cpp
@@ -7424,6 +7424,14 @@ QT_RECTFILL(qrgb444)
QT_RECTFILL(qargb4444)
#undef QT_RECTFILL
+inline static void qt_rectfill_nonpremul_quint32(QRasterBuffer *rasterBuffer,
+ int x, int y, int width, int height,
+ quint32 color)
+{
+ qt_rectfill<quint32>(reinterpret_cast<quint32 *>(rasterBuffer->buffer()),
+ INV_PREMUL(color), x, y, width, height, rasterBuffer->bytesPerLine());
+}
+
// Map table for destination image format. Contains function pointers
// for blends of various types unto the destination
@@ -7466,7 +7474,7 @@ DrawHelper qDrawHelper[QImage::NImageFormats] =
qt_bitmapblit_quint32,
qt_alphamapblit_quint32,
qt_alphargbblit_quint32,
- qt_rectfill_quint32
+ qt_rectfill_nonpremul_quint32
},
// Format_ARGB32_Premultiplied
{