diff options
| author | Vishnu Nair <vishnun@google.com> | 2020-02-14 12:56:37 -0800 |
|---|---|---|
| committer | Vishnu Nair <vishnun@google.com> | 2020-02-14 21:36:10 +0000 |
| commit | fd6fb6746614c01d35ddb0a3af15f898b2ab4499 (patch) | |
| tree | c5f70fa2649ed59ac6cef28edde168b82151abf1 /core/java/android/view/SurfaceControl.java | |
| parent | 62709b5a8e595a3cb706ae937b3b09c515244acc (diff) | |
Draw shadows in root task instead of leaf task and use EffectLayer to draw shadows
Temporarily disable compositor shadows for freeform until root task has the correct/non-fullscreen bounds.
Fixes: 148807641
Test: adb shell settings put global render_shadows_in_compositor 1
Test: go/wm-smoke
Change-Id: I10371d2a2977bc4d10204d3cf4b052da5165e0e6
Diffstat (limited to 'core/java/android/view/SurfaceControl.java')
| -rw-r--r-- | core/java/android/view/SurfaceControl.java | 28 |
1 files changed, 19 insertions, 9 deletions
diff --git a/core/java/android/view/SurfaceControl.java b/core/java/android/view/SurfaceControl.java index fe9e36e53cd8..5dd61430f362 100644 --- a/core/java/android/view/SurfaceControl.java +++ b/core/java/android/view/SurfaceControl.java @@ -321,14 +321,12 @@ public final class SurfaceControl implements Parcelable { public static final int FX_SURFACE_NORMAL = 0x00000000; /** - * Surface creation flag: Creates a Dim surface. - * Everything behind this surface is dimmed by the amount specified - * in {@link Transaction#setAlpha(SurfaceControl, float)}. It is an error to lock a Dim - * surface, since it doesn't have a backing store. + * Surface creation flag: Creates a effect surface which + * represents a solid color and or shadows. * * @hide */ - public static final int FX_SURFACE_DIM = 0x00020000; + public static final int FX_SURFACE_EFFECT = 0x00020000; /** * Surface creation flag: Creates a container surface. @@ -739,11 +737,11 @@ public final class SurfaceControl implements Parcelable { */ public Builder setColorLayer() { unsetBufferSize(); - return setFlags(FX_SURFACE_DIM, FX_SURFACE_MASK); + return setFlags(FX_SURFACE_EFFECT, FX_SURFACE_MASK); } private boolean isColorLayerSet() { - return (mFlags & FX_SURFACE_DIM) == FX_SURFACE_DIM; + return (mFlags & FX_SURFACE_EFFECT) == FX_SURFACE_EFFECT; } /** @@ -2075,6 +2073,7 @@ public final class SurfaceControl implements Parcelable { private final ArrayMap<SurfaceControl, Point> mResizedSurfaces = new ArrayMap<>(); Runnable mFreeNativeResources; + private static final float[] INVALID_COLOR = {-1, -1, -1}; /** * @hide @@ -2530,8 +2529,9 @@ public final class SurfaceControl implements Parcelable { } /** - * Sets a color for the Surface. - * @param color A float array with three values to represent r, g, b in range [0..1] + * Fills the surface with the specified color. + * @param color A float array with three values to represent r, g, b in range [0..1]. An + * invalid color will remove the color fill. * @hide */ @UnsupportedAppUsage @@ -2542,6 +2542,16 @@ public final class SurfaceControl implements Parcelable { } /** + * Removes color fill. + * @hide + */ + public Transaction unsetColor(SurfaceControl sc) { + checkPreconditions(sc); + nativeSetColor(mNativeObject, sc.mNativeObject, INVALID_COLOR); + return this; + } + + /** * Sets the security of the surface. Setting the flag is equivalent to creating the * Surface with the {@link #SECURE} flag. * @hide |
