SF: Fix layer outside of viewport test
When performing client (GPU) composition, the code checks to see if the
visible region for each layer is contained in the output viewport.
Unfortunately when moving the code to CompositionEngine, I used the
"wrong" visible region -- one that had been transformed by the output
rotation. This led to layers that should have been visible in split
screen portrait mode not being rendered, leaving a black space on the
screen.
The fix was simply to use the non-transformed visible region, as set in
the output-independent state in LayerStateFE.
Additionally as there was a lack of any unit test coverage for the
Output::composeSurfaces and Output::generateClientCompositionRequests
functions, I've added some quick basic tests, as well as a specific test
to simulate the reported regression.
Bug: 139806358
Bug: 121291683
Test: Manual test on crosshatch
Test: atest libcompositionengine_test
Change-Id: I028ef238a2e08759cf32ea2f2e27aaea32f3e89b
diff --git a/services/surfaceflinger/CompositionEngine/src/Output.cpp b/services/surfaceflinger/CompositionEngine/src/Output.cpp
index 55fdacd..e4404bf 100644
--- a/services/surfaceflinger/CompositionEngine/src/Output.cpp
+++ b/services/surfaceflinger/CompositionEngine/src/Output.cpp
@@ -402,7 +402,7 @@
const auto& layerFEState = layer->getLayer().getState().frontEnd;
auto& layerFE = layer->getLayerFE();
- const Region clip(viewportRegion.intersect(layer->getState().visibleRegion));
+ const Region clip(viewportRegion.intersect(layerFEState.geomVisibleRegion));
ALOGV("Layer: %s", layerFE.getDebugName());
if (clip.isEmpty()) {
ALOGV(" Skipping for empty clip");