diff options
author | Jani Hautakangas <jani.hautakangas@nokia.com> | 2010-10-12 09:41:26 (GMT) |
---|---|---|
committer | Jani Hautakangas <jani.hautakangas@nokia.com> | 2010-10-12 10:54:36 (GMT) |
commit | 71de6cd879f2f79900bda83cc4ba48f6df051d66 (patch) | |
tree | eccaf65b77b19b3c8918195713f1626860ac4fb3 /tests | |
parent | edddadd88950f22f6d813e50acdcf2711d3d5a84 (diff) | |
download | Qt-71de6cd879f2f79900bda83cc4ba48f6df051d66.zip Qt-71de6cd879f2f79900bda83cc4ba48f6df051d66.tar.gz Qt-71de6cd879f2f79900bda83cc4ba48f6df051d66.tar.bz2 |
Fix for CFbsBitmap to QPixmap conversion.
Symbian bitmap formats may have different scanline length
when compared to QImage formats. We need to define scanline
length for intermediate QImage when converting from CFbsBitmap
to QPixmap.
Task-number: QTBUG-14218
Reviewed-by: Jason Barron
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/qpixmap/tst_qpixmap.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/auto/qpixmap/tst_qpixmap.cpp b/tests/auto/qpixmap/tst_qpixmap.cpp index 24cbb21..fdf8311 100644 --- a/tests/auto/qpixmap/tst_qpixmap.cpp +++ b/tests/auto/qpixmap/tst_qpixmap.cpp @@ -1160,6 +1160,8 @@ void tst_QPixmap::fromSymbianCFbsBitmap_data() const int smallHeight = 20; const int largeWidth = 240; const int largeHeight = 320; + const int notAlignedWidth = 250; + const int notAlignedHeight = 250; // Indexed Color Formats - Disabled since images seem to be blank -> no palette? // QTest::newRow("EGray2 small") << EGray2 << smallWidth << smallHeight << QColor(Qt::black); @@ -1172,14 +1174,19 @@ void tst_QPixmap::fromSymbianCFbsBitmap_data() // Direct Color Formats QTest::newRow("EColor4K small") << EColor4K << smallWidth << smallHeight << QColor(Qt::red); QTest::newRow("EColor4K big") << EColor4K << largeWidth << largeHeight << QColor(Qt::red); + QTest::newRow("EColor4K not aligned") << EColor4K << notAlignedWidth << notAlignedHeight << QColor(Qt::red); QTest::newRow("EColor64K small") << EColor64K << smallWidth << smallHeight << QColor(Qt::green); QTest::newRow("EColor64K big") << EColor64K << largeWidth << largeHeight << QColor(Qt::green); + QTest::newRow("EColor64K not aligned") << EColor64K << notAlignedWidth << notAlignedHeight << QColor(Qt::green); QTest::newRow("EColor16M small") << EColor16M << smallWidth << smallHeight << QColor(Qt::yellow); QTest::newRow("EColor16M big") << EColor16M << largeWidth << largeHeight << QColor(Qt::yellow); + QTest::newRow("EColor16M not aligned") << EColor16M << notAlignedWidth << notAlignedHeight << QColor(Qt::yellow); QTest::newRow("EColor16MU small") << EColor16MU << smallWidth << smallHeight << QColor(Qt::red); QTest::newRow("EColor16MU big") << EColor16MU << largeWidth << largeHeight << QColor(Qt::red); + QTest::newRow("EColor16MU not aligned") << EColor16MU << notAlignedWidth << notAlignedHeight << QColor(Qt::red); QTest::newRow("EColor16MA small opaque") << EColor16MA << smallWidth << smallHeight << QColor(255, 255, 0); QTest::newRow("EColor16MA big opaque") << EColor16MA << largeWidth << largeHeight << QColor(255, 255, 0); + QTest::newRow("EColor16MA not aligned opaque") << EColor16MA << notAlignedWidth << notAlignedHeight << QColor(255, 255, 0); // Semi-transparent Colors - Disabled for now, since the QCOMPARE fails, but visually confirmed to work // QTest::newRow("EColor16MA small semi") << EColor16MA << smallWidth << smallHeight << QColor(255, 255, 0, 127); @@ -1237,6 +1244,10 @@ void tst_QPixmap::fromSymbianCFbsBitmap() QColor actualColor(image.pixel(1, 1)); QCOMPARE(actualColor, color); + + QImage shouldBe(pixmap.width(), pixmap.height(), image.format()); + shouldBe.fill(color.rgba()); + QCOMPARE(image, shouldBe); } __UHEAP_MARKEND; |