Skip to content

Commit b6ce6e4

Browse files
author
Jamie Gennis
committed
Flag window animation transactions as animations.
This change makes WindowManager use the new eAnimation flag when animating windows. This prevents some of the window updates from being combined with updates from prior animation frames. Bug: 7353840 Change-Id: I5a9f8fa2c1a2f5f08363a45cd9f28bb97cd77080
1 parent d86a532 commit b6ce6e4

File tree

3 files changed

+13
-0
lines changed

3 files changed

+13
-0
lines changed

core/java/android/view/Surface.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,7 @@ private static native Bitmap nativeScreenshot(IBinder displayToken,
245245

246246
private static native void nativeOpenTransaction();
247247
private static native void nativeCloseTransaction();
248+
private static native void nativeSetAnimationTransaction();
248249

249250
private native void nativeSetLayer(int zorder);
250251
private native void nativeSetPosition(float x, float y);
@@ -525,6 +526,11 @@ public static void closeTransaction() {
525526
nativeCloseTransaction();
526527
}
527528

529+
/** flag the transaction as an animation @hide */
530+
public static void setAnimationTransaction() {
531+
nativeSetAnimationTransaction();
532+
}
533+
528534
/** @hide */
529535
public void setLayer(int zorder) {
530536
nativeSetLayer(zorder);

core/jni/android_view_Surface.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -526,6 +526,10 @@ static void nativeCloseTransaction(JNIEnv* env, jclass clazz) {
526526
SurfaceComposerClient::closeGlobalTransaction();
527527
}
528528

529+
static void nativeSetAnimationTransaction(JNIEnv* env, jclass clazz) {
530+
SurfaceComposerClient::setAnimationTransaction();
531+
}
532+
529533
static void nativeSetLayer(JNIEnv* env, jobject surfaceObj, jint zorder) {
530534
sp<SurfaceControl> surface(getSurfaceControl(env, surfaceObj));
531535
if (surface == NULL) return;
@@ -819,6 +823,8 @@ static JNINativeMethod gSurfaceMethods[] = {
819823
(void*)nativeOpenTransaction },
820824
{"nativeCloseTransaction", "()V",
821825
(void*)nativeCloseTransaction },
826+
{"nativeSetAnimationTransaction", "()V",
827+
(void*)nativeSetAnimationTransaction },
822828
{"nativeSetLayer", "(I)V",
823829
(void*)nativeSetLayer },
824830
{"nativeSetPosition", "(FF)V",

services/java/com/android/server/wm/WindowAnimator.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -618,6 +618,7 @@ private void animateLocked() {
618618
if (WindowManagerService.SHOW_TRANSACTIONS) Slog.i(
619619
TAG, ">>> OPEN TRANSACTION animateLocked");
620620
Surface.openTransaction();
621+
Surface.setAnimationTransaction();
621622
try {
622623
updateAppWindowsLocked();
623624

0 commit comments

Comments
 (0)