diff options
Diffstat (limited to 'src/quick/scenegraph/qsgrenderloop.cpp')
-rw-r--r-- | src/quick/scenegraph/qsgrenderloop.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/quick/scenegraph/qsgrenderloop.cpp b/src/quick/scenegraph/qsgrenderloop.cpp index 4a69b770ed..88899c400c 100644 --- a/src/quick/scenegraph/qsgrenderloop.cpp +++ b/src/quick/scenegraph/qsgrenderloop.cpp @@ -56,6 +56,7 @@ #include <QtQuick/QQuickWindow> #include <QtQuick/private/qquickwindow_p.h> #include <QtQuick/private/qsgcontext_p.h> +#include <QtQuick/private/qsgrenderer_p.h> #include <private/qquickprofiler_p.h> #if QT_CONFIG(opengl) @@ -152,7 +153,7 @@ public: void update(QQuickWindow *window) override { maybeUpdate(window); } // identical for this implementation. void handleUpdateRequest(QQuickWindow *) override; - void releaseResources(QQuickWindow *) override { } + void releaseResources(QQuickWindow *) override; QAnimationDriver *animationDriver() const override { return 0; } @@ -505,6 +506,14 @@ QSGContext *QSGGuiThreadRenderLoop::sceneGraphContext() const return sg; } +void QSGGuiThreadRenderLoop::releaseResources(QQuickWindow *w) +{ + // No full invalidation of the rendercontext, just clear some caches. + QQuickWindowPrivate *d = QQuickWindowPrivate::get(w); + if (d->renderer) + d->renderer->releaseCachedResources(); +} + void QSGGuiThreadRenderLoop::handleUpdateRequest(QQuickWindow *window) { renderWindow(window); |