Trigger rebuild when xform of alpha nodes change.

When transforms change, overlaps may have changed, so we
need to rebuild all batches under the current root.

Instead of adding taggedRoots logic for rebuilding
batches only, we reuse the existing tagged roots for render
lists. This one is slightly more expensive, but for now
I believe the reduced code complexity outweights the tiny
overhead.

Change-Id: I1bd0efc18e5628f404d6d4dce38c725436e87ce5
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
This commit is contained in:
Gunnar Sletta 2013-09-06 10:35:26 +02:00 committed by The Qt Project
parent ddc8225477
commit b8dcbb12a2
1 changed files with 6 additions and 4 deletions

View File

@ -826,14 +826,16 @@ void Renderer::nodeWasTransformed(Node *node, int *vertexCount)
e->boundsComputed = false;
if (e->batch) {
if (!e->batch->isOpaque) {
e->batch->invalidate();
m_rebuild |= BuildBatches;
if (e->root) {
m_taggedRoots << e->root;
m_rebuild |= BuildRenderListsForTaggedRoots;
} else {
m_rebuild |= FullRebuild;
}
} else if (e->batch->merged) {
e->batch->needsUpload = true;
}
}
if (e->batch && e->batch->merged)
e->batch->needsUpload = true;
}
}