diff options
author | Laszlo Agocs <laszlo.agocs@qt.io> | 2020-06-10 09:26:52 +0200 |
---|---|---|
committer | Laszlo Agocs <laszlo.agocs@qt.io> | 2020-06-11 22:23:50 +0200 |
commit | 132e2fb2bf28c6aa3c1598deecf4d723f83396ec (patch) | |
tree | 805c55e6e49b2b05500b5ecf1f563fdf15e068be /tests/auto/quick/qquickwindow/tst_qquickwindow.cpp | |
parent | 2cb24f7054e1105be0dcb1a4d61a5b52d62d1a55 (diff) |
Make openglContext getter in QQuickWindow private
Fix up the scenegraph and qquickwindow autotests as well. (direct OpenGL
specifics are now completely removed from both, i.e. the remaning OpenGL
specific tests are now run (and not skipped) with OpenGL-on-RHI)
[ChangeLog][Qt Quick][QQuickWindow] openglContext() has been removed
from QQuickWindow. Use QSGRendererInterface to query the QOpenGLContext.
Change-Id: If5c9802b71ac5f9cffc695827e286eb2a2d03580
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
Diffstat (limited to 'tests/auto/quick/qquickwindow/tst_qquickwindow.cpp')
-rw-r--r-- | tests/auto/quick/qquickwindow/tst_qquickwindow.cpp | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/tests/auto/quick/qquickwindow/tst_qquickwindow.cpp b/tests/auto/quick/qquickwindow/tst_qquickwindow.cpp index cd551c1837..871f80b027 100644 --- a/tests/auto/quick/qquickwindow/tst_qquickwindow.cpp +++ b/tests/auto/quick/qquickwindow/tst_qquickwindow.cpp @@ -2409,10 +2409,11 @@ void tst_qquickwindow::defaultSurfaceFormat() // 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. - const QOpenGLContext *openglContext = nullptr; - QTRY_VERIFY((openglContext = window.openglContext()) != nullptr); - QVERIFY(openglContext->format().depthBufferSize() >= 16); - QVERIFY(openglContext->format().stencilBufferSize() >= 8); + const QOpenGLContext *ctx = nullptr; + QTRY_VERIFY((ctx = static_cast<QOpenGLContext *>(window.rendererInterface()->getResource( + &window, QSGRendererInterface::OpenGLContextResource))) != nullptr); + QVERIFY(ctx->format().depthBufferSize() >= 16); + QVERIFY(ctx->format().stencilBufferSize() >= 8); #endif QSurfaceFormat::setDefaultFormat(savedDefaultFormat); } @@ -2539,7 +2540,10 @@ void tst_qquickwindow::testRenderJob() // Do a synchronized GL job. GLubyte readPixel[4] = {0, 0, 0, 0}; GlRenderJob *glJob = new GlRenderJob(readPixel); - if (window.openglContext()->thread() != QThread::currentThread()) { + QOpenGLContext *ctx = static_cast<QOpenGLContext *>(window.rendererInterface()->getResource( + &window, QSGRendererInterface::OpenGLContextResource)); + QVERIFY(ctx); + if (ctx->thread() != QThread::currentThread()) { QMutex mutex; QWaitCondition condition; glJob->mutex = &mutex; |