Ensure visible regions are recomputed when children change.
Currently a reparent operation by itself may not be enough
to trigger visible region computation, leading to invalid results
on-screen. Note that reparent does not change the geometry, or the state
sequence number, this means that doTransaction does not return Layer::eVisibleRegion.
For layer addition and removal we explicitly mark the visible regions dirty (see
mLayersAdded and mLayersRemoved in SurfaceFlinger.cpp). We implement a similar model for children,
with parents setting mChildrenChanged, and consuming it in doTransaction in order
to emit an eVisibleRegion flag.
Test: Manual
Bug: 123333167
Bug: 123131546
Bug: 123285451
Change-Id: I131c814e6bde927353f78c7f62d98b0f5cd2ff73
diff --git a/services/surfaceflinger/Layer.h b/services/surfaceflinger/Layer.h
index d30961a..5e85ebe 100644
--- a/services/surfaceflinger/Layer.h
+++ b/services/surfaceflinger/Layer.h
@@ -841,6 +841,8 @@
// Can only be accessed with the SF state lock held.
bool mLayerDetached{false};
+ // Can only be accessed with the SF state lock held.
+ bool mChildrenChanged{false};
private:
/**