aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/items/qquickrendercontrol.cpp
diff options
context:
space:
mode:
authorDominik Holland <dominik.holland@pelagicore.com>2017-03-02 15:25:07 +0100
committerDominik Holland <dominik.holland@pelagicore.com>2017-06-16 06:59:04 +0000
commiteeb320bbd8763f3e72f79369cc3908e999a0da3c (patch)
treec0dedd87c84fc5f6e943d5efc121c20ec4ee27c2 /src/quick/items/qquickrendercontrol.cpp
parentd2bb2e202427ebae545a408f065c893f3d837061 (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/items/qquickrendercontrol.cpp')
-rw-r--r--src/quick/items/qquickrendercontrol.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/quick/items/qquickrendercontrol.cpp b/src/quick/items/qquickrendercontrol.cpp
index f2828bbedd..7e995936af 100644
--- a/src/quick/items/qquickrendercontrol.cpp
+++ b/src/quick/items/qquickrendercontrol.cpp
@@ -284,6 +284,7 @@ bool QQuickRenderControl::sync()
QQuickWindowPrivate *cd = QQuickWindowPrivate::get(d->window);
cd->syncSceneGraph();
+ d->rc->endSync();
// TODO: find out if the sync actually caused a scenegraph update.
return true;
@@ -383,6 +384,7 @@ QImage QQuickRenderControl::grab()
QQuickWindowPrivate *cd = QQuickWindowPrivate::get(d->window);
cd->polishItems();
cd->syncSceneGraph();
+ d->rc->endSync();
render();
grabContent = qt_gl_read_framebuffer(d->window->size() * d->window->effectiveDevicePixelRatio(), false, false);
if (QQuickRenderControl::renderWindowFor(d->window)) {
@@ -402,6 +404,7 @@ QImage QQuickRenderControl::grab()
softwareRenderer->markDirty();
cd->polishItems();
cd->syncSceneGraph();
+ d->rc->endSync();
render();
softwareRenderer->setCurrentPaintDevice(prevDev);
}