aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/quick/qquickwindow/tst_qquickwindow.cpp
diff options
context:
space:
mode:
authorLaszlo Agocs <laszlo.agocs@digia.com>2014-08-07 17:19:50 +0200
committerLaszlo Agocs <laszlo.agocs@digia.com>2014-08-11 13:19:38 +0200
commitf03892bbe9f017459d72e15943dc35ac86a681bf (patch)
tree6e751dd0e6af3c94a75b1fadfe7e3805fd116084 /tests/auto/quick/qquickwindow/tst_qquickwindow.cpp
parent126c06586849ca41c7d13b833cb8af98d3873b4b (diff)
Remove setDefaultFormat() from QQuickWindow
Replaced by QSurfaceFormat::setDefaultFormat(). Change-Id: If4e37b75ccb55d556d80b0079be89e5a521f6dbb Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
Diffstat (limited to 'tests/auto/quick/qquickwindow/tst_qquickwindow.cpp')
-rw-r--r--tests/auto/quick/qquickwindow/tst_qquickwindow.cpp16
1 files changed, 11 insertions, 5 deletions
diff --git a/tests/auto/quick/qquickwindow/tst_qquickwindow.cpp b/tests/auto/quick/qquickwindow/tst_qquickwindow.cpp
index b8e36b06fb..3acf8a5f07 100644
--- a/tests/auto/quick/qquickwindow/tst_qquickwindow.cpp
+++ b/tests/auto/quick/qquickwindow/tst_qquickwindow.cpp
@@ -1912,12 +1912,10 @@ void tst_qquickwindow::defaultSurfaceFormat()
// least using some harmless settings to check that the global, static format is
// taken into account in the requested format.
- QSurfaceFormat savedDefaultFormat = QQuickWindow::defaultFormat();
+ QSurfaceFormat savedDefaultFormat = QSurfaceFormat::defaultFormat();
// Verify that depth and stencil are set, as they should be, unless they are disabled
// via environment variables.
- QVERIFY(savedDefaultFormat.depthBufferSize() >= 16);
- QVERIFY(savedDefaultFormat.stencilBufferSize() >= 8);
QSurfaceFormat format = savedDefaultFormat;
format.setSwapInterval(0);
@@ -1926,7 +1924,9 @@ void tst_qquickwindow::defaultSurfaceFormat()
format.setBlueBufferSize(8);
format.setProfile(QSurfaceFormat::CompatibilityProfile);
format.setOption(QSurfaceFormat::DebugContext);
- QQuickWindow::setDefaultFormat(format);
+ // Will not set depth and stencil. That should be added automatically,
+ // unless the are disabled (but they aren't).
+ QSurfaceFormat::setDefaultFormat(format);
QQuickWindow window;
window.show();
@@ -1940,7 +1940,13 @@ void tst_qquickwindow::defaultSurfaceFormat()
QCOMPARE(format.profile(), reqFmt.profile());
QCOMPARE(int(format.options()), int(reqFmt.options()));
- QQuickWindow::setDefaultFormat(savedDefaultFormat);
+ // Depth and stencil should be >= what has been requested. For real. But use
+ // the context since the window's surface format is only partially updated
+ // on most platforms.
+ QVERIFY(window.openglContext()->format().depthBufferSize() >= 16);
+ QVERIFY(window.openglContext()->format().stencilBufferSize() >= 8);
+
+ QSurfaceFormat::setDefaultFormat(savedDefaultFormat);
}
void tst_qquickwindow::glslVersion()