diff options
Diffstat (limited to 'tests/auto/qtquick2/qquickitemlayer/tst_qquickitemlayer.cpp')
-rw-r--r-- | tests/auto/qtquick2/qquickitemlayer/tst_qquickitemlayer.cpp | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/tests/auto/qtquick2/qquickitemlayer/tst_qquickitemlayer.cpp b/tests/auto/qtquick2/qquickitemlayer/tst_qquickitemlayer.cpp index 1e55924f86..2a856707ba 100644 --- a/tests/auto/qtquick2/qquickitemlayer/tst_qquickitemlayer.cpp +++ b/tests/auto/qtquick2/qquickitemlayer/tst_qquickitemlayer.cpp @@ -86,6 +86,8 @@ private slots: void toggleLayerAndEffect(); void disableLayer(); void changeSamplerName(); + void itemEffect(); + void rectangleEffect(); private: bool m_isMesaSoftwareRasterizer; @@ -403,6 +405,32 @@ void tst_QQuickItemLayer::changeSamplerName() QCOMPARE(fb.pixel(0, 0), qRgb(0, 0, 0xff)); } +void tst_QQuickItemLayer::itemEffect() +{ + if (m_isMesaSoftwareRasterizer && m_mesaVersion < QT_VERSION_CHECK(7, 11, 0)) + QSKIP("Mesa Software Rasterizer below version 7.11 does not render this test correctly."); + QImage fb = runTest(testFile("ItemEffect.qml")); + QCOMPARE(fb.pixel(0, 0), qRgb(0xff, 0, 0)); + QCOMPARE(fb.pixel(199, 0), qRgb(0xff, 0, 0)); + QCOMPARE(fb.pixel(0, 199), qRgb(0, 0, 0xff)); + QCOMPARE(fb.pixel(199, 199), qRgb(0, 0, 0xff)); +} + +void tst_QQuickItemLayer::rectangleEffect() +{ + QImage fb = runTest(testFile("RectangleEffect.qml")); + QCOMPARE(fb.pixel(0, 0), qRgb(0, 0xff, 0)); + QCOMPARE(fb.pixel(199, 0), qRgb(0, 0xff, 0)); + QCOMPARE(fb.pixel(0, 199), qRgb(0, 0xff, 0)); + QCOMPARE(fb.pixel(199, 199), qRgb(0, 0xff, 0)); + + QCOMPARE(fb.pixel(100, 0), qRgb(0, 0, 0xff)); + QCOMPARE(fb.pixel(199, 100), qRgb(0, 0, 0xff)); + QCOMPARE(fb.pixel(100, 199), qRgb(0, 0, 0xff)); + QCOMPARE(fb.pixel(0, 100), qRgb(0, 0, 0xff)); +} + + QTEST_MAIN(tst_QQuickItemLayer) #include "tst_qquickitemlayer.moc" |