summaryrefslogtreecommitdiffstats
path: root/tests/auto/qpixmap
diff options
context:
space:
mode:
authorLaszlo Agocs <laszlo.p.agocs@nokia.com>2011-03-21 09:22:52 (GMT)
committerLaszlo Agocs <laszlo.p.agocs@nokia.com>2011-03-21 09:29:08 (GMT)
commit4ff9f1394f0cc527864ecba29bc7f6a9c3210fea (patch)
treec687c2caffd3b06a7cb3699dfd87d95a7541f8ea /tests/auto/qpixmap
parent31514ab488c610056973318f5a950d925155d480 (diff)
downloadQt-4ff9f1394f0cc527864ecba29bc7f6a9c3210fea.zip
Qt-4ff9f1394f0cc527864ecba29bc7f6a9c3210fea.tar.gz
Qt-4ff9f1394f0cc527864ecba29bc7f6a9c3210fea.tar.bz2
Prepare fromSymbianCFbsBitmap autotest for 16 bpp format.
Due to recent changes QPixmap::fromImage() can return RGB16 images for OpenVG pixmaps created from CFbsBitmap of display mode EColor64K. The qpixmap autotest assumed that the returned image is always 32 bpp which is not true anymore. Now it explicitly checks for 16 bpp and handles it properly. Reviewed-by: Jani Hautakangas
Diffstat (limited to 'tests/auto/qpixmap')
-rw-r--r--tests/auto/qpixmap/tst_qpixmap.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/tests/auto/qpixmap/tst_qpixmap.cpp b/tests/auto/qpixmap/tst_qpixmap.cpp
index bd9c26f..464cd3b 100644
--- a/tests/auto/qpixmap/tst_qpixmap.cpp
+++ b/tests/auto/qpixmap/tst_qpixmap.cpp
@@ -52,6 +52,7 @@
#include <qsplashscreen.h>
#include <private/qpixmapdata_p.h>
+#include <private/qdrawhelper_p.h>
#include <QSet>
@@ -1264,7 +1265,10 @@ void tst_QPixmap::fromSymbianCFbsBitmap()
QCOMPARE(actualColor, color);
QImage shouldBe(pixmap.width(), pixmap.height(), image.format());
- shouldBe.fill(color.rgba());
+ if (image.format() == QImage::Format_RGB16)
+ shouldBe.fill(qrgb565(color.rgba()).rawValue());
+ else
+ shouldBe.fill(color.rgba());
QCOMPARE(image, shouldBe);
}
__UHEAP_MARKEND;