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/SurfaceFlinger.cpp b/services/surfaceflinger/SurfaceFlinger.cpp
index 6d853f9..9479cb6 100644
--- a/services/surfaceflinger/SurfaceFlinger.cpp
+++ b/services/surfaceflinger/SurfaceFlinger.cpp
@@ -2899,10 +2899,7 @@
return;
}
- const auto displayId = displayDevice->getId();
-
- outLayersSortedByZ.emplace_back(
- display->getOrCreateOutputLayer(displayId, compositionLayer, layerFE));
+ outLayersSortedByZ.emplace_back(display->getOrCreateOutputLayer(compositionLayer, layerFE));
auto& outputLayerState = outLayersSortedByZ.back()->editState();
outputLayerState.visibleRegion = std::move(visibleRegion);
outputLayerState.visibleNonTransparentRegion = std::move(visibleNonTransparentRegion);