summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2020-12-04 11:30:43 +0100
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2020-12-04 16:28:19 +0000
commitf8842c07475163a5703c92e9b0c4838b1fc5d7cb (patch)
tree088204f95c42a0f61525ede090e9a90cbfce0897 /tests
parentab36b713de3f2ad619365e863ec3f5be5f487051 (diff)
Fix QImage::setPixelColor on RGBA64_Premultiplied
QColors were not premultiplied before being set. Change-Id: Id3765b6932a72374ddfd788fae4bb628a4edf0b7 Reviewed-by: Lars Knoll <lars.knoll@qt.io> (cherry picked from commit 0c19e3f703a7c3fd59e6db8a9d4ac7091674b552) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'tests')
-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 d5c5752f95..2f20559258 100644
--- a/tests/auto/gui/image/qimage/tst_qimage.cpp
+++ b/tests/auto/gui/image/qimage/tst_qimage.cpp
@@ -3536,6 +3536,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()