From 132e2fb2bf28c6aa3c1598deecf4d723f83396ec Mon Sep 17 00:00:00 2001 From: Laszlo Agocs Date: Wed, 10 Jun 2020 09:26:52 +0200 Subject: 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 --- tests/auto/quick/qquickwindow/tst_qquickwindow.cpp | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'tests/auto/quick/qquickwindow/tst_qquickwindow.cpp') 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(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(window.rendererInterface()->getResource( + &window, QSGRendererInterface::OpenGLContextResource)); + QVERIFY(ctx); + if (ctx->thread() != QThread::currentThread()) { QMutex mutex; QWaitCondition condition; glJob->mutex = &mutex; -- cgit v1.2.3