From fa9e2ef3d6ece2fef67ef460cbdfca009fb330fb Mon Sep 17 00:00:00 2001 From: Vishnu Nair Date: Mon, 22 May 2023 15:10:20 -0700 Subject: [sf] Update snapshots after screenshots Screenshots can be taken for a partial hierarchy and may require some of the layers to be temporarily reparented and their geometry to be updated. Sceenshots use a copy of the layer snapshots and another instance of the composition engine to render the contents to a buffer. There was an issue where the snapshots were updated before they were copied and if the screenshot was taken during a period where there were no visible region changes (and no reason to rebuild the snapshots) we would pass invalid snapshot data when compositing to the display. With legacy frontend, its harder to split the screenshot path and the display composition path, so as a fix, update the snapshots after screenshots are taken. Bug: 282884552 Test: instrumented load to verify snapshots are updated correctly Test: repro steps in bug Change-Id: Ie778b02b57c5b1ddf0f09afe82675e04c5535ee5 --- services/surfaceflinger/LayerRenderArea.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'services/surfaceflinger/LayerRenderArea.cpp') diff --git a/services/surfaceflinger/LayerRenderArea.cpp b/services/surfaceflinger/LayerRenderArea.cpp index d606cffe40..51d4ff854f 100644 --- a/services/surfaceflinger/LayerRenderArea.cpp +++ b/services/surfaceflinger/LayerRenderArea.cpp @@ -116,6 +116,8 @@ void LayerRenderArea::render(std::function drawLayers) { mLayer->setChildrenDrawingParent(mLayer); } } + mLayer->updateSnapshot(/*updateGeometry=*/true); + mLayer->updateChildrenSnapshots(/*updateGeometry=*/true); } } // namespace android -- cgit v1.2.3-59-g8ed1b