From 52a3f1b00cca13767eefabf61742d2d802c56511 Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Wed, 6 Nov 2019 10:04:54 +0100 Subject: Fix accuracy of ARGB32->A2RGB30 conversions It was converted over ARGB32PM, when it should have been directly converted to not lose accuracy, instead there was an unnecessary direct ARGB32->RGB30 conversion, which was converted to the necessary type. This also improves the selection of conversion over ARGB32PM or RGBA64PM for ARGB32 and RGBA8888 by using 32-bit conversion when alpha is not relevant. Change-Id: I5990d8a23b2909d3910d8c1213fa46477742b052 Reviewed-by: Eirik Aavitsland --- tests/auto/gui/image/qimage/tst_qimage.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'tests') diff --git a/tests/auto/gui/image/qimage/tst_qimage.cpp b/tests/auto/gui/image/qimage/tst_qimage.cpp index 2a9b92ed35..e9aa9aad30 100644 --- a/tests/auto/gui/image/qimage/tst_qimage.cpp +++ b/tests/auto/gui/image/qimage/tst_qimage.cpp @@ -924,6 +924,9 @@ void tst_QImage::convertToFormat_data() QTest::newRow("blue rgb30 -> argb32") << int(QImage::Format_RGB30) << 0xff0000ff << int(QImage::Format_ARGB32) << 0xff0000ff; + QTest::newRow("semigray argb32 -> a2rgb30 pm") << int(QImage::Format_ARGB32) << 0x4c646565u + << int(QImage::Format_A2RGB30_Premultiplied) << 0x55212222u; + QTest::newRow("white gray8 -> argb pm") << int(QImage::Format_Grayscale8) << 0xfffffeffu << int(QImage::Format_ARGB32_Premultiplied) << 0xfffefefeu; QTest::newRow("gray gray8 -> argb pm") << int(QImage::Format_Grayscale8) << 0xff565557u -- cgit v1.2.3