From f1a9c5e4f4031921f8ae3ec32512bfc9971a97da Mon Sep 17 00:00:00 2001 From: Gunnar Sletta Date: Mon, 22 Aug 2011 09:25:51 +0200 Subject: Reintroduce the QSGTextureProvider as a separate object The texture provider needs to live completely in the rendering thread and needs to be selfcontained during rendering. During the items updatePaintNode() all needed state is copied into the texture provider. Texture providers have thread affinity in the rendering thread and are deleted there using deleteLater() and the added processEvents() in the rendering loop. This fixes the bug where a QSGItem is deleted as a result from an animation while the same item is being used as a texture provider in the rendering thread. There is also a small optimzation to QSGShaderEffectSource in that we don't create a paint node when the shader source is not going to be shown. Change-Id: I6b9bc1da2a0f55d3d5356d4091fd6af6a7ea6f01 Reviewed-on: http://codereview.qt.nokia.com/3293 Reviewed-by: Qt Sanity Bot Reviewed-by: Kim M. Kalland --- src/declarative/items/qsgcanvas.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/declarative/items/qsgcanvas.cpp') diff --git a/src/declarative/items/qsgcanvas.cpp b/src/declarative/items/qsgcanvas.cpp index 48ed443902..1caee4fd72 100644 --- a/src/declarative/items/qsgcanvas.cpp +++ b/src/declarative/items/qsgcanvas.cpp @@ -1963,6 +1963,9 @@ void QSGCanvasRenderThread::run() } unlock(); + + // Process any "deleteLater" objects... + QCoreApplication::processEvents(); } #ifdef THREAD_DEBUG -- cgit v1.2.3