summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--services/surfaceflinger/Layer.cpp10
-rw-r--r--services/surfaceflinger/Layer.h2
2 files changed, 11 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);
}
diff --git a/services/surfaceflinger/Layer.h b/services/surfaceflinger/Layer.h
index d30961aab6..5e85ebecee 100644
--- a/services/surfaceflinger/Layer.h
+++ b/services/surfaceflinger/Layer.h
@@ -841,6 +841,8 @@ protected:
// 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:
/**