summaryrefslogtreecommitdiffstats
path: root/tests/auto/gui/painting
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2016-12-07 13:03:44 +0100
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2016-12-08 12:40:02 +0000
commitf882d2f443a8950a2f784fa91b3ff10a645577f7 (patch)
treeaf4809875bba891d0aca276fbe73b1275a9d7beb /tests/auto/gui/painting
parent074b9f1eef6ec48ed66db14699dbc74141fa63b5 (diff)
Fix qdrawhelper function toRGB64
The function was incorrectly handling green and blue color channels causing them to be dropped. This affects drawing non 32-bit images onto 10-bit per color channels formats such as RGB30. Change-Id: I9211e253b1a9da0dada5c418d592a8f531265989 Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
Diffstat (limited to 'tests/auto/gui/painting')
-rw-r--r--tests/auto/gui/painting/qpainter/tst_qpainter.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/auto/gui/painting/qpainter/tst_qpainter.cpp b/tests/auto/gui/painting/qpainter/tst_qpainter.cpp
index c729b2f94c..cf4979e291 100644
--- a/tests/auto/gui/painting/qpainter/tst_qpainter.cpp
+++ b/tests/auto/gui/painting/qpainter/tst_qpainter.cpp
@@ -301,6 +301,7 @@ private slots:
void QTBUG56252();
void blendNullRGB32();
+ void toRGB64();
private:
void fillData();
@@ -5159,6 +5160,21 @@ void tst_QPainter::blendNullRGB32()
QVERIFY(image.pixel(i,0) != 0xffffffff);
}
+void tst_QPainter::toRGB64()
+{
+ QImage dst(10, 1, QImage::Format_BGR30);
+ QImage src(10, 1, QImage::Format_RGB16);
+ src.fill(Qt::white);
+
+ QPainter paint(&dst);
+ paint.drawImage(0, 0, src);
+ paint.end();
+
+ for (int i=0; i < dst.width(); ++i) {
+ QVERIFY(dst.pixelColor(i,0) == QColor(Qt::white));
+ }
+}
+
QTEST_MAIN(tst_QPainter)
#include "tst_qpainter.moc"