Loading core/java/android/view/Surface.java +16 −12 Original line number Diff line number Diff line Loading @@ -39,7 +39,6 @@ public class Surface implements Parcelable { private native void nativeUnlockCanvasAndPost(int nativeObject, Canvas canvas); private static native void nativeRelease(int nativeObject); private static native void nativeDestroy(int nativeObject); private static native boolean nativeIsValid(int nativeObject); private static native boolean nativeIsConsumerRunningBehind(int nativeObject); private static native int nativeCopyFrom(int nativeObject, int surfaceControlNativeObject); Loading Loading @@ -106,7 +105,6 @@ public class Surface implements Parcelable { * @hide */ public Surface() { mCloseGuard.open("release"); } /** Loading Loading @@ -135,6 +133,7 @@ public class Surface implements Parcelable { mCloseGuard.open("release"); } /* called from android_view_Surface_createFromIGraphicBufferProducer() */ private Surface(int nativeObject) { mNativeObject = nativeObject; mCloseGuard.open("release"); Loading @@ -146,9 +145,7 @@ public class Surface implements Parcelable { if (mCloseGuard != null) { mCloseGuard.warnIfOpen(); } if (mNativeObject != 0) { nativeRelease(mNativeObject); } release(); } finally { super.finalize(); } Loading @@ -175,12 +172,7 @@ public class Surface implements Parcelable { * @hide */ public void destroy() { if (mNativeObject != 0) { nativeDestroy(mNativeObject); mNativeObject = 0; mGenerationId++; } mCloseGuard.close(); release(); } /** Loading Loading @@ -287,6 +279,10 @@ public class Surface implements Parcelable { "SurfaceControl native object is null. Are you using a released SurfaceControl?"); } mNativeObject = nativeCopyFrom(mNativeObject, other.mNativeObject); if (mNativeObject == 0) { // nativeCopyFrom released our reference mCloseGuard.close(); } mGenerationId++; } Loading @@ -308,11 +304,15 @@ public class Surface implements Parcelable { nativeRelease(mNativeObject); } // transfer the reference from other to us if (other.mNativeObject != 0 && mNativeObject == 0) { mCloseGuard.open("release"); } mNativeObject = other.mNativeObject; mGenerationId++; other.mNativeObject = 0; other.mGenerationId++; other.mCloseGuard.close(); } } Loading @@ -326,7 +326,11 @@ public class Surface implements Parcelable { throw new IllegalArgumentException("source must not be null"); } mName = source.readString(); mNativeObject = nativeReadFromParcel(mNativeObject, source); int nativeObject = nativeReadFromParcel(mNativeObject, source); if (nativeObject !=0 && mNativeObject == 0) { mCloseGuard.open("release"); } mNativeObject = nativeObject; mGenerationId++; } Loading core/jni/android_view_Surface.cpp +0 −7 Original line number Diff line number Diff line Loading @@ -151,11 +151,6 @@ static void nativeRelease(JNIEnv* env, jclass clazz, jint nativeObject) { sur->decStrong(&sRefBaseOwner); } static void nativeDestroy(JNIEnv* env, jclass clazz, jint nativeObject) { sp<Surface> sur(reinterpret_cast<Surface *>(nativeObject)); sur->decStrong(&sRefBaseOwner); } static jboolean nativeIsValid(JNIEnv* env, jclass clazz, jint nativeObject) { sp<Surface> sur(reinterpret_cast<Surface *>(nativeObject)); return isSurfaceValid(sur) ? JNI_TRUE : JNI_FALSE; Loading Loading @@ -379,8 +374,6 @@ static JNINativeMethod gSurfaceMethods[] = { (void*)nativeCreateFromSurfaceTexture }, {"nativeRelease", "(I)V", (void*)nativeRelease }, {"nativeDestroy", "(I)V", (void*)nativeDestroy }, {"nativeIsValid", "(I)Z", (void*)nativeIsValid }, {"nativeIsConsumerRunningBehind", "(I)Z", Loading services/java/com/android/server/power/ElectronBeam.java +2 −1 Original line number Diff line number Diff line Loading @@ -82,7 +82,7 @@ final class ElectronBeam { private int mDisplayHeight; // real height, not rotated private SurfaceSession mSurfaceSession; private SurfaceControl mSurfaceControl; private final Surface mSurface = new Surface(); private Surface mSurface; private NaturalSurfaceLayout mSurfaceLayout; private EGLDisplay mEglDisplay; private EGLConfig mEglConfig; Loading Loading @@ -519,6 +519,7 @@ final class ElectronBeam { mSurfaceControl.setLayerStack(mDisplayLayerStack); mSurfaceControl.setSize(mDisplayWidth, mDisplayHeight); mSurface = new Surface(); mSurface.copyFrom(mSurfaceControl); mSurfaceLayout = new NaturalSurfaceLayout(mDisplayManager, mSurfaceControl); Loading Loading
core/java/android/view/Surface.java +16 −12 Original line number Diff line number Diff line Loading @@ -39,7 +39,6 @@ public class Surface implements Parcelable { private native void nativeUnlockCanvasAndPost(int nativeObject, Canvas canvas); private static native void nativeRelease(int nativeObject); private static native void nativeDestroy(int nativeObject); private static native boolean nativeIsValid(int nativeObject); private static native boolean nativeIsConsumerRunningBehind(int nativeObject); private static native int nativeCopyFrom(int nativeObject, int surfaceControlNativeObject); Loading Loading @@ -106,7 +105,6 @@ public class Surface implements Parcelable { * @hide */ public Surface() { mCloseGuard.open("release"); } /** Loading Loading @@ -135,6 +133,7 @@ public class Surface implements Parcelable { mCloseGuard.open("release"); } /* called from android_view_Surface_createFromIGraphicBufferProducer() */ private Surface(int nativeObject) { mNativeObject = nativeObject; mCloseGuard.open("release"); Loading @@ -146,9 +145,7 @@ public class Surface implements Parcelable { if (mCloseGuard != null) { mCloseGuard.warnIfOpen(); } if (mNativeObject != 0) { nativeRelease(mNativeObject); } release(); } finally { super.finalize(); } Loading @@ -175,12 +172,7 @@ public class Surface implements Parcelable { * @hide */ public void destroy() { if (mNativeObject != 0) { nativeDestroy(mNativeObject); mNativeObject = 0; mGenerationId++; } mCloseGuard.close(); release(); } /** Loading Loading @@ -287,6 +279,10 @@ public class Surface implements Parcelable { "SurfaceControl native object is null. Are you using a released SurfaceControl?"); } mNativeObject = nativeCopyFrom(mNativeObject, other.mNativeObject); if (mNativeObject == 0) { // nativeCopyFrom released our reference mCloseGuard.close(); } mGenerationId++; } Loading @@ -308,11 +304,15 @@ public class Surface implements Parcelable { nativeRelease(mNativeObject); } // transfer the reference from other to us if (other.mNativeObject != 0 && mNativeObject == 0) { mCloseGuard.open("release"); } mNativeObject = other.mNativeObject; mGenerationId++; other.mNativeObject = 0; other.mGenerationId++; other.mCloseGuard.close(); } } Loading @@ -326,7 +326,11 @@ public class Surface implements Parcelable { throw new IllegalArgumentException("source must not be null"); } mName = source.readString(); mNativeObject = nativeReadFromParcel(mNativeObject, source); int nativeObject = nativeReadFromParcel(mNativeObject, source); if (nativeObject !=0 && mNativeObject == 0) { mCloseGuard.open("release"); } mNativeObject = nativeObject; mGenerationId++; } Loading
core/jni/android_view_Surface.cpp +0 −7 Original line number Diff line number Diff line Loading @@ -151,11 +151,6 @@ static void nativeRelease(JNIEnv* env, jclass clazz, jint nativeObject) { sur->decStrong(&sRefBaseOwner); } static void nativeDestroy(JNIEnv* env, jclass clazz, jint nativeObject) { sp<Surface> sur(reinterpret_cast<Surface *>(nativeObject)); sur->decStrong(&sRefBaseOwner); } static jboolean nativeIsValid(JNIEnv* env, jclass clazz, jint nativeObject) { sp<Surface> sur(reinterpret_cast<Surface *>(nativeObject)); return isSurfaceValid(sur) ? JNI_TRUE : JNI_FALSE; Loading Loading @@ -379,8 +374,6 @@ static JNINativeMethod gSurfaceMethods[] = { (void*)nativeCreateFromSurfaceTexture }, {"nativeRelease", "(I)V", (void*)nativeRelease }, {"nativeDestroy", "(I)V", (void*)nativeDestroy }, {"nativeIsValid", "(I)Z", (void*)nativeIsValid }, {"nativeIsConsumerRunningBehind", "(I)Z", Loading
services/java/com/android/server/power/ElectronBeam.java +2 −1 Original line number Diff line number Diff line Loading @@ -82,7 +82,7 @@ final class ElectronBeam { private int mDisplayHeight; // real height, not rotated private SurfaceSession mSurfaceSession; private SurfaceControl mSurfaceControl; private final Surface mSurface = new Surface(); private Surface mSurface; private NaturalSurfaceLayout mSurfaceLayout; private EGLDisplay mEglDisplay; private EGLConfig mEglConfig; Loading Loading @@ -519,6 +519,7 @@ final class ElectronBeam { mSurfaceControl.setLayerStack(mDisplayLayerStack); mSurfaceControl.setSize(mDisplayWidth, mDisplayHeight); mSurface = new Surface(); mSurface.copyFrom(mSurfaceControl); mSurfaceLayout = new NaturalSurfaceLayout(mDisplayManager, mSurfaceControl); Loading