aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp
diff options
context:
space:
mode:
authorEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>2014-10-30 09:08:00 +0100
committerEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>2014-11-04 09:12:16 +0100
commit326c4d80f2ca68b2f677e5f86570417cbca467b9 (patch)
tree679a301be3170ddcd9e38a656bcdd01f68a48ebb /src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp
parentc748f51fb42685242ce197d3948ae1429a2da98d (diff)
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>
Diffstat (limited to 'src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp')
-rw-r--r--src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp18
1 files changed, 12 insertions, 6 deletions
diff --git a/src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp b/src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp
index 838251ed08..2f94bad75d 100644
--- a/src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp
+++ b/src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp
@@ -460,12 +460,18 @@ void Updater::visitGeometryNode(Node *n)
if (e->root) {
BatchRootInfo *info = renderer->batchRootInfo(e->root);
- info->availableOrders--;
- if (info->availableOrders < 0) {
- renderer->m_rebuild |= Renderer::BuildRenderLists;
- } else {
- renderer->m_rebuild |= Renderer::BuildRenderListsForTaggedRoots;
- renderer->m_taggedRoots << e->root;
+ while (info != 0) {
+ info->availableOrders--;
+ if (info->availableOrders < 0) {
+ renderer->m_rebuild |= Renderer::BuildRenderLists;
+ } else {
+ renderer->m_rebuild |= Renderer::BuildRenderListsForTaggedRoots;
+ renderer->m_taggedRoots << e->root;
+ }
+ if (info->parentRoot != 0)
+ info = renderer->batchRootInfo(info->parentRoot);
+ else
+ info = 0;
}
} else {
renderer->m_rebuild |= Renderer::FullRebuild;