From 9dee534836092787d774be7face029b5cf53e546 Mon Sep 17 00:00:00 2001 From: VaL Doroshchuk Date: Thu, 1 Feb 2018 09:06:23 +0100 Subject: Delete textures even if one of the windows is invisible If there is an invisible window that will not be rendered but is constantly requested to render, updatePending is always set. This prevented purging of already unneeded textures, and meant endSync() was never called and m_texturesToDelete was never cleared. Added a fix to clear the updatePending flag regardless of visibility. Task-number: QTBUG-66116 Change-Id: Ib8bf453a3dee18d3d43342580c619664b701acae Reviewed-by: Shawn Rutledge --- src/quick/scenegraph/qsgrenderloop.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/quick/scenegraph/qsgrenderloop.cpp b/src/quick/scenegraph/qsgrenderloop.cpp index 2eaed497ef..05f635cf1d 100644 --- a/src/quick/scenegraph/qsgrenderloop.cpp +++ b/src/quick/scenegraph/qsgrenderloop.cpp @@ -349,11 +349,16 @@ void QSGGuiThreadRenderLoop::windowDestroyed(QQuickWindow *window) void QSGGuiThreadRenderLoop::renderWindow(QQuickWindow *window) { - QQuickWindowPrivate *cd = QQuickWindowPrivate::get(window); - if (!cd->isRenderable() || !m_windows.contains(window)) + if (!m_windows.contains(window)) return; WindowData &data = const_cast(m_windows[window]); + bool alsoSwap = data.updatePending; + data.updatePending = false; + + QQuickWindowPrivate *cd = QQuickWindowPrivate::get(window); + if (!cd->isRenderable()) + return; bool current = false; @@ -380,9 +385,6 @@ void QSGGuiThreadRenderLoop::renderWindow(QQuickWindow *window) current = gl->makeCurrent(window); } - bool alsoSwap = data.updatePending; - data.updatePending = false; - bool lastDirtyWindow = true; auto i = m_windows.constBegin(); while (i != m_windows.constEnd()) { -- cgit v1.2.3