summaryrefslogtreecommitdiff
path: root/services/surfaceflinger/LayerProtoHelper.cpp
diff options
context:
space:
mode:
author Android Build Coastguard Worker <android-build-coastguard-worker@google.com> 2025-03-21 20:19:16 -0700
committer Android Build Coastguard Worker <android-build-coastguard-worker@google.com> 2025-03-21 20:19:16 -0700
commitac284d4683e194b7a05800cf7fbd682972699faa (patch)
tree127a5fbd6bcbdf2c0c82207671a2b38c26c4991d /services/surfaceflinger/LayerProtoHelper.cpp
parenta105c7bcfb6281b65d0384cf07a774a8235836fc (diff)
parent520d8fcb8aa54289f2272369d3040635c2fbd4bd (diff)
Snap for 13256841 from 520d8fcb8aa54289f2272369d3040635c2fbd4bd to 25Q2-release
Change-Id: If86b3c2a4136267c7ea448cd178eb8744a9643fd
Diffstat (limited to 'services/surfaceflinger/LayerProtoHelper.cpp')
-rw-r--r--services/surfaceflinger/LayerProtoHelper.cpp23
1 files changed, 9 insertions, 14 deletions
diff --git a/services/surfaceflinger/LayerProtoHelper.cpp b/services/surfaceflinger/LayerProtoHelper.cpp
index 84b1a73e0b..280d66e12a 100644
--- a/services/surfaceflinger/LayerProtoHelper.cpp
+++ b/services/surfaceflinger/LayerProtoHelper.cpp
@@ -278,10 +278,9 @@ LayerProtoFromSnapshotGenerator& LayerProtoFromSnapshotGenerator::with(
stackIdsToSkip.find(child->getLayer()->layerStack.id) != stackIdsToSkip.end()) {
continue;
}
- frontend::LayerHierarchy::ScopedAddToTraversalPath addChildToPath(path,
- child->getLayer()->id,
- variant);
- LayerProtoFromSnapshotGenerator::writeHierarchyToProto(*child, path);
+ LayerProtoFromSnapshotGenerator::writeHierarchyToProto(*child,
+ path.makeChild(child->getLayer()->id,
+ variant));
}
// fill in relative and parent info
@@ -338,7 +337,8 @@ LayerProtoFromSnapshotGenerator& LayerProtoFromSnapshotGenerator::withOffscreenL
}
frontend::LayerSnapshot* LayerProtoFromSnapshotGenerator::getSnapshot(
- frontend::LayerHierarchy::TraversalPath& path, const frontend::RequestedLayerState& layer) {
+ const frontend::LayerHierarchy::TraversalPath& path,
+ const frontend::RequestedLayerState& layer) {
frontend::LayerSnapshot* snapshot = mSnapshotBuilder.getSnapshot(path);
if (snapshot) {
return snapshot;
@@ -349,7 +349,7 @@ frontend::LayerSnapshot* LayerProtoFromSnapshotGenerator::getSnapshot(
}
void LayerProtoFromSnapshotGenerator::writeHierarchyToProto(
- const frontend::LayerHierarchy& root, frontend::LayerHierarchy::TraversalPath& path) {
+ const frontend::LayerHierarchy& root, const frontend::LayerHierarchy::TraversalPath& path) {
using Variant = frontend::LayerHierarchy::Variant;
perfetto::protos::LayerProto* layerProto = mLayersProto.add_layers();
const frontend::RequestedLayerState& layer = *root.getLayer();
@@ -362,10 +362,8 @@ void LayerProtoFromSnapshotGenerator::writeHierarchyToProto(
LayerProtoHelper::writeSnapshotToProto(layerProto, layer, *snapshot, mTraceFlags);
for (const auto& [child, variant] : root.mChildren) {
- frontend::LayerHierarchy::ScopedAddToTraversalPath addChildToPath(path,
- child->getLayer()->id,
- variant);
- frontend::LayerSnapshot* childSnapshot = getSnapshot(path, layer);
+ frontend::LayerSnapshot* childSnapshot =
+ getSnapshot(path.makeChild(child->getLayer()->id, variant), layer);
if (variant == Variant::Attached || variant == Variant::Detached ||
frontend::LayerHierarchy::isMirror(variant)) {
mChildToParent[childSnapshot->uniqueSequence] = snapshot->uniqueSequence;
@@ -388,10 +386,7 @@ void LayerProtoFromSnapshotGenerator::writeHierarchyToProto(
if (variant == Variant::Detached) {
continue;
}
- frontend::LayerHierarchy::ScopedAddToTraversalPath addChildToPath(path,
- child->getLayer()->id,
- variant);
- writeHierarchyToProto(*child, path);
+ writeHierarchyToProto(*child, path.makeChild(child->getLayer()->id, variant));
}
}