From 9943181dcc9e2b0de630669219edcaf62956c1f1 Mon Sep 17 00:00:00 2001 From: Laszlo Agocs Date: Thu, 11 Jun 2020 15:32:53 +0200 Subject: Move resetOpenGLState() to QQuickFbo MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit QQuickWindow should not have OpenGL specifics in its API in Qt 6. However, resetOpenGLState() is used by applications commonly in combination with QQuickFramebufferObject (not the least because the documentation recommends it!). This is no problem in practice because QQuickFramebufferObject remains an OpenGL-only feature. So to minimize the breaks, move the function into QQuickFramebufferObject::Renderer so any application that calls the function can continue to do so by just calling it on 'this' instead. The rendercontrol_opengl example used to call this function as well, but unnecessarily, it will still function the same way without it. Note that there is a chance that there are applications that call resetOpenGLState() in other contexts, for example in slots connected to before or afterRendering(). For these it will need to be determined if the call is necessary at all, and if it is, should be replaced by (re)setting the appropriate OpenGL state manually instead. Task-number: QTBUG-84523 Change-Id: I335599f77e8a84e347a44427eb1a1bf917796ee8 Reviewed-by: Christian Strømme --- .../quick/rendercontrol/rendercontrol_opengl/window_singlethreaded.cpp | 2 -- 1 file changed, 2 deletions(-) (limited to 'examples/quick') diff --git a/examples/quick/rendercontrol/rendercontrol_opengl/window_singlethreaded.cpp b/examples/quick/rendercontrol/rendercontrol_opengl/window_singlethreaded.cpp index 9435c004a7..0d29a155dd 100644 --- a/examples/quick/rendercontrol/rendercontrol_opengl/window_singlethreaded.cpp +++ b/examples/quick/rendercontrol/rendercontrol_opengl/window_singlethreaded.cpp @@ -206,9 +206,7 @@ void WindowSingleThreaded::render() m_renderControl->render(); m_renderControl->endFrame(); - m_quickWindow->resetOpenGLState(); QOpenGLFramebufferObject::bindDefault(); - m_context->functions()->glFlush(); m_quickReady = true; -- cgit v1.2.3