diff options
| author | Robert Carr <racarr@google.com> | 2019-01-11 13:38:19 -0800 |
|---|---|---|
| committer | Robert Carr <racarr@google.com> | 2019-01-22 09:01:05 -0800 |
| commit | 76907eeaa6ff8d669a1fbf239cd19e1cb5b2846e (patch) | |
| tree | b6898ee94cd310eb138e7b58be4aaaf71366dcd6 /core/java/android/view/Surface.java | |
| parent | 18a82199b7669680ad6c75910f29ffabc3797d3a (diff) | |
Unhide parts of SurfaceControl API in SDK.
In parity with the recently exposed NDK APIs. In addition removing @hide
we make a few changes to prepare the APIs for being public.
1. Use a hidden singleton SurfaceSession
2. Expose a Surface constructor for ANativeWindow inter-op
3. Mark SurfaceControl final
4. Implement setGeometry as public version of setPosition/matrix/crop.
5. Add a visibility toggle method (as opposed to show/hide methods) for
parity with NDK.
Bug: 111297488
Test: android.view.cts.SurfaceControlTests
Change-Id: Iac043658a360a48086ef4701a6a8ba2396878e81
Diffstat (limited to 'core/java/android/view/Surface.java')
| -rw-r--r-- | core/java/android/view/Surface.java | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/core/java/android/view/Surface.java b/core/java/android/view/Surface.java index f3cb3767ec9d..7fcb2afa48a9 100644 --- a/core/java/android/view/Surface.java +++ b/core/java/android/view/Surface.java @@ -185,6 +185,18 @@ public class Surface implements Parcelable { } /** + * Create a Surface assosciated with a given {@link SurfaceControl}. Buffers submitted to this + * surface will be displayed by the system compositor according to the parameters + * specified by the control. Multiple surfaces may be constructed from one SurfaceControl, + * but only one can be connected (e.g. have an active EGL context) at a time. + * + * @param from The SurfaceControl to assosciate this Surface with + */ + public Surface(SurfaceControl from) { + copyFrom(from); + } + + /** * Create Surface from a {@link SurfaceTexture}. * * Images drawn to the Surface will be made available to the {@link @@ -494,7 +506,6 @@ public class Surface implements Parcelable { * in to it. * * @param other {@link SurfaceControl} to copy from. - * * @hide */ @UnsupportedAppUsage |
