summaryrefslogtreecommitdiffstats
path: root/services
diff options
context:
space:
mode:
authorCraig Mautner <cmautner@google.com>2012-04-23 17:24:21 -0700
committerCraig Mautner <cmautner@google.com>2012-04-24 09:56:59 -0700
commitfbf378c736a973b8edaf1fc4c187d11dc0f5e291 (patch)
tree6ddc12b81b75725761d370e319048bb9f3301559 /services
parent1579a67ee9a53740a09e606e071fd571ee627449 (diff)
downloadframeworks_base-fbf378c736a973b8edaf1fc4c187d11dc0f5e291.zip
frameworks_base-fbf378c736a973b8edaf1fc4c187d11dc0f5e291.tar.gz
frameworks_base-fbf378c736a973b8edaf1fc4c187d11dc0f5e291.tar.bz2
Various debugging enhancements.
Also moved DummyAnimation into AppWindowAnimator where it belongs. Change-Id: I7da254a8b99030b898e2ff8d983500d7ce0b2b65
Diffstat (limited to 'services')
-rw-r--r--services/java/com/android/server/wm/AppWindowAnimator.java36
-rw-r--r--services/java/com/android/server/wm/WindowAnimator.java4
-rwxr-xr-xservices/java/com/android/server/wm/WindowManagerService.java12
-rw-r--r--services/java/com/android/server/wm/WindowStateAnimator.java5
4 files changed, 30 insertions, 27 deletions
diff --git a/services/java/com/android/server/wm/AppWindowAnimator.java b/services/java/com/android/server/wm/AppWindowAnimator.java
index c3b5465..781792b 100644
--- a/services/java/com/android/server/wm/AppWindowAnimator.java
+++ b/services/java/com/android/server/wm/AppWindowAnimator.java
@@ -15,6 +15,7 @@ import java.io.PrintWriter;
*
*/
public class AppWindowAnimator {
+ static final String TAG = "AppWindowAnimator";
final AppWindowToken mAppToken;
final WindowManagerService mService;
@@ -43,6 +44,8 @@ public class AppWindowAnimator {
Animation thumbnailAnimation;
final Transformation thumbnailTransformation = new Transformation();
+ static final Animation sDummyAnimation = new DummyAnimation();
+
public AppWindowAnimator(final WindowManagerService service, final AppWindowToken atoken) {
mService = service;
mAppToken = atoken;
@@ -51,7 +54,7 @@ public class AppWindowAnimator {
public void setAnimation(Animation anim, boolean initialized) {
if (WindowManagerService.localLOGV) Slog.v(
- WindowManagerService.TAG, "Setting animation in " + this + ": " + anim);
+ TAG, "Setting animation in " + this + ": " + anim);
animation = anim;
animating = false;
animInitialized = initialized;
@@ -78,8 +81,8 @@ public class AppWindowAnimator {
public void setDummyAnimation() {
if (animation == null) {
if (WindowManagerService.localLOGV) Slog.v(
- WindowManagerService.TAG, "Setting dummy animation in " + this);
- animation = WindowManagerService.sDummyAnimation;
+ TAG, "Setting dummy animation in " + this);
+ animation = sDummyAnimation;
animInitialized = false;
}
}
@@ -111,7 +114,7 @@ public class AppWindowAnimator {
if (winAnimator.mAnimLayer > thumbnailLayer) {
thumbnailLayer = winAnimator.mAnimLayer;
}
- if (WindowManagerService.DEBUG_LAYERS) Slog.v(WindowManagerService.TAG, "Updating layer " + w + ": "
+ if (WindowManagerService.DEBUG_LAYERS) Slog.v(TAG, "Updating layer " + w + ": "
+ winAnimator.mAnimLayer);
if (w == mService.mInputMethodTarget && !mService.mInputMethodTargetWaitingAnim) {
mService.setInputMethodAnimLayerAdjustment(adj);
@@ -162,14 +165,12 @@ public class AppWindowAnimator {
transformation.clear();
final boolean more = animation.getTransformation(currentTime, transformation);
if (WindowManagerService.DEBUG_ANIM) Slog.v(
- WindowManagerService.TAG, "Stepped animation in " + this +
- ": more=" + more + ", xform=" + transformation);
+ TAG, "Stepped animation in " + this + ": more=" + more + ", xform=" + transformation);
if (!more) {
animation = null;
clearThumbnail();
if (WindowManagerService.DEBUG_ANIM) Slog.v(
- WindowManagerService.TAG, "Finished animation in " + this +
- " @ " + currentTime);
+ TAG, "Finished animation in " + this + " @ " + currentTime);
}
hasTransformation = more;
return more;
@@ -180,7 +181,7 @@ public class AppWindowAnimator {
if (mService.okToDisplay()) {
// We will run animations as long as the display isn't frozen.
- if (animation == WindowManagerService.sDummyAnimation) {
+ if (animation == sDummyAnimation) {
// This guy is going to animate, but not yet. For now count
// it as not animating for purposes of scheduling transactions;
// when it is really time to animate, this will be set to
@@ -192,7 +193,7 @@ public class AppWindowAnimator {
&& animation != null) {
if (!animating) {
if (WindowManagerService.DEBUG_ANIM) Slog.v(
- WindowManagerService.TAG, "Starting animation in " + this +
+ TAG, "Starting animation in " + this +
" @ " + currentTime + ": dw=" + dw + " dh=" + dh
+ " scale=" + mService.mTransitionAnimationScale
+ " allDrawn=" + mAppToken.allDrawn + " animating=" + animating);
@@ -245,7 +246,7 @@ public class AppWindowAnimator {
}
if (WindowManagerService.DEBUG_ANIM) Slog.v(
- WindowManagerService.TAG, "Animation done in " + this
+ TAG, "Animation done in " + this
+ ": reportedVisible=" + mAppToken.reportedVisible);
transformation.clear();
@@ -264,7 +265,7 @@ public class AppWindowAnimator {
final int NW = mAppToken.allAppWindows.size();
for (int i=0; i<NW; i++) {
WindowStateAnimator winAnimator = mAppToken.allAppWindows.get(i).mWinAnimator;
- if (WindowManagerService.DEBUG_VISIBILITY) Slog.v(WindowManagerService.TAG,
+ if (WindowManagerService.DEBUG_VISIBILITY) Slog.v(TAG,
"performing show on: " + winAnimator);
winAnimator.performShowLocked();
isAnimating |= winAnimator.isAnimating();
@@ -298,4 +299,15 @@ public class AppWindowAnimator {
pw.println(thumbnailTransformation.toShortString());
}
}
+
+ // This is an animation that does nothing: it just immediately finishes
+ // itself every time it is called. It is used as a stub animation in cases
+ // where we want to synchronize multiple things that may be animating.
+ static final class DummyAnimation extends Animation {
+ @Override
+ public boolean getTransformation(long currentTime, Transformation outTransformation) {
+ return false;
+ }
+ }
+
}
diff --git a/services/java/com/android/server/wm/WindowAnimator.java b/services/java/com/android/server/wm/WindowAnimator.java
index f946f6c..e7ad1ff 100644
--- a/services/java/com/android/server/wm/WindowAnimator.java
+++ b/services/java/com/android/server/wm/WindowAnimator.java
@@ -130,7 +130,7 @@ public class WindowAnimator {
for (i=0; i<NAT; i++) {
final AppWindowAnimator appAnimator = mService.mAppTokens.get(i).mAppAnimator;
final boolean wasAnimating = appAnimator.animation != null
- && appAnimator.animation != WindowManagerService.sDummyAnimation;
+ && appAnimator.animation != AppWindowAnimator.sDummyAnimation;
if (appAnimator.stepAnimationLocked(mCurrentTime, mInnerDw, mInnerDh)) {
mAnimating = true;
} else if (wasAnimating) {
@@ -147,7 +147,7 @@ public class WindowAnimator {
for (i=0; i<NEAT; i++) {
final AppWindowAnimator appAnimator = mService.mExitingAppTokens.get(i).mAppAnimator;
final boolean wasAnimating = appAnimator.animation != null
- && appAnimator.animation != WindowManagerService.sDummyAnimation;
+ && appAnimator.animation != AppWindowAnimator.sDummyAnimation;
if (appAnimator.stepAnimationLocked(mCurrentTime, mInnerDw, mInnerDh)) {
mAnimating = true;
} else if (wasAnimating) {
diff --git a/services/java/com/android/server/wm/WindowManagerService.java b/services/java/com/android/server/wm/WindowManagerService.java
index ff41899..1f7b297 100755
--- a/services/java/com/android/server/wm/WindowManagerService.java
+++ b/services/java/com/android/server/wm/WindowManagerService.java
@@ -4111,7 +4111,7 @@ public class WindowManagerService extends IWindowManager.Stub
boolean runningAppAnimation = false;
if (transit != WindowManagerPolicy.TRANSIT_UNSET) {
- if (wtoken.mAppAnimator.animation == sDummyAnimation) {
+ if (wtoken.mAppAnimator.animation == AppWindowAnimator.sDummyAnimation) {
wtoken.mAppAnimator.animation = null;
}
if (applyAnimationLocked(wtoken, lp, transit, visible)) {
@@ -6580,16 +6580,6 @@ public class WindowManagerService extends IWindowManager.Stub
}
}
- // This is an animation that does nothing: it just immediately finishes
- // itself every time it is called. It is used as a stub animation in cases
- // where we want to synchronize multiple things that may be animating.
- static final class DummyAnimation extends Animation {
- public boolean getTransformation(long currentTime, Transformation outTransformation) {
- return false;
- }
- }
- static final Animation sDummyAnimation = new DummyAnimation();
-
// -------------------------------------------------------------
// Async Handler
// -------------------------------------------------------------
diff --git a/services/java/com/android/server/wm/WindowStateAnimator.java b/services/java/com/android/server/wm/WindowStateAnimator.java
index 74e3304..9147a10 100644
--- a/services/java/com/android/server/wm/WindowStateAnimator.java
+++ b/services/java/com/android/server/wm/WindowStateAnimator.java
@@ -390,10 +390,10 @@ class WindowStateAnimator {
// This must be called while inside a transaction.
boolean commitFinishDrawingLocked(long currentTime) {
- //Slog.i(TAG, "commitFinishDrawingLocked: " + mSurface);
if (mDrawState != COMMIT_DRAW_PENDING) {
return false;
}
+ //Slog.i(TAG, "commitFinishDrawingLocked: Draw pending. " + mSurface);
mDrawState = READY_TO_SHOW;
final boolean starting = mWin.mAttrs.type == TYPE_APPLICATION_STARTING;
final AppWindowToken atoken = mWin.mAppToken;
@@ -515,7 +515,8 @@ class WindowStateAnimator {
@Override
public String toString() {
- return "Surface " + mName + ": shown=" + mShown + " layer=" + mLayer
+ return "Surface " + Integer.toHexString(System.identityHashCode(this)) + " "
+ + mName + ": shown=" + mShown + " layer=" + mLayer
+ " alpha=" + mSurfaceTraceAlpha + " " + mPosition.x + "," + mPosition.y
+ " " + mSize.x + "x" + mSize.y;
}