SF: Clear layers properly doing client composition
When performing client composition, layers that are set to use device
composition should clear the client composition framebuffer unless they
are the bottom most layer.
This regressed when I moved the code to CompositionEngine, and I caught
it while adding a unit test.
The expected behavior is now covered by a new test.
Bug: 121291683
Test: atest libcompositionengine_test
Test: YouTube, Twitch PiP on crosshatch
Change-Id: Id0db7b0d21afadc331d9b42dadef1d90a989389e
diff --git a/services/surfaceflinger/CompositionEngine/src/Output.cpp b/services/surfaceflinger/CompositionEngine/src/Output.cpp
index e4404bf..2483c06 100644
--- a/services/surfaceflinger/CompositionEngine/src/Output.cpp
+++ b/services/surfaceflinger/CompositionEngine/src/Output.cpp
@@ -432,7 +432,7 @@
clientComposition ? clearRegion : dummyRegion,
};
if (auto result = layerFE.prepareClientComposition(targetSettings)) {
- if (clearClientComposition) {
+ if (!clientComposition) {
auto& layerSettings = *result;
layerSettings.source.buffer.buffer = nullptr;
layerSettings.source.solidColor = half3(0.0, 0.0, 0.0);