Loading core/java/android/view/SurfaceControl.java +11 −0 Original line number Diff line number Diff line Loading @@ -57,6 +57,7 @@ public class SurfaceControl { private static native void nativeSetMatrix(long nativeObject, float dsdx, float dtdx, float dsdy, float dtdy); private static native void nativeSetFlags(long nativeObject, int flags, int mask); private static native void nativeSetWindowCrop(long nativeObject, int l, int t, int r, int b); private static native void nativeSetFinalCrop(long nativeObject, int l, int t, int r, int b); private static native void nativeSetLayerStack(long nativeObject, int layerStack); private static native boolean nativeClearContentFrameStats(long nativeObject); Loading Loading @@ -456,6 +457,16 @@ public class SurfaceControl { } } public void setFinalCrop(Rect crop) { checkNotReleased(); if (crop != null) { nativeSetFinalCrop(mNativeObject, crop.left, crop.top, crop.right, crop.bottom); } else { nativeSetFinalCrop(mNativeObject, 0, 0, 0, 0); } } public void setLayerStack(int layerStack) { checkNotReleased(); nativeSetLayerStack(mNativeObject, layerStack); Loading core/jni/android_view_SurfaceControl.cpp +12 −0 Original line number Diff line number Diff line Loading @@ -309,6 +309,16 @@ static void nativeSetWindowCrop(JNIEnv* env, jclass clazz, jlong nativeObject, } } static void nativeSetFinalCrop(JNIEnv* env, jclass clazz, jlong nativeObject, jint l, jint t, jint r, jint b) { SurfaceControl* const ctrl = reinterpret_cast<SurfaceControl *>(nativeObject); Rect crop(l, t, r, b); status_t err = ctrl->setFinalCrop(crop); if (err < 0 && err != NO_INIT) { doThrowIAE(env); } } static void nativeSetLayerStack(JNIEnv* env, jclass clazz, jlong nativeObject, jint layerStack) { SurfaceControl* const ctrl = reinterpret_cast<SurfaceControl *>(nativeObject); status_t err = ctrl->setLayerStack(layerStack); Loading Loading @@ -630,6 +640,8 @@ static const JNINativeMethod sSurfaceControlMethods[] = { (void*)nativeSetFlags }, {"nativeSetWindowCrop", "(JIIII)V", (void*)nativeSetWindowCrop }, {"nativeSetFinalCrop", "(JIIII)V", (void*)nativeSetFinalCrop }, {"nativeSetLayerStack", "(JI)V", (void*)nativeSetLayerStack }, {"nativeGetBuiltInDisplay", "(I)Landroid/os/IBinder;", Loading Loading
core/java/android/view/SurfaceControl.java +11 −0 Original line number Diff line number Diff line Loading @@ -57,6 +57,7 @@ public class SurfaceControl { private static native void nativeSetMatrix(long nativeObject, float dsdx, float dtdx, float dsdy, float dtdy); private static native void nativeSetFlags(long nativeObject, int flags, int mask); private static native void nativeSetWindowCrop(long nativeObject, int l, int t, int r, int b); private static native void nativeSetFinalCrop(long nativeObject, int l, int t, int r, int b); private static native void nativeSetLayerStack(long nativeObject, int layerStack); private static native boolean nativeClearContentFrameStats(long nativeObject); Loading Loading @@ -456,6 +457,16 @@ public class SurfaceControl { } } public void setFinalCrop(Rect crop) { checkNotReleased(); if (crop != null) { nativeSetFinalCrop(mNativeObject, crop.left, crop.top, crop.right, crop.bottom); } else { nativeSetFinalCrop(mNativeObject, 0, 0, 0, 0); } } public void setLayerStack(int layerStack) { checkNotReleased(); nativeSetLayerStack(mNativeObject, layerStack); Loading
core/jni/android_view_SurfaceControl.cpp +12 −0 Original line number Diff line number Diff line Loading @@ -309,6 +309,16 @@ static void nativeSetWindowCrop(JNIEnv* env, jclass clazz, jlong nativeObject, } } static void nativeSetFinalCrop(JNIEnv* env, jclass clazz, jlong nativeObject, jint l, jint t, jint r, jint b) { SurfaceControl* const ctrl = reinterpret_cast<SurfaceControl *>(nativeObject); Rect crop(l, t, r, b); status_t err = ctrl->setFinalCrop(crop); if (err < 0 && err != NO_INIT) { doThrowIAE(env); } } static void nativeSetLayerStack(JNIEnv* env, jclass clazz, jlong nativeObject, jint layerStack) { SurfaceControl* const ctrl = reinterpret_cast<SurfaceControl *>(nativeObject); status_t err = ctrl->setLayerStack(layerStack); Loading Loading @@ -630,6 +640,8 @@ static const JNINativeMethod sSurfaceControlMethods[] = { (void*)nativeSetFlags }, {"nativeSetWindowCrop", "(JIIII)V", (void*)nativeSetWindowCrop }, {"nativeSetFinalCrop", "(JIIII)V", (void*)nativeSetFinalCrop }, {"nativeSetLayerStack", "(JI)V", (void*)nativeSetLayerStack }, {"nativeGetBuiltInDisplay", "(I)Landroid/os/IBinder;", Loading