From c1ea10447fcf9f050e879e49075328ccfe1b29d0 Mon Sep 17 00:00:00 2001 From: Robert Carr Date: Mon, 13 Aug 2018 13:01:47 -0700 Subject: Implement construction of container layers Expose existing native functionality. In preparation for use as bufferless-input-catching-surfaces. Bug: 80101428 Bug: 113136004 Bug: 111440400 Change-Id: I455792aec3ee58d9dd20016b484ce7c27808d522 Merged-In: I455792aec3ee58d9dd20016b484ce7c27808d522 --- core/java/android/view/SurfaceControl.java | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/core/java/android/view/SurfaceControl.java b/core/java/android/view/SurfaceControl.java index 2e98d033fa7f..66f16d57c828 100644 --- a/core/java/android/view/SurfaceControl.java +++ b/core/java/android/view/SurfaceControl.java @@ -267,6 +267,13 @@ public class SurfaceControl implements Parcelable { */ public static final int FX_SURFACE_DIM = 0x00020000; + /** + * Surface creation flag: Creates a container surface. + * This surface will have no buffers and will only be used + * as a container for other surfaces, or for its InputInfo. + */ + public static final int FX_SURFACE_CONTAINER = 0x00080000; + /** * Mask used for FX values above. * @@ -530,6 +537,23 @@ public class SurfaceControl implements Parcelable { return this; } + /** + * Indicates whether a 'ContainerLayer' is to be constructed. + * + * Container layers will not be rendered in any fashion and instead are used + * as a parent of renderable layers. + * + * @param isContainerLayer Whether to create a container layer. + */ + public Builder setContainerLayer(boolean isContainerLayer) { + if (isContainerLayer) { + mFlags |= FX_SURFACE_CONTAINER; + } else { + mFlags &= ~FX_SURFACE_CONTAINER; + } + return this; + } + /** * Set 'Surface creation flags' such as {@link HIDDEN}, {@link SECURE}. * -- cgit v1.2.3-59-g8ed1b