CE: Layers only have FE layer state
Remove the concept of having a compositionengine::Layer having internal
state since it was only used to internally store a copy of the
LayerFECompositionState. Instead switch the Layer interface so only the
FE state can be obtained. Any internal state will from now on be
private.
Doing this also allows the LayerFECompostionState to be easily extended
by extended versions of CompositionEngine.
Test: atest libsurfaceflinger_unittest libcompositionengine_test
Test: atest CtsColorModeTestCases
Test: atest CtsDisplayTestCases
Test: atest CtsGraphicsTestCases
Test: atest CtsUiRenderingTestCases
Test: atest CtsViewTestCases
Test: atest android.media.cts.EncodeVirtualDisplayWithCompositionTest
Test: go/wm-smoke
Bug: 121291683
Change-Id: I689e8714aca46320c87e0cb5ef18fdde93eb7499
diff --git a/services/surfaceflinger/CompositionEngine/src/OutputLayer.cpp b/services/surfaceflinger/CompositionEngine/src/OutputLayer.cpp
index 4eb256f..2e45953 100644
--- a/services/surfaceflinger/CompositionEngine/src/OutputLayer.cpp
+++ b/services/surfaceflinger/CompositionEngine/src/OutputLayer.cpp
@@ -18,8 +18,8 @@
#include <compositionengine/DisplayColorProfile.h>
#include <compositionengine/Layer.h>
#include <compositionengine/LayerFE.h>
+#include <compositionengine/LayerFECompositionState.h>
#include <compositionengine/Output.h>
-#include <compositionengine/impl/LayerCompositionState.h>
#include <compositionengine/impl/OutputCompositionState.h>
#include <compositionengine/impl/OutputLayer.h>
#include <compositionengine/impl/OutputLayerCompositionState.h>
@@ -86,7 +86,7 @@
}
Rect OutputLayer::calculateInitialCrop() const {
- const auto& layerState = mLayer->getState().frontEnd;
+ const auto& layerState = mLayer->getFEState();
// apply the projection's clipping to the window crop in
// layerstack space, and convert-back to layer space.
@@ -119,7 +119,7 @@
}
FloatRect OutputLayer::calculateOutputSourceCrop() const {
- const auto& layerState = mLayer->getState().frontEnd;
+ const auto& layerState = mLayer->getFEState();
const auto& outputState = mOutput.getState();
if (!layerState.geomUsesSourceCrop) {
@@ -196,7 +196,7 @@
}
Rect OutputLayer::calculateOutputDisplayFrame() const {
- const auto& layerState = mLayer->getState().frontEnd;
+ const auto& layerState = mLayer->getFEState();
const auto& outputState = mOutput.getState();
// apply the layer's transform, followed by the display's global transform
@@ -243,7 +243,7 @@
}
uint32_t OutputLayer::calculateOutputRelativeBufferTransform() const {
- const auto& layerState = mLayer->getState().frontEnd;
+ const auto& layerState = mLayer->getFEState();
const auto& outputState = mOutput.getState();
/*
@@ -283,7 +283,7 @@
} // namespace impl
void OutputLayer::updateCompositionState(bool includeGeometry) {
- const auto& layerFEState = mLayer->getState().frontEnd;
+ const auto& layerFEState = mLayer->getFEState();
const auto& outputState = mOutput.getState();
const auto& profile = *mOutput.getDisplayColorProfile();
@@ -327,7 +327,7 @@
return;
}
- const auto& outputIndependentState = mLayer->getState().frontEnd;
+ const auto& outputIndependentState = mLayer->getFEState();
auto requestedCompositionType = outputIndependentState.compositionType;
if (includeGeometry) {
@@ -544,7 +544,7 @@
return;
}
- const auto& layerFEState = mLayer->getState().frontEnd;
+ const auto& layerFEState = mLayer->getFEState();
const auto& outputState = mOutput.getState();
Rect frame = layerFEState.cursorFrame;