summaryrefslogtreecommitdiff
path: root/core/java/android/view/SurfaceControl.java
diff options
context:
space:
mode:
Diffstat (limited to 'core/java/android/view/SurfaceControl.java')
-rw-r--r--core/java/android/view/SurfaceControl.java24
1 files changed, 24 insertions, 0 deletions
diff --git a/core/java/android/view/SurfaceControl.java b/core/java/android/view/SurfaceControl.java
index 3b5270960c99..ab33feae7c56 100644
--- a/core/java/android/view/SurfaceControl.java
+++ b/core/java/android/view/SurfaceControl.java
@@ -515,6 +515,15 @@ public final class SurfaceControl implements Parcelable {
public static final int ENABLE_BACKPRESSURE = 0x00000100;
/**
+ * Buffers from this SurfaceControl should be considered display decorations.
+ *
+ * If the hardware has optimizations for display decorations (e.g. rounded corners, camera
+ * cutouts, etc), it should use them for this layer.
+ * @hide
+ */
+ public static final int DISPLAY_DECORATION = 0x00000200;
+
+ /**
* Surface creation flag: Creates a surface where color components are interpreted
* as "non pre-multiplied" by their alpha channel. Of course this flag is
* meaningless for surfaces without an alpha channel. By default
@@ -3266,6 +3275,21 @@ public final class SurfaceControl implements Parcelable {
}
/**
+ * Sets whether the surface should take advantage of display decoration optimizations.
+ * @hide
+ */
+ public Transaction setDisplayDecoration(SurfaceControl sc, boolean displayDecoration) {
+ checkPreconditions(sc);
+ if (displayDecoration) {
+ nativeSetFlags(mNativeObject, sc.mNativeObject, DISPLAY_DECORATION,
+ DISPLAY_DECORATION);
+ } else {
+ nativeSetFlags(mNativeObject, sc.mNativeObject, 0, DISPLAY_DECORATION);
+ }
+ return this;
+ }
+
+ /**
* Indicates whether the surface must be considered opaque, even if its pixel format is
* set to translucent. This can be useful if an application needs full RGBA 8888 support
* for instance but will still draw every pixel opaque.