aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/items/qquickwindow.cpp
diff options
context:
space:
mode:
authorLaszlo Agocs <laszlo.agocs@qt.io>2019-11-12 10:57:15 +0100
committerLaszlo Agocs <laszlo.agocs@qt.io>2019-11-14 15:33:37 +0100
commitb6b1d5899415fef3231120c08c56a1dc2e246940 (patch)
tree7bf4db6ba359bf76d968fdd58d5b63a5b997b782 /src/quick/items/qquickwindow.cpp
parent0a649f25813b8c2ecf679db106cb8ec175b9145a (diff)
Make QQuickFbo work with the OpenGL backend of QRhi
So no matter if Quick goes directly to OpenGL, or via QRhi, QQuickFramebufferObject will still work. Also fix up the fboitem example to use a ShaderEffect that works with both rendering paths. With graphics APIs other than OpenGL the item will be empty, as QQuickFbo is not something we can support there. Task-number: QTBUG-79222 Change-Id: I52177d3a75f619f7075a2fc829573c17031eded1 Reviewed-by: Andy Nichols <andy.nichols@qt.io>
Diffstat (limited to 'src/quick/items/qquickwindow.cpp')
-rw-r--r--src/quick/items/qquickwindow.cpp13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/quick/items/qquickwindow.cpp b/src/quick/items/qquickwindow.cpp
index 6286a1694a..905241989e 100644
--- a/src/quick/items/qquickwindow.cpp
+++ b/src/quick/items/qquickwindow.cpp
@@ -4735,8 +4735,7 @@ void QQuickWindow::setDefaultAlphaBuffer(bool useAlpha)
adaptation.
\note This function has no effect when running on the RHI graphics
- abstraction. With the RHI, the functions to call when enqueuing native
- graphics commands are beginExternalCommands() and endExternalCommands().
+ abstraction and the underlying RHI backend is not OpenGL.
\sa QQuickWindow::beforeRendering(), beginExternalCommands(), endExternalCommands()
*/
@@ -4744,7 +4743,7 @@ void QQuickWindow::resetOpenGLState()
{
Q_D(QQuickWindow);
- if (d->rhi || !openglContext())
+ if (!openglContext())
return;
QOpenGLContext *ctx = openglContext();
@@ -4859,7 +4858,13 @@ const QQuickWindow::GraphicsStateInfo &QQuickWindow::graphicsStateInfo()
directly and the RHI graphics abstraction layer is not in use. Refer to
resetOpenGLState() in that case.
- \sa endExternalCommands()
+ \note When the scenegraph is using the RHI graphics abstraction layer with
+ the OpenGL backend underneath, pay attention to the fact that the OpenGL
+ state in the context can have arbitrary settings, and this function does not
+ perform any resetting of the state back to defaults. Call
+ resetOpenGLState() if that is seen necessary.
+
+ \sa endExternalCommands(), resetOpenGLState()
\since 5.14
*/