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 <pierluigi.fiorini@liri.io>
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
This commit is contained in:
Johan Klokkhammer Helsing 2018-03-14 16:47:11 +01:00 committed by Johan Helsing
parent efa6e98912
commit 2417cade46

View File

@ -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);