diff options
Diffstat (limited to 'tests/auto/quick/drawingmodes/tst_drawingmodes.cpp')
-rw-r--r-- | tests/auto/quick/drawingmodes/tst_drawingmodes.cpp | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/tests/auto/quick/drawingmodes/tst_drawingmodes.cpp b/tests/auto/quick/drawingmodes/tst_drawingmodes.cpp index afc66948b0..9bcc21c77d 100644 --- a/tests/auto/quick/drawingmodes/tst_drawingmodes.cpp +++ b/tests/auto/quick/drawingmodes/tst_drawingmodes.cpp @@ -69,6 +69,9 @@ private slots: void triangles(); void triangleStrip(); void triangleFan(); + +private: + bool isRunningOnRhi() const; }; class DrawingModeItem : public QQuickItem @@ -260,6 +263,9 @@ void tst_drawingmodes::lineLoop() || (QGuiApplication::platformName() == QLatin1String("minimal"))) QSKIP("Skipping due to grabWindow not functional on offscreen/minimimal platforms"); + if (isRunningOnRhi()) + QSKIP("Line loops are not supported by some modern graphics APIs - skipping test"); + QImage fb = runTest("DrawingModes.qml"); QCOMPARE(fb.width(), 200); @@ -350,6 +356,9 @@ void tst_drawingmodes::triangleFan() || (QGuiApplication::platformName() == QLatin1String("minimal"))) QSKIP("Skipping due to grabWindow not functional on offscreen/minimimal platforms"); + if (isRunningOnRhi()) + QSKIP("Triangle fans are not supported by some modern graphics APIs - skipping test"); + QImage fb = runTest("DrawingModes.qml"); QCOMPARE(fb.width(), 200); @@ -368,6 +377,23 @@ void tst_drawingmodes::triangleFan() QVERIFY(!hasPixelAround(fb, 37, 100)); } +bool tst_drawingmodes::isRunningOnRhi() const +{ + static bool retval = false; + static bool decided = false; + if (!decided) { + decided = true; + QQuickView dummy; + dummy.show(); + if (QTest::qWaitForWindowExposed(&dummy)) { + QSGRendererInterface::GraphicsApi api = dummy.rendererInterface()->graphicsApi(); + retval = QSGRendererInterface::isApiRhiBased(api); + } + dummy.hide(); + } + return retval; +} + QTEST_MAIN(tst_drawingmodes) |