From 2417cade46d5680fe4a23ad2e3d1607b3989c758 Mon Sep 17 00:00:00 2001 From: Johan Klokkhammer Helsing Date: Wed, 14 Mar 2018 16:47:11 +0100 Subject: tst_QOpenGLWindow: Move resizing to separate test Resizing is broken on Wayland EGL on Intel Mesa. Move resizing into a separate test and skip it on Wayland it until it's fixed in Mesa. Task-number: QTBUG-66848 Change-Id: I9450a5a588b0f5d8f0bd0210aae2dc72aa48d622 Reviewed-by: Pier Luigi Fiorini Reviewed-by: Laszlo Agocs --- .../gui/kernel/qopenglwindow/tst_qopenglwindow.cpp | 25 ++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) (limited to 'tests/auto/gui/kernel/qopenglwindow/tst_qopenglwindow.cpp') diff --git a/tests/auto/gui/kernel/qopenglwindow/tst_qopenglwindow.cpp b/tests/auto/gui/kernel/qopenglwindow/tst_qopenglwindow.cpp index 8ffd1bb9b4..a971450ee8 100644 --- a/tests/auto/gui/kernel/qopenglwindow/tst_qopenglwindow.cpp +++ b/tests/auto/gui/kernel/qopenglwindow/tst_qopenglwindow.cpp @@ -42,6 +42,7 @@ private slots: void initTestCase(); void create(); void basic(); + void resize(); void painter(); void partial_data(); void partial(); @@ -115,8 +116,7 @@ void tst_QOpenGLWindow::basic() // Check that the virtuals are invoked. QCOMPARE(w.initCount, 1); - int resCount = w.resizeCount; - QVERIFY(resCount >= 1); + QVERIFY(w.resizeCount >= 1); QVERIFY(w.paintCount >= 1); // Check that something has been drawn; @@ -132,6 +132,27 @@ void tst_QOpenGLWindow::basic() QCOMPARE(v[2], GLint(w.width() * w.devicePixelRatio())); QCOMPARE(v[3], GLint(w.height() * w.devicePixelRatio())); w.doneCurrent(); +} + +static bool isPlatformWayland() +{ + return QGuiApplication::platformName().startsWith(QLatin1String("wayland"), Qt::CaseInsensitive); +} + +void tst_QOpenGLWindow::resize() +{ + if (isPlatformWayland()) + QSKIP("Wayland: Crashes on Intel Mesa due to a driver bug (QTBUG-66848)."); + + Window w; + w.reset(); + w.resize(640, 480); + w.show(); + QVERIFY(QTest::qWaitForWindowExposed(&w)); + + // Check that the virtuals are invoked. + int resCount = w.resizeCount; + QVERIFY(resCount >= 1); // Check that a future resize triggers resizeGL. w.resize(800, 600); -- cgit v1.2.3