diff options
Diffstat (limited to 'tests/auto/gui/image/qpixmap/tst_qpixmap.cpp')
-rw-r--r-- | tests/auto/gui/image/qpixmap/tst_qpixmap.cpp | 39 |
1 files changed, 13 insertions, 26 deletions
diff --git a/tests/auto/gui/image/qpixmap/tst_qpixmap.cpp b/tests/auto/gui/image/qpixmap/tst_qpixmap.cpp index 8df8c2d3b6..ad7de09c48 100644 --- a/tests/auto/gui/image/qpixmap/tst_qpixmap.cpp +++ b/tests/auto/gui/image/qpixmap/tst_qpixmap.cpp @@ -263,7 +263,7 @@ void tst_QPixmap::fromImage() image.fill(0x7f7f7f7f); const QPixmap pixmap = QPixmap::fromImage(image); -#ifdef Q_DEAD_CODE_FROM_QT4_X11 +#if 0 // Used to be included in Qt4 for Q_WS_X11 if (pixmap.handle()->classId() == QPlatformPixmap::X11Class && !pixmap.x11PictureHandle()) QSKIP("Requires XRender support"); #endif @@ -443,22 +443,16 @@ void tst_QPixmap::fill_data() QTest::newRow(("syscolor_" + QByteArray::number(color)).constData()) << uint(color) << true << false; -#if defined (Q_OS_WINCE) - QPixmap pixmap(1,1); - if (QApplication::desktop()->grab().depth() >= 24) { -#else - QPixmap pixmap(1, 1); { -#endif - QTest::newRow("alpha_7f_red") << 0x7fff0000u << false << false; - QTest::newRow("alpha_3f_blue") << 0x3f0000ffu << false << false; - QTest::newRow("alpha_b7_green") << 0xbf00ff00u << false << false; - QTest::newRow("alpha_7f_white") << 0x7fffffffu << false << false; - QTest::newRow("alpha_3f_white") << 0x3fffffffu << false << false; - QTest::newRow("alpha_b7_white") << 0xb7ffffffu << false << false; - QTest::newRow("alpha_7f_black") << 0x7f000000u << false << false; - QTest::newRow("alpha_3f_black") << 0x3f000000u << false << false; - QTest::newRow("alpha_b7_black") << 0xbf000000u << false << false; - } + QPixmap pixmap(1, 1); + QTest::newRow("alpha_7f_red") << 0x7fff0000u << false << false; + QTest::newRow("alpha_3f_blue") << 0x3f0000ffu << false << false; + QTest::newRow("alpha_b7_green") << 0xbf00ff00u << false << false; + QTest::newRow("alpha_7f_white") << 0x7fffffffu << false << false; + QTest::newRow("alpha_3f_white") << 0x3fffffffu << false << false; + QTest::newRow("alpha_b7_white") << 0xb7ffffffu << false << false; + QTest::newRow("alpha_7f_black") << 0x7f000000u << false << false; + QTest::newRow("alpha_3f_black") << 0x3f000000u << false << false; + QTest::newRow("alpha_b7_black") << 0xbf000000u << false << false; QTest::newRow("bitmap_color0") << uint(Qt::color0) << true << true; QTest::newRow("bitmap_color1") << uint(Qt::color1) << true << true; @@ -493,7 +487,7 @@ void tst_QPixmap::fill() else pm = QPixmap(400, 400); -#if defined(Q_DEAD_CODE_FROM_QT4_X11) +#if 0 // Used to be included in Qt4 for Q_WS_X11 if (!bitmap && pm.handle()->classId() == QPlatformPixmap::X11Class && !pm.x11PictureHandle()) QSKIP("Requires XRender support"); #endif @@ -523,7 +517,7 @@ void tst_QPixmap::fill() void tst_QPixmap::fill_transparent() { QPixmap pixmap(10, 10); -#ifdef Q_DEAD_CODE_FROM_QT4_X11 +#if 0 // Used to be included in Qt4 for Q_WS_X11 if (pixmap.handle()->classId() == QPlatformPixmap::X11Class && !pixmap.x11PictureHandle()) QSKIP("Requires XRender support"); #endif @@ -892,9 +886,6 @@ void tst_QPixmap::fromWinHBITMAP() HGDIOBJ old_brush = SelectObject(bitmap_dc, CreateSolidBrush(RGB(red, green, blue))); Rectangle(bitmap_dc, 0, 0, 100, 100); -#ifdef Q_OS_WINCE //the device context has to be deleted before QPixmap::fromWinHBITMAP() - DeleteDC(bitmap_dc); -#endif QPixmap pixmap = qt_pixmapFromWinHBITMAP(bitmap); QCOMPARE(pixmap.width(), 100); QCOMPARE(pixmap.height(), 100); @@ -907,9 +898,7 @@ void tst_QPixmap::fromWinHBITMAP() DeleteObject(SelectObject(bitmap_dc, old_brush)); DeleteObject(SelectObject(bitmap_dc, bitmap)); -#ifndef Q_OS_WINCE DeleteDC(bitmap_dc); -#endif ReleaseDC(0, display_dc); } @@ -1011,7 +1000,6 @@ void tst_QPixmap::fromWinHICON_data() void tst_QPixmap::fromWinHICON() { -#ifndef Q_OS_WINCE QFETCH(int, width); QFETCH(int, height); QFETCH(QString, image); @@ -1029,7 +1017,6 @@ void tst_QPixmap::fromWinHICON() // between QImage::Format_ARGB32 and QImage::Format_ARGB32_Premultiplied, or elsewhere QVERIFY(compareImages(imageFromHICON, imageFromFile)); -#endif // Q_OS_WINCE } #endif // Q_OS_WIN && !Q_OS_WINRT |