diff options
author | Dominik Holland <dominik.holland@pelagicore.com> | 2017-03-02 15:25:07 +0100 |
---|---|---|
committer | Dominik Holland <dominik.holland@pelagicore.com> | 2017-06-16 06:59:04 +0000 |
commit | eeb320bbd8763f3e72f79369cc3908e999a0da3c (patch) | |
tree | c0dedd87c84fc5f6e943d5efc121c20ec4ee27c2 /src/quick/scenegraph/qsgrenderloop.cpp | |
parent | d2bb2e202427ebae545a408f065c893f3d837061 (diff) |
Delay the deletion of QSGTextures until all windows are synchronized
With the 'basic' and the 'windows' render loop the scene graph
context is shared. Because of this we cannot start deleting textures
after the first window is synchronized as it may contain textures
needed by the another window, which is not yet synchronized.
QWindowPrivate::syncSceneGraph() is not calling endSync() anymore
as it doesn't know whether it is the last window or not. Instead
the renderloop is now responsible for calling endSync() once this
is safe to do.
Change-Id: Icb50ebfb447c928e38b41df7e26f3bfafdb4a811
Reviewed-by: Robert Griebl <robert.griebl@pelagicore.com>
Reviewed-by: Gunnar Sletta <gunnar@crimson.no>
Diffstat (limited to 'src/quick/scenegraph/qsgrenderloop.cpp')
-rw-r--r-- | src/quick/scenegraph/qsgrenderloop.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/quick/scenegraph/qsgrenderloop.cpp b/src/quick/scenegraph/qsgrenderloop.cpp index c27700cf84..bc65dc1bc3 100644 --- a/src/quick/scenegraph/qsgrenderloop.cpp +++ b/src/quick/scenegraph/qsgrenderloop.cpp @@ -380,6 +380,16 @@ void QSGGuiThreadRenderLoop::renderWindow(QQuickWindow *window) bool alsoSwap = data.updatePending; data.updatePending = false; + bool lastDirtyWindow = true; + auto i = m_windows.constBegin(); + while (i != m_windows.constEnd()) { + if (i.value().updatePending) { + lastDirtyWindow = false; + break; + } + i++; + } + if (!current) return; @@ -407,6 +417,8 @@ void QSGGuiThreadRenderLoop::renderWindow(QQuickWindow *window) emit window->afterAnimating(); cd->syncSceneGraph(); + if (lastDirtyWindow) + rc->endSync(); if (profileFrames) syncTime = renderTimer.nsecsElapsed(); |