Add layer name to layer_state_t and SurfaceControl
This information will be used in subsequent CLs to trace layer cache events.
Bug: 244218818
Test: presubmits
Change-Id: I98bcd97310e3a2f061994481911073e8a1545cab
diff --git a/services/surfaceflinger/tests/InvalidHandles_test.cpp b/services/surfaceflinger/tests/InvalidHandles_test.cpp
index 741b6f7..666ce76 100644
--- a/services/surfaceflinger/tests/InvalidHandles_test.cpp
+++ b/services/surfaceflinger/tests/InvalidHandles_test.cpp
@@ -48,7 +48,7 @@
}
sp<SurfaceControl> makeNotSurfaceControl() {
- return sp<SurfaceControl>::make(mScc, sp<NotALayer>::make(), 1);
+ return sp<SurfaceControl>::make(mScc, sp<NotALayer>::make(), 1, "#1");
}
};
diff --git a/services/surfaceflinger/tests/unittests/TestableSurfaceFlinger.h b/services/surfaceflinger/tests/unittests/TestableSurfaceFlinger.h
index cff529c..2e90c7e 100644
--- a/services/surfaceflinger/tests/unittests/TestableSurfaceFlinger.h
+++ b/services/surfaceflinger/tests/unittests/TestableSurfaceFlinger.h
@@ -463,16 +463,14 @@
mFlinger->onActiveDisplayChangedLocked(activeDisplay);
}
- auto createLayer(LayerCreationArgs& args, sp<IBinder>* outHandle,
- const sp<IBinder>& parentHandle, int32_t* outLayerId,
- const sp<Layer>& parentLayer, uint32_t* outTransformHint) {
- return mFlinger->createLayer(args, outHandle, parentHandle, outLayerId, parentLayer,
- outTransformHint);
+ auto createLayer(LayerCreationArgs& args, const sp<IBinder>& parentHandle,
+ gui::CreateSurfaceResult& outResult) {
+ return mFlinger->createLayer(args, parentHandle, outResult);
}
auto mirrorLayer(const LayerCreationArgs& args, const sp<IBinder>& mirrorFromHandle,
- sp<IBinder>* outHandle, int32_t* outLayerId) {
- return mFlinger->mirrorLayer(args, mirrorFromHandle, outHandle, outLayerId);
+ gui::CreateSurfaceResult& outResult) {
+ return mFlinger->mirrorLayer(args, mirrorFromHandle, outResult);
}
void updateLayerMetadataSnapshot() { mFlinger->updateLayerMetadataSnapshot(); }
diff --git a/services/surfaceflinger/tests/unittests/TransactionProtoParserTest.cpp b/services/surfaceflinger/tests/unittests/TransactionProtoParserTest.cpp
index 1f011be..14e1aac 100644
--- a/services/surfaceflinger/tests/unittests/TransactionProtoParserTest.cpp
+++ b/services/surfaceflinger/tests/unittests/TransactionProtoParserTest.cpp
@@ -49,7 +49,8 @@
ComposerState s;
if (i == 1) {
layer.parentSurfaceControlForChild =
- sp<SurfaceControl>::make(SurfaceComposerClient::getDefault(), layerHandle, 42);
+ sp<SurfaceControl>::make(SurfaceComposerClient::getDefault(), layerHandle, 42,
+ "#42");
}
s.state = layer;
t1.states.add(s);