CE: Update layer composition state outside of CE
First step in breaking CE dependencies with frontend.
FE should provide a snapshot of the state for CE to
consume. This cl updates the composition state
based on whether visible regions are dirty before
calling into composition engine.
Test: presubmit
Test: go/wm-smoke
Bug: 238781169
Change-Id: I6efd71cf66d9e1cae163c98ad4ce3097e09848af
diff --git a/services/surfaceflinger/CompositionEngine/src/CompositionEngine.cpp b/services/surfaceflinger/CompositionEngine/src/CompositionEngine.cpp
index 6203dc6..855507e 100644
--- a/services/surfaceflinger/CompositionEngine/src/CompositionEngine.cpp
+++ b/services/surfaceflinger/CompositionEngine/src/CompositionEngine.cpp
@@ -105,8 +105,6 @@
}
}
- updateLayerStateFromFE(args);
-
for (const auto& output : args.outputs) {
output->present(args);
}
@@ -119,8 +117,6 @@
for (const auto& output : args.outputs) {
for (auto* layer : output->getOutputLayersOrderedByZ()) {
if (layer->isHardwareCursor()) {
- // Latch the cursor composition state from each front-end layer.
- layer->getLayerFE().prepareCompositionState(LayerFE::StateSubset::Cursor);
layer->writeCursorPositionToHWC();
}
}
@@ -136,7 +132,7 @@
mRefreshStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
for (auto& layer : args.layers) {
- if (layer->onPreComposition(mRefreshStartTime)) {
+ if (layer->onPreComposition(mRefreshStartTime, args.updatingOutputGeometryThisFrame)) {
needsAnotherUpdate = true;
}
}
@@ -152,12 +148,5 @@
mNeedsAnotherUpdate = value;
}
-void CompositionEngine::updateLayerStateFromFE(CompositionRefreshArgs& args) {
- // Update the composition state from each front-end layer
- for (const auto& output : args.outputs) {
- output->updateLayerStateFromFE(args);
- }
-}
-
} // namespace impl
} // namespace android::compositionengine
diff --git a/services/surfaceflinger/CompositionEngine/src/Output.cpp b/services/surfaceflinger/CompositionEngine/src/Output.cpp
index b5894cf..e3f3680 100644
--- a/services/surfaceflinger/CompositionEngine/src/Output.cpp
+++ b/services/surfaceflinger/CompositionEngine/src/Output.cpp
@@ -501,7 +501,6 @@
// appear on multiple outputs.
if (!coverage.latchedLayers.count(layerFE)) {
coverage.latchedLayers.insert(layerFE);
- layerFE->prepareCompositionState(compositionengine::LayerFE::StateSubset::BasicGeometry);
}
// Only consider the layers on this output
@@ -725,14 +724,6 @@
// The base class does nothing with this call.
}
-void Output::updateLayerStateFromFE(const CompositionRefreshArgs& args) const {
- for (auto* layer : getOutputLayersOrderedByZ()) {
- layer->getLayerFE().prepareCompositionState(
- args.updatingGeometryThisFrame ? LayerFE::StateSubset::GeometryAndContent
- : LayerFE::StateSubset::Content);
- }
-}
-
void Output::updateCompositionState(const compositionengine::CompositionRefreshArgs& refreshArgs) {
ATRACE_CALL();
ALOGV(__FUNCTION__);