summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRob Carr <racarr@google.com>2021-06-21 19:55:37 +0000
committerAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>2021-06-21 19:55:37 +0000
commitfb9b2542a0f341fc8f082143c7ee0f2271ad2dc0 (patch)
tree9e6bcc8dc2fbda1f3b22138c236efa8174511c0f
parenta786ade45d841e1ca01a3f1895c1b13ac413cf9d (diff)
parent0aa188a360048c8e4c35a878d9416207c67bab26 (diff)
downloadnative-fb9b2542a0f341fc8f082143c7ee0f2271ad2dc0.tar.gz
Merge "Factor our mChildrenChanged from doTransaction" into sc-dev am: 0aa188a360
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/native/+/14949463 Change-Id: I5f51c36852ab83cd2fa2b7c496599ccaecbc7767
-rw-r--r--services/surfaceflinger/Layer.cpp9
-rw-r--r--services/surfaceflinger/Layer.h3
-rw-r--r--services/surfaceflinger/SurfaceFlinger.cpp5
-rw-r--r--services/surfaceflinger/SurfaceFlinger.h7
4 files changed, 13 insertions, 11 deletions
diff --git a/services/surfaceflinger/Layer.cpp b/services/surfaceflinger/Layer.cpp
index b819dbe7ce..6c9905e7da 100644
--- a/services/surfaceflinger/Layer.cpp
+++ b/services/surfaceflinger/Layer.cpp
@@ -679,11 +679,6 @@ bool Layer::isSecure() const {
uint32_t Layer::doTransaction(uint32_t flags) {
ATRACE_CALL();
- if (mChildrenChanged) {
- flags |= eVisibleRegion;
- mChildrenChanged = false;
- }
-
// TODO: This is unfortunate.
mDrawingStateModified = mDrawingState.modified;
mDrawingState.modified = false;
@@ -1562,7 +1557,7 @@ void Layer::setGameModeForTree(int parentGameMode) {
}
void Layer::addChild(const sp<Layer>& layer) {
- mChildrenChanged = true;
+ mFlinger->mSomeChildrenChanged = true;
setTransactionFlags(eTransactionNeeded);
mCurrentChildren.add(layer);
@@ -1572,7 +1567,7 @@ void Layer::addChild(const sp<Layer>& layer) {
}
ssize_t Layer::removeChild(const sp<Layer>& layer) {
- mChildrenChanged = true;
+ mFlinger->mSomeChildrenChanged = true;
setTransactionFlags(eTransactionNeeded);
layer->setParent(nullptr);
diff --git a/services/surfaceflinger/Layer.h b/services/surfaceflinger/Layer.h
index 9b30fcb315..84d6d3f93e 100644
--- a/services/surfaceflinger/Layer.h
+++ b/services/surfaceflinger/Layer.h
@@ -1003,9 +1003,6 @@ protected:
wp<Layer> mCurrentParent;
wp<Layer> mDrawingParent;
- // Can only be accessed with the SF state lock held.
- bool mChildrenChanged{false};
-
// Window types from WindowManager.LayoutParams
const InputWindowInfo::Type mWindowType;
diff --git a/services/surfaceflinger/SurfaceFlinger.cpp b/services/surfaceflinger/SurfaceFlinger.cpp
index c6841ed6e6..26581a07ea 100644
--- a/services/surfaceflinger/SurfaceFlinger.cpp
+++ b/services/surfaceflinger/SurfaceFlinger.cpp
@@ -2942,6 +2942,11 @@ void SurfaceFlinger::handleTransactionLocked(uint32_t transactionFlags) {
});
}
+ if (mSomeChildrenChanged) {
+ mVisibleRegionsDirty = true;
+ mSomeChildrenChanged = false;
+ }
+
// Update transform hint
if (transactionFlags & (eTransformHintUpdateNeeded | eDisplayTransactionNeeded)) {
// The transform hint might have changed for some layers
diff --git a/services/surfaceflinger/SurfaceFlinger.h b/services/surfaceflinger/SurfaceFlinger.h
index 22d17eb153..81f569ae9b 100644
--- a/services/surfaceflinger/SurfaceFlinger.h
+++ b/services/surfaceflinger/SurfaceFlinger.h
@@ -1228,8 +1228,13 @@ private:
// don't need synchronization
State mDrawingState{LayerVector::StateSet::Drawing};
bool mVisibleRegionsDirty = false;
- // Set during transaction commit stage to track if the input info for a layer has changed.
+
+ // Set during transaction application stage to track if the input info or children
+ // for a layer has changed.
+ // TODO: Also move visibleRegions over to a boolean system.
bool mInputInfoChanged = false;
+ bool mSomeChildrenChanged;
+
bool mGeometryInvalid = false;
bool mAnimCompositionPending = false;