[sf] optimize snapshot updates
Modify the snapshot update logic so its easier to maintain. Instead of
walking the tree and updating all the snapshots, this cl introduces a
preliminary step of walking though all the requested changes and
updating the affected snapshots by merging the changes to the snapshot.
This is followed by walking down the tree and updating properties that
are dependent on the parent snapshots.
If the changes are confined to buffer updates, then the fast path avoids
walking down the tree.
Bug: 238781169
Test: presubmit
Change-Id: Ic9aa66c376bf7ea80e38b321dd08b8d0f69559a9
diff --git a/services/surfaceflinger/LayerProtoHelper.cpp b/services/surfaceflinger/LayerProtoHelper.cpp
index 427a85c..1c7581b 100644
--- a/services/surfaceflinger/LayerProtoHelper.cpp
+++ b/services/surfaceflinger/LayerProtoHelper.cpp
@@ -428,7 +428,7 @@
layerInfo->set_is_relative_of(requestedState.isRelativeOf);
- layerInfo->set_owner_uid(requestedState.ownerUid);
+ layerInfo->set_owner_uid(requestedState.ownerUid.val());
if ((traceFlags & LayerTracing::TRACE_INPUT) && snapshot.hasInputInfo()) {
LayerProtoHelper::writeToProto(snapshot.inputInfo, {},