aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick
diff options
context:
space:
mode:
authorLaszlo Agocs <laszlo.agocs@qt.io>2020-06-15 15:59:15 +0200
committerLaszlo Agocs <laszlo.agocs@qt.io>2020-06-16 09:39:12 +0200
commit0d43e21429ee23442ec3a99f641a5665d66e75e2 (patch)
tree73a96cc1abdbb402bc3108d87b4daa6fd15c97d5 /src/quick
parentc27a47d0d826c3f5833407a07dbcfee613b3ace5 (diff)
QQuickWindow: Remove (set)ClearBeforeRendering
The doc update reveals that this setting has been ignored with the RHI always, and there is no plans (or ways) to support this. As the beforeRenderPassRecording() signal documents, connecting to that signal is effectively an alternative to disabling clearing the color buffer. (because it allows the application to execute custom GL or other calls after the clear but before the rest of Qt Quick's rendering) Therefore, remove the clearBeforeRendering flag from Qt 6. [ChangeLog][Qt Quick][QQuickWindow] setClearBeforeRendering() and clearBeforeRendering() are removed. Change-Id: I6a0a6f56552331923f2e07390e2f33f58c6c31e0 Reviewed-by: Andy Nichols <andy.nichols@qt.io>
Diffstat (limited to 'src/quick')
-rw-r--r--src/quick/items/qquickwindow.cpp48
-rw-r--r--src/quick/items/qquickwindow.h3
-rw-r--r--src/quick/items/qquickwindow_p.h2
3 files changed, 5 insertions, 48 deletions
diff --git a/src/quick/items/qquickwindow.cpp b/src/quick/items/qquickwindow.cpp
index 1446b541a1..22d99be2c0 100644
--- a/src/quick/items/qquickwindow.cpp
+++ b/src/quick/items/qquickwindow.cpp
@@ -593,9 +593,10 @@ void QQuickWindowPrivate::syncSceneGraph()
// Copy the current state of clearing from window into renderer.
renderer->setClearColor(clearColor);
- QSGAbstractRenderer::ClearMode mode = QSGAbstractRenderer::ClearStencilBuffer | QSGAbstractRenderer::ClearDepthBuffer;
- if (clearBeforeRendering)
- mode |= QSGAbstractRenderer::ClearColorBuffer;
+ // Cannot skip clearing the color buffer in Qt 6 anymore.
+ const QSGAbstractRenderer::ClearMode mode = QSGAbstractRenderer::ClearColorBuffer
+ | QSGAbstractRenderer::ClearStencilBuffer
+ | QSGAbstractRenderer::ClearDepthBuffer;
renderer->setClearMode(mode);
renderer->setVisualizationMode(visualizationMode);
@@ -742,7 +743,6 @@ QQuickWindowPrivate::QQuickWindowPrivate()
, renderControl(nullptr)
, pointerEventRecursionGuard(0)
, clearColor(Qt::white)
- , clearBeforeRendering(true)
, persistentGraphics(true)
, persistentSceneGraph(true)
, lastWheelEventAccepted(false)
@@ -4667,43 +4667,6 @@ QQmlIncubationController *QQuickWindow::incubationController() const
*/
/*!
- Sets whether the scene graph rendering of QML should clear the color buffer
- before it starts rendering to \a enabled.
-
- By disabling clearing of the color buffer, it is possible to render OpengGL content
- under the scene graph.
-
- The color buffer is cleared by default.
-
- \warning As of Qt 6.0, setting \a enabled to false has no effect. As
- explicit clear commands do not exist in some modern APIs, the scene graph
- cannot offer this flexibility anymore. The images associated with a render
- target will always get cleared when a render pass starts. As a solution, an
- alternative to disabling scene graph issued clears is provided in form of
- the beforeRenderPassRecording() signal.
-
- \sa beforeRendering(), beforeRenderPassRecording()
- */
-
-void QQuickWindow::setClearBeforeRendering(bool enabled)
-{
- Q_D(QQuickWindow);
- d->clearBeforeRendering = enabled;
-}
-
-
-
-/*!
- Returns whether clearing of the color buffer is done before rendering or not.
- */
-
-bool QQuickWindow::clearBeforeRendering() const
-{
- Q_D(const QQuickWindow);
- return d->clearBeforeRendering;
-}
-
-/*!
\overload
*/
@@ -4862,10 +4825,9 @@ QSGTexture *QQuickWindow::createTextureFromNativeObject(NativeObjectType type,
\property QQuickWindow::color
\brief The color used to clear the color buffer at the beginning of each frame.
- Setting the clear color has no effect when clearing is disabled.
By default, the clear color is white.
- \sa setClearBeforeRendering(), setDefaultAlphaBuffer()
+ \sa setDefaultAlphaBuffer()
*/
void QQuickWindow::setColor(const QColor &color)
diff --git a/src/quick/items/qquickwindow.h b/src/quick/items/qquickwindow.h
index 132030cc61..972d44b1c3 100644
--- a/src/quick/items/qquickwindow.h
+++ b/src/quick/items/qquickwindow.h
@@ -161,9 +161,6 @@ public:
const QSize &size,
CreateTextureOptions options = CreateTextureOption()) const;
- void setClearBeforeRendering(bool enabled);
- bool clearBeforeRendering() const;
-
void setColor(const QColor &color);
QColor color() const;
diff --git a/src/quick/items/qquickwindow_p.h b/src/quick/items/qquickwindow_p.h
index beb7e00f15..2310367631 100644
--- a/src/quick/items/qquickwindow_p.h
+++ b/src/quick/items/qquickwindow_p.h
@@ -274,8 +274,6 @@ public:
QColor clearColor;
- uint clearBeforeRendering : 1;
-
uint persistentGraphics : 1;
uint persistentSceneGraph : 1;