Reintroduce the QSGTextureProvider as a separate object
authorGunnar Sletta <gunnar.sletta@nokia.com>
Mon, 22 Aug 2011 07:25:51 +0000 (09:25 +0200)
committerKim M. Kalland <kim.kalland@nokia.com>
Mon, 22 Aug 2011 10:16:26 +0000 (12:16 +0200)
commitf1a9c5e4f4031921f8ae3ec32512bfc9971a97da
tree720b5f145854a8fa15f6b9693b119403f828c228
parent8be12e2ac7937ad21ec30cb335d5733735887117
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 <qt_sanity_bot@ovi.com>
Reviewed-by: Kim M. Kalland <kim.kalland@nokia.com>
13 files changed:
src/declarative/items/qsgcanvas.cpp
src/declarative/items/qsgimage.cpp
src/declarative/items/qsgimage_p.h
src/declarative/items/qsgimage_p_p.h
src/declarative/items/qsgshadereffect.cpp
src/declarative/items/qsgshadereffect_p.h
src/declarative/items/qsgshadereffectnode.cpp
src/declarative/items/qsgshadereffectnode_p.h
src/declarative/items/qsgshadereffectsource.cpp
src/declarative/items/qsgshadereffectsource_p.h
src/declarative/particles/qsgcustomparticle.cpp
src/declarative/scenegraph/util/qsgtextureprovider.cpp
src/declarative/scenegraph/util/qsgtextureprovider_p.h