From 4ff9f1394f0cc527864ecba29bc7f6a9c3210fea Mon Sep 17 00:00:00 2001 From: Laszlo Agocs Date: Mon, 21 Mar 2011 11:22:52 +0200 Subject: 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 --- tests/auto/qpixmap/tst_qpixmap.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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 #include +#include #include @@ -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; -- cgit v0.12