summaryrefslogtreecommitdiffstats
path: root/tests/auto/gui
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2020-12-04 11:30:43 +0100
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2020-12-04 15:09:47 +0100
commit0c19e3f703a7c3fd59e6db8a9d4ac7091674b552 (patch)
tree7bdb07c771acb08026d34766311ae54b22e97b58 /tests/auto/gui
parent0a01396e60e0f214d37a740549b88baf913b2747 (diff)
Fix QImage::setPixelColor on RGBA64_Premultiplied
QColors were not premultiplied before being set. Pick-to: 6.0 5.15 5.12 Change-Id: Id3765b6932a72374ddfd788fae4bb628a4edf0b7 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'tests/auto/gui')
-rw-r--r--tests/auto/gui/image/qimage/tst_qimage.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/auto/gui/image/qimage/tst_qimage.cpp b/tests/auto/gui/image/qimage/tst_qimage.cpp
index 94014bd4ef..0e0cb5d5a5 100644
--- a/tests/auto/gui/image/qimage/tst_qimage.cpp
+++ b/tests/auto/gui/image/qimage/tst_qimage.cpp
@@ -3572,6 +3572,14 @@ void tst_QImage::pixelColor()
// Try setting an invalid color.
QTest::ignoreMessage(QtWarningMsg, "QImage::setPixelColor: color is invalid");
argb32.setPixelColor(0, 0, QColor());
+
+ // Test correct premultiplied handling of RGBA64 as well
+ QImage rgba64(1, 1, QImage::Format_RGBA64);
+ QImage rgba64pm(1, 1, QImage::Format_RGBA64_Premultiplied);
+ rgba64.setPixelColor(QPoint(0, 0), c);
+ rgba64pm.setPixelColor(QPoint(0, 0), c);
+ QCOMPARE(rgba64.pixelColor(QPoint(0, 0)), c);
+ QCOMPARE(rgba64pm.pixelColor(QPoint(0, 0)), c);
}
void tst_QImage::pixel()