diff options
| author | 2019-01-28 18:13:27 -0800 | |
|---|---|---|
| committer | 2019-01-28 18:18:38 -0800 | |
| commit | 1323c9525fbe7a70b40be9258fe39d254574e3cc (patch) | |
| tree | 3008c90880375c54b521eec7d7ed5175d2b1ab05 /services/surfaceflinger/Layer.cpp | |
| parent | e1f12b08644bc73066e7e2a406c952a20cff0d0a (diff) | |
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
Diffstat (limited to 'services/surfaceflinger/Layer.cpp')
| -rw-r--r-- | services/surfaceflinger/Layer.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/services/surfaceflinger/Layer.cpp b/services/surfaceflinger/Layer.cpp index e108d1e74d..f63d4283ce 100644 --- a/services/surfaceflinger/Layer.cpp +++ b/services/surfaceflinger/Layer.cpp @@ -1067,6 +1067,11 @@ uint32_t Layer::doTransaction(uint32_t flags) { mNeedsFiltering = (!getActiveTransform(c).preserveRects() || type >= ui::Transform::SCALE); } + if (mChildrenChanged) { + flags |= eVisibleRegion; + mChildrenChanged = false; + } + // If the layer is hidden, signal and clear out all local sync points so // that transactions for layers depending on this layer's frames becoming // visible are not blocked @@ -1571,13 +1576,16 @@ size_t Layer::getChildrenCount() const { } void Layer::addChild(const sp<Layer>& layer) { + mChildrenChanged = true; + mCurrentChildren.add(layer); layer->setParent(this); } ssize_t Layer::removeChild(const sp<Layer>& layer) { - layer->setParent(nullptr); + mChildrenChanged = true; + layer->setParent(nullptr); return mCurrentChildren.remove(layer); } |