Merge "SF: Interleave writes to HWC with other work"
diff --git a/services/surfaceflinger/SurfaceFlinger.cpp b/services/surfaceflinger/SurfaceFlinger.cpp
index 04e7bf5..16b19e8 100644
--- a/services/surfaceflinger/SurfaceFlinger.cpp
+++ b/services/surfaceflinger/SurfaceFlinger.cpp
@@ -1852,24 +1852,13 @@
const bool updatingGeometryThisFrame = mGeometryInvalid;
mGeometryInvalid = false;
- {
- // Use a map so that we latch the state of each front-end layer once.
- std::unordered_map<compositionengine::LayerFE*, compositionengine::LayerFECompositionState*>
- uniqueVisibleLayers;
-
- // Figure out which frontend layers are being composed, and build the unique
- // set of them (and the corresponding composition layer)
- for (const auto& [token, displayDevice] : mDisplays) {
- auto display = displayDevice->getCompositionDisplay();
- for (auto& layer : display->getOutputLayersOrderedByZ()) {
- uniqueVisibleLayers.insert(std::make_pair(&layer->getLayerFE(),
- &layer->getLayer().editState().frontEnd));
- }
- }
-
- // Update the composition state from each front-end layer.
- for (auto& [layerFE, state] : uniqueVisibleLayers) {
- layerFE->latchCompositionState(*state, updatingGeometryThisFrame);
+ // Latch the frontend layer composition state for each layer being
+ // composed.
+ for (const auto& [token, displayDevice] : mDisplays) {
+ auto display = displayDevice->getCompositionDisplay();
+ for (auto& layer : display->getOutputLayersOrderedByZ()) {
+ layer->getLayerFE().latchCompositionState(layer->getLayer().editState().frontEnd,
+ updatingGeometryThisFrame);
}
}
@@ -1909,13 +1898,7 @@
// Update the composition state of the output layer, as needed
// recomputing it from the state given by the front-end layer.
layer->updateCompositionState(updatingGeometryThisFrame);
- }
- }
- for (const auto& [token, displayDevice] : mDisplays) {
- auto display = displayDevice->getCompositionDisplay();
-
- for (auto& layer : display->getOutputLayersOrderedByZ()) {
// Send the updated state to the HWC, if appropriate.
layer->writeStateToHWC(updatingGeometryThisFrame);
}