diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2020-12-04 11:30:43 +0100 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2020-12-04 16:28:18 +0000 |
commit | 6f125dcf1a7677f5728ff6c00594c94df18ec051 (patch) | |
tree | 07388accf60ee86a1e76d50fb8cb7354eb9ff790 /tests/auto/gui | |
parent | 539a16a69fa1ef302cf4eb97ff5a7f8afb606d15 (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/auto/gui')
-rw-r--r-- | tests/auto/gui/image/qimage/tst_qimage.cpp | 8 |
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() |