Loading core/java/android/view/Surface.java +1 −0 Original line number Diff line number Diff line Loading @@ -58,6 +58,7 @@ public class Surface implements Parcelable { private static native long nativeGetNextFrameNumber(long nativeObject); private static native int nativeSetScalingMode(long nativeObject, int scalingMode); private static native void nativeSetBuffersTransform(long nativeObject, long transform); public static final Parcelable.Creator<Surface> CREATOR = new Parcelable.Creator<Surface>() { Loading core/java/android/view/SurfaceControl.java +13 −5 Original line number Diff line number Diff line Loading @@ -51,7 +51,7 @@ public class SurfaceControl { private static native void nativeSetLayer(long nativeObject, int zorder); private static native void nativeSetPosition(long nativeObject, float x, float y); private static native void nativeSetPositionAppliesWithResize(long nativeObject); private static native void nativeSetGeometryAppliesWithResize(long nativeObject); private static native void nativeSetSize(long nativeObject, int w, int h); private static native void nativeSetTransparentRegionHint(long nativeObject, Region region); private static native void nativeSetAlpha(long nativeObject, float alpha); Loading Loading @@ -89,6 +89,8 @@ public class SurfaceControl { private static native void nativeSetOverrideScalingMode(long nativeObject, int scalingMode); private static native IBinder nativeGetHandle(long nativeObject); private static native boolean nativeGetTransformToDisplayInverse(long nativeObject); private static native Display.HdrCapabilities nativeGetHdrCapabilities(IBinder displayToken); Loading Loading @@ -393,6 +395,10 @@ public class SurfaceControl { return nativeGetHandle(mNativeObject); } public boolean getTransformToDisplayInverse() { return nativeGetTransformToDisplayInverse(mNativeObject); } /** flag the transaction as an animation */ public static void setAnimationTransaction() { nativeSetAnimationTransaction(); Loading @@ -409,13 +415,15 @@ public class SurfaceControl { } /** * If the size changes in this transaction, position updates specified * If the buffer size changes in this transaction, position and crop updates specified * in this transaction will not complete until a buffer of the new size * arrives. * arrives. As transform matrix and size are already frozen in this fashion, * this enables totally freezing the surface until the resize has completed * (at which point the geometry influencing aspects of this transaction will then occur) */ public void setPositionAppliesWithResize() { public void setGeometryAppliesWithResize() { checkNotReleased(); nativeSetPositionAppliesWithResize(mNativeObject); nativeSetGeometryAppliesWithResize(mNativeObject); } public void setSize(int w, int h) { Loading core/java/android/view/SurfaceView.java +1 −1 Original line number Diff line number Diff line Loading @@ -498,7 +498,7 @@ public class SurfaceView extends View { | WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE | WindowManager.LayoutParams.FLAG_NOT_TOUCHABLE ; if (!creating && !force && !mUpdateWindowNeeded && !sizeChanged) { if (!creating && !force && !sizeChanged) { mLayout.privateFlags |= WindowManager.LayoutParams.PRIVATE_FLAG_PRESERVE_GEOMETRY; } else { Loading core/java/android/view/WindowManagerPolicy.java +2 −0 Original line number Diff line number Diff line Loading @@ -1415,4 +1415,6 @@ public interface WindowManagerPolicy { * Called when the configuration has changed, and it's safe to load new values from resources. */ public void onConfigurationChanged(); public boolean shouldRotateSeamlessly(int oldRotation, int newRotation); } core/jni/android_view_SurfaceControl.cpp +17 −5 Original line number Diff line number Diff line Loading @@ -248,10 +248,10 @@ static void nativeSetPosition(JNIEnv* env, jclass clazz, jlong nativeObject, jfl } } static void nativeSetPositionAppliesWithResize(JNIEnv* env, jclass clazz, static void nativeSetGeometryAppliesWithResize(JNIEnv* env, jclass clazz, jlong nativeObject) { SurfaceControl* const ctrl = reinterpret_cast<SurfaceControl *>(nativeObject); status_t err = ctrl->setPositionAppliesWithResize(); status_t err = ctrl->setGeometryAppliesWithResize(); if (err < 0 && err != NO_INIT) { doThrowIAE(env); } Loading Loading @@ -626,6 +626,16 @@ static jobject nativeGetHandle(JNIEnv* env, jclass clazz, jlong nativeObject) { return javaObjectForIBinder(env, ctrl->getHandle()); } static jboolean nativeGetTransformToDisplayInverse(JNIEnv* env, jclass clazz, jlong nativeObject) { bool out = false; auto ctrl = reinterpret_cast<SurfaceControl *>(nativeObject); status_t status = ctrl->getTransformToDisplayInverse(&out); if (status != NO_ERROR) { return false; } return out; } static jobject nativeGetHdrCapabilities(JNIEnv* env, jclass clazz, jobject tokenObject) { sp<IBinder> token(ibinderForJavaObject(env, tokenObject)); if (token == NULL) return NULL; Loading Loading @@ -667,8 +677,8 @@ static const JNINativeMethod sSurfaceControlMethods[] = { (void*)nativeSetLayer }, {"nativeSetPosition", "(JFF)V", (void*)nativeSetPosition }, {"nativeSetPositionAppliesWithResize", "(J)V", (void*)nativeSetPositionAppliesWithResize }, {"nativeSetGeometryAppliesWithResize", "(J)V", (void*)nativeSetGeometryAppliesWithResize }, {"nativeSetSize", "(JII)V", (void*)nativeSetSize }, {"nativeSetTransparentRegionHint", "(JLandroid/graphics/Region;)V", Loading Loading @@ -722,7 +732,9 @@ static const JNINativeMethod sSurfaceControlMethods[] = { {"nativeSetOverrideScalingMode", "(JI)V", (void*)nativeSetOverrideScalingMode }, {"nativeGetHandle", "(J)Landroid/os/IBinder;", (void*)nativeGetHandle } (void*)nativeGetHandle }, {"nativeGetTransformToDisplayInverse", "(J)Z", (void*)nativeGetTransformToDisplayInverse }, }; int register_android_view_SurfaceControl(JNIEnv* env) Loading Loading
core/java/android/view/Surface.java +1 −0 Original line number Diff line number Diff line Loading @@ -58,6 +58,7 @@ public class Surface implements Parcelable { private static native long nativeGetNextFrameNumber(long nativeObject); private static native int nativeSetScalingMode(long nativeObject, int scalingMode); private static native void nativeSetBuffersTransform(long nativeObject, long transform); public static final Parcelable.Creator<Surface> CREATOR = new Parcelable.Creator<Surface>() { Loading
core/java/android/view/SurfaceControl.java +13 −5 Original line number Diff line number Diff line Loading @@ -51,7 +51,7 @@ public class SurfaceControl { private static native void nativeSetLayer(long nativeObject, int zorder); private static native void nativeSetPosition(long nativeObject, float x, float y); private static native void nativeSetPositionAppliesWithResize(long nativeObject); private static native void nativeSetGeometryAppliesWithResize(long nativeObject); private static native void nativeSetSize(long nativeObject, int w, int h); private static native void nativeSetTransparentRegionHint(long nativeObject, Region region); private static native void nativeSetAlpha(long nativeObject, float alpha); Loading Loading @@ -89,6 +89,8 @@ public class SurfaceControl { private static native void nativeSetOverrideScalingMode(long nativeObject, int scalingMode); private static native IBinder nativeGetHandle(long nativeObject); private static native boolean nativeGetTransformToDisplayInverse(long nativeObject); private static native Display.HdrCapabilities nativeGetHdrCapabilities(IBinder displayToken); Loading Loading @@ -393,6 +395,10 @@ public class SurfaceControl { return nativeGetHandle(mNativeObject); } public boolean getTransformToDisplayInverse() { return nativeGetTransformToDisplayInverse(mNativeObject); } /** flag the transaction as an animation */ public static void setAnimationTransaction() { nativeSetAnimationTransaction(); Loading @@ -409,13 +415,15 @@ public class SurfaceControl { } /** * If the size changes in this transaction, position updates specified * If the buffer size changes in this transaction, position and crop updates specified * in this transaction will not complete until a buffer of the new size * arrives. * arrives. As transform matrix and size are already frozen in this fashion, * this enables totally freezing the surface until the resize has completed * (at which point the geometry influencing aspects of this transaction will then occur) */ public void setPositionAppliesWithResize() { public void setGeometryAppliesWithResize() { checkNotReleased(); nativeSetPositionAppliesWithResize(mNativeObject); nativeSetGeometryAppliesWithResize(mNativeObject); } public void setSize(int w, int h) { Loading
core/java/android/view/SurfaceView.java +1 −1 Original line number Diff line number Diff line Loading @@ -498,7 +498,7 @@ public class SurfaceView extends View { | WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE | WindowManager.LayoutParams.FLAG_NOT_TOUCHABLE ; if (!creating && !force && !mUpdateWindowNeeded && !sizeChanged) { if (!creating && !force && !sizeChanged) { mLayout.privateFlags |= WindowManager.LayoutParams.PRIVATE_FLAG_PRESERVE_GEOMETRY; } else { Loading
core/java/android/view/WindowManagerPolicy.java +2 −0 Original line number Diff line number Diff line Loading @@ -1415,4 +1415,6 @@ public interface WindowManagerPolicy { * Called when the configuration has changed, and it's safe to load new values from resources. */ public void onConfigurationChanged(); public boolean shouldRotateSeamlessly(int oldRotation, int newRotation); }
core/jni/android_view_SurfaceControl.cpp +17 −5 Original line number Diff line number Diff line Loading @@ -248,10 +248,10 @@ static void nativeSetPosition(JNIEnv* env, jclass clazz, jlong nativeObject, jfl } } static void nativeSetPositionAppliesWithResize(JNIEnv* env, jclass clazz, static void nativeSetGeometryAppliesWithResize(JNIEnv* env, jclass clazz, jlong nativeObject) { SurfaceControl* const ctrl = reinterpret_cast<SurfaceControl *>(nativeObject); status_t err = ctrl->setPositionAppliesWithResize(); status_t err = ctrl->setGeometryAppliesWithResize(); if (err < 0 && err != NO_INIT) { doThrowIAE(env); } Loading Loading @@ -626,6 +626,16 @@ static jobject nativeGetHandle(JNIEnv* env, jclass clazz, jlong nativeObject) { return javaObjectForIBinder(env, ctrl->getHandle()); } static jboolean nativeGetTransformToDisplayInverse(JNIEnv* env, jclass clazz, jlong nativeObject) { bool out = false; auto ctrl = reinterpret_cast<SurfaceControl *>(nativeObject); status_t status = ctrl->getTransformToDisplayInverse(&out); if (status != NO_ERROR) { return false; } return out; } static jobject nativeGetHdrCapabilities(JNIEnv* env, jclass clazz, jobject tokenObject) { sp<IBinder> token(ibinderForJavaObject(env, tokenObject)); if (token == NULL) return NULL; Loading Loading @@ -667,8 +677,8 @@ static const JNINativeMethod sSurfaceControlMethods[] = { (void*)nativeSetLayer }, {"nativeSetPosition", "(JFF)V", (void*)nativeSetPosition }, {"nativeSetPositionAppliesWithResize", "(J)V", (void*)nativeSetPositionAppliesWithResize }, {"nativeSetGeometryAppliesWithResize", "(J)V", (void*)nativeSetGeometryAppliesWithResize }, {"nativeSetSize", "(JII)V", (void*)nativeSetSize }, {"nativeSetTransparentRegionHint", "(JLandroid/graphics/Region;)V", Loading Loading @@ -722,7 +732,9 @@ static const JNINativeMethod sSurfaceControlMethods[] = { {"nativeSetOverrideScalingMode", "(JI)V", (void*)nativeSetOverrideScalingMode }, {"nativeGetHandle", "(J)Landroid/os/IBinder;", (void*)nativeGetHandle } (void*)nativeGetHandle }, {"nativeGetTransformToDisplayInverse", "(J)Z", (void*)nativeGetTransformToDisplayInverse }, }; int register_android_view_SurfaceControl(JNIEnv* env) Loading