aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/quick/drawingmodes/tst_drawingmodes.cpp
diff options
context:
space:
mode:
authorAlexandru Croitor <alexandru.croitor@qt.io>2019-07-11 14:51:40 +0200
committerAlexandru Croitor <alexandru.croitor@qt.io>2019-07-11 17:24:39 +0200
commit13374ceb165c44658aa97890c37b206859c9a31c (patch)
tree562362b196a459ee3449a5a1e60e5216a9dd6984 /tests/auto/quick/drawingmodes/tst_drawingmodes.cpp
parentae47deba4c943c496412530a8d2a5a688ae12038 (diff)
parentb5d18be5a03406d0aac83856dd41e1525fd14a28 (diff)
Merge remote-tracking branch 'origin/wip/qt6' into wip/cmake
Diffstat (limited to 'tests/auto/quick/drawingmodes/tst_drawingmodes.cpp')
-rw-r--r--tests/auto/quick/drawingmodes/tst_drawingmodes.cpp25
1 files changed, 25 insertions, 0 deletions
diff --git a/tests/auto/quick/drawingmodes/tst_drawingmodes.cpp b/tests/auto/quick/drawingmodes/tst_drawingmodes.cpp
index afc66948b0..f3825b350f 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,22 @@ 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();
+ QTest::qWaitForWindowExposed(&dummy);
+ QSGRendererInterface::GraphicsApi api = dummy.rendererInterface()->graphicsApi();
+ retval = QSGRendererInterface::isApiRhiBased(api);
+ dummy.hide();
+ }
+ return retval;
+}
+
QTEST_MAIN(tst_drawingmodes)