Fix disappearing nodes when adding in two levels of batch root
authorEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
Thu, 30 Oct 2014 08:08:00 +0000 (09:08 +0100)
committerEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
Tue, 4 Nov 2014 08:12:16 +0000 (09:12 +0100)
commit326c4d80f2ca68b2f677e5f86570417cbca467b9
tree679a301be3170ddcd9e38a656bcdd01f68a48ebb
parentc748f51fb42685242ce197d3948ae1429a2da98d
Fix disappearing nodes when adding in two levels of batch root

When having e.g. a clip node inside another clip node and adding
children to the innermost, we would get into the situation where
we did a partial rebuild for the outermost root, but its available
render order count would not be updated to reflect the change
deeper down in the tree. Since the z range would be based on the
outermost batch root's knowledge of the maximum render order in
the tree, what would happen is that the z of the rendered nodes
would increase steadily until they went outside of the viewing
volume and disappeared.

When decreasing the available order count of a batch root, we need
to also decrease the available order count of its parents. If any
of them drop below zero, we need to rebuild the render lists.

[ChangeLog][QtQuick] Fixed nodes sometimes disappearing when
adding many new nodes to the tree.

Change-Id: I39c34acf0e1e0e87601f0fcd983f8da38cee029f
Task-number: QTBUG-42096
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp