Use CompositingStrategy.ModulateAlpha when fading elements

This CL switches the compositionStrategy of elements to ModulateAlpha
when fading the elements. While this will not always lead to the most
correct result visually if the UI has overlapping rendering (which it
should not in SysUI case), it leads to much better performance.

In a follow-up CL, I will add a way to change the compositionStrategy
for cases where there is overlapping rendering.

Bug: 291071158
Test: PlatformComposeSceneTransitionLayoutTests
Flag: N/A
Change-Id: I96a4457cba36d0fbd1d15861ea1571e74cfa7d77
diff --git a/packages/SystemUI/compose/scene/src/com/android/compose/animation/scene/Element.kt b/packages/SystemUI/compose/scene/src/com/android/compose/animation/scene/Element.kt
index a910bca..e40f6b6 100644
--- a/packages/SystemUI/compose/scene/src/com/android/compose/animation/scene/Element.kt
+++ b/packages/SystemUI/compose/scene/src/com/android/compose/animation/scene/Element.kt
@@ -26,6 +26,7 @@
 import androidx.compose.ui.geometry.Offset
 import androidx.compose.ui.geometry.isUnspecified
 import androidx.compose.ui.geometry.lerp
+import androidx.compose.ui.graphics.CompositingStrategy
 import androidx.compose.ui.graphics.drawscope.ContentDrawScope
 import androidx.compose.ui.graphics.drawscope.scale
 import androidx.compose.ui.layout.IntermediateMeasureScope
@@ -473,7 +474,8 @@
             placeable.place(offset)
         } else {
             placeable.placeWithLayer(offset) {
-                this.alpha = elementAlpha(layoutImpl, element, scene)
+                alpha = elementAlpha(layoutImpl, element, scene)
+                compositingStrategy = CompositingStrategy.ModulateAlpha
             }
         }
     }