Draw shadows when the casting layer is occluded or transparent

Ignore transparent region when generating the composition layer for shadows. Client may
provide transparent region hints but the shadow should be drawn over the entire layer.
Solves an issue with YouTube in PiP which sets a transparent region where the
SurfaceView is shown causing a shadow of incorrect size to be drawn.

Draw shadows even if the layer is completely occluded by another layer. The layer will
not be composed in this case causing the shadow to not be drawn either. So extend its
visible region by the shadow length so we can check if the shadows will be occluded as
well.

Bug: 136561771
Test: atest libcompositionengine_test
Test: manual tests with pip overriding shadows to be drawn by sf
Change-Id: I4c6cae1716caebe46119ebd1643d8b5e3eda56c3
diff --git a/services/surfaceflinger/CompositionEngine/src/OutputLayerCompositionState.cpp b/services/surfaceflinger/CompositionEngine/src/OutputLayerCompositionState.cpp
index ad668b6..cc3c54c 100644
--- a/services/surfaceflinger/CompositionEngine/src/OutputLayerCompositionState.cpp
+++ b/services/surfaceflinger/CompositionEngine/src/OutputLayerCompositionState.cpp
@@ -51,6 +51,9 @@
     dumpVal(out, "output visibleRegion", outputSpaceVisibleRegion);
 
     out.append("      ");
+    dumpVal(out, "shadowRegion", shadowRegion);
+
+    out.append("      ");
     dumpVal(out, "forceClientComposition", forceClientComposition);
     dumpVal(out, "clearClientTarget", clearClientTarget);
     dumpVal(out, "displayFrame", displayFrame);