Factor our mChildrenChanged from doTransaction
We are trying to eliminate the whole doTransaction traversal. Following
queued-transaction changes we can update various values on flinger
directly rather than in-directing through the main-thread.
Test: Existing tests pass. simpleperf
Bug: 186200583
Change-Id: I0536f889602ce0801e9f79881bbe1adb7b163d46
diff --git a/services/surfaceflinger/Layer.cpp b/services/surfaceflinger/Layer.cpp
index b819dbe..6c9905e 100644
--- a/services/surfaceflinger/Layer.cpp
+++ b/services/surfaceflinger/Layer.cpp
@@ -679,11 +679,6 @@
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::addChild(const sp<Layer>& layer) {
- mChildrenChanged = true;
+ mFlinger->mSomeChildrenChanged = true;
setTransactionFlags(eTransactionNeeded);
mCurrentChildren.add(layer);
@@ -1572,7 +1567,7 @@
}
ssize_t Layer::removeChild(const sp<Layer>& layer) {
- mChildrenChanged = true;
+ mFlinger->mSomeChildrenChanged = true;
setTransactionFlags(eTransactionNeeded);
layer->setParent(nullptr);