From cd4aeef88052571365d4e193a2c41e2e6d145491 Mon Sep 17 00:00:00 2001 From: Robert Carr Date: Fri, 3 Mar 2017 10:48:11 -0800 Subject: Modify SurfaceView to use SurfaceFlinger child surfaces. Here we have SurfaceView bypass the WindowManager and speak directly to SurfaceFlinger using child surfaces. We also implement some logic in the WM to handle child surfaces in various Surface replacement scenarios. For those following along in the revert Saga, this also includes the follow up CLs to the original CL. - Surface inset calculation - Animation fixes. The error causing revert was a deferTransactionUntil(-1)...-1 cast to uint, defer transaction until MAX_UINT. Bug: 28858420 Bug: 31518219 Bug: 34888808 Bug: 35588318 Bug: 35396882 Test: Existing tests still pass (except for the ones that don't and will be deleted). Change-Id: Ib37236950a1dd3c4f9f4b58fd41ef9003c0557ef --- core/java/android/view/SurfaceSession.java | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'core/java/android/view/SurfaceSession.java') diff --git a/core/java/android/view/SurfaceSession.java b/core/java/android/view/SurfaceSession.java index 3cf5af484625..b5912bc1e1c8 100644 --- a/core/java/android/view/SurfaceSession.java +++ b/core/java/android/view/SurfaceSession.java @@ -27,6 +27,7 @@ public final class SurfaceSession { private long mNativeClient; // SurfaceComposerClient* private static native long nativeCreate(); + private static native long nativeCreateScoped(long surfacePtr); private static native void nativeDestroy(long ptr); private static native void nativeKill(long ptr); @@ -35,6 +36,10 @@ public final class SurfaceSession { mNativeClient = nativeCreate(); } + public SurfaceSession(Surface root) { + mNativeClient = nativeCreateScoped(root.mNativeObject); + } + /* no user serviceable parts here ... */ @Override protected void finalize() throws Throwable { -- cgit v1.2.3