[sf] Properly update clones of clones
Relanding with the change to only update onscreen mirror
roots and cleaning up some debug logs.
When updating a cloned layer hierarchy that contains
another cloned layer hierarchy, we are dependent on
the order in which we update each hierarchy.
The inner cloned hierarchy must be updated first
otherwise the outer clone will not capture the entire
tree and some layers might be omitted from
composition.
To fix this we track all layer mirror roots. When updating
each root, we check to see if they mirror another root. If
they do mirror another root and that root has not been updated,
we update the root again at the end.
Test: repro steps in bug
Fixes: 279622227
Change-Id: I125f7c788716d59909b77a88ef4098b7cac08919
diff --git a/services/surfaceflinger/LayerRenderArea.cpp b/services/surfaceflinger/LayerRenderArea.cpp
index f6b5afc..d606cff 100644
--- a/services/surfaceflinger/LayerRenderArea.cpp
+++ b/services/surfaceflinger/LayerRenderArea.cpp
@@ -85,7 +85,7 @@
// If layer is offscreen, update mirroring info if it exists
if (mLayer->isRemovedFromCurrentState()) {
mLayer->traverse(LayerVector::StateSet::Drawing,
- [&](Layer* layer) { layer->updateMirrorInfo(); });
+ [&](Layer* layer) { layer->updateMirrorInfo({}); });
mLayer->traverse(LayerVector::StateSet::Drawing,
[&](Layer* layer) { layer->updateCloneBufferInfo(); });
}