SF: Restructure OutputLayer creation to remove displayId argument
The existing code was explicitly passing the displayId when creating an
OutputLayer, so that a HWC2::Layer could be created if applicable.
This patch makes a quick adjustment to the code so that the
compositionengine::Display instance overrides the base createOutputLayer
logic to create the HWC2::Layer, as it knows the displayId itself.
This is a minor cleanup prior to moving computeVisibleLayers to the
Output class.
Test: atest libsurfaceflinger_unittest libcompositionengine_test
Test: go/wm-smoke
Bug: 121291683
Change-Id: Ic7224ba445084b833b8c344436397372b2153d42
diff --git a/services/surfaceflinger/CompositionEngine/tests/OutputTest.cpp b/services/surfaceflinger/CompositionEngine/tests/OutputTest.cpp
index 70d9871..10ec1ee 100644
--- a/services/surfaceflinger/CompositionEngine/tests/OutputTest.cpp
+++ b/services/surfaceflinger/CompositionEngine/tests/OutputTest.cpp
@@ -429,7 +429,7 @@
// If there is no OutputLayer corresponding to the input layer, a
// new OutputLayer is constructed and returned.
EXPECT_CALL(*existingOutputLayer, getLayer()).WillOnce(ReturnRef(otherLayer));
- auto result = mOutput.getOrCreateOutputLayer(std::nullopt, layer, layerFE);
+ auto result = mOutput.getOrCreateOutputLayer(layer, layerFE);
EXPECT_NE(existingOutputLayer, result.get());
EXPECT_TRUE(result.get() != nullptr);
EXPECT_EQ(layer.get(), &result->getLayer());
@@ -445,7 +445,7 @@
// If there is an existing OutputLayer for the requested layer, an owned
// pointer is returned
EXPECT_CALL(*existingOutputLayer, getLayer()).WillOnce(ReturnRef(*layer));
- auto result = mOutput.getOrCreateOutputLayer(std::nullopt, layer, layerFE);
+ auto result = mOutput.getOrCreateOutputLayer(layer, layerFE);
EXPECT_EQ(existingOutputLayer, result.get());
// The corresponding entry in the ordered array should be cleared.