summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCraig Mautner <cmautner@google.com>2012-09-04 09:49:35 -0700
committerCraig Mautner <cmautner@google.com>2012-09-04 09:49:35 -0700
commitea3a09a5b9c8ae56b0c4975c7a7039a05d4c0b3c (patch)
tree74b75b5ee6903c874489bf708f7d1fcb961fbca4
parent76a7165719dc3ccce902953f6244e2c2668aa753 (diff)
downloadframeworks_base-ea3a09a5b9c8ae56b0c4975c7a7039a05d4c0b3c.zip
frameworks_base-ea3a09a5b9c8ae56b0c4975c7a7039a05d4c0b3c.tar.gz
frameworks_base-ea3a09a5b9c8ae56b0c4975c7a7039a05d4c0b3c.tar.bz2
Remove single pass actions from display loop.
The WindowAnimator loop over each Display contained actions that only needed to be done one time but were instead done once per loop. Change-Id: Ia916b08cdb7670686e6295dbcef6a5ff27474099
-rw-r--r--services/java/com/android/server/wm/DimAnimator.java7
-rw-r--r--services/java/com/android/server/wm/WindowAnimator.java53
2 files changed, 34 insertions, 26 deletions
diff --git a/services/java/com/android/server/wm/DimAnimator.java b/services/java/com/android/server/wm/DimAnimator.java
index afcf339..87a2880 100644
--- a/services/java/com/android/server/wm/DimAnimator.java
+++ b/services/java/com/android/server/wm/DimAnimator.java
@@ -212,5 +212,12 @@ class DimAnimator {
mDimHeight = dimHeight;
mDimTarget = dimTarget;
}
+
+ Parameters(Parameters o) {
+ mDimWinAnimator = o.mDimWinAnimator;
+ mDimWidth = o.mDimWidth;
+ mDimHeight = o.mDimHeight;
+ mDimTarget = o.mDimTarget;
+ }
}
}
diff --git a/services/java/com/android/server/wm/WindowAnimator.java b/services/java/com/android/server/wm/WindowAnimator.java
index 9eab92c..f0b514c 100644
--- a/services/java/com/android/server/wm/WindowAnimator.java
+++ b/services/java/com/android/server/wm/WindowAnimator.java
@@ -176,7 +176,7 @@ public class WindowAnimator {
// Set the new DimAnimator params.
DimAnimator.Parameters dimParams = layoutToAnim.mDimParams;
if (dimParams == null) {
- mDimParams = dimParams;
+ mDimParams = null;
} else {
final WindowStateAnimator newWinAnimator = dimParams.mDimWinAnimator;
@@ -187,7 +187,7 @@ public class WindowAnimator {
if (newWinAnimator.mSurfaceShown &&
(existingDimWinAnimator == null || !existingDimWinAnimator.mSurfaceShown
|| existingDimWinAnimator.mAnimLayer < newWinAnimator.mAnimLayer)) {
- mDimParams = dimParams;
+ mDimParams = new DimAnimator.Parameters(dimParams);
}
}
@@ -559,15 +559,6 @@ public class WindowAnimator {
private void performAnimationsLocked(final WinAnimatorList winAnimatorList) {
updateWindowsLocked(winAnimatorList);
updateWallpaperLocked(winAnimatorList);
-
- for (int i = mPendingLayoutChanges.size() - 1; i >= 0; i--) {
- if ((mPendingLayoutChanges.valueAt(i)
- & WindowManagerPolicy.FINISH_LAYOUT_REDO_WALLPAPER) != 0) {
- mPendingActions |= WALLPAPER_ACTION_PENDING;
- }
- }
-
- testTokenMayBeDrawnLocked();
}
// TODO(cmautner): Change the following comment when no longer locked on mWindowMap */
@@ -576,12 +567,7 @@ public class WindowAnimator {
if (!mInitialized) {
return;
}
- for (int i = mWinAnimatorLists.size() - 1; i >= 0; i--) {
- animateLocked(mWinAnimatorLists.get(i));
- }
- }
- private void animateLocked(final WinAnimatorList winAnimatorList) {
mPendingLayoutChanges.clear();
mCurrentTime = SystemClock.uptimeMillis();
mBulkUpdateParams = SET_ORIENTATION_CHANGE_COMPLETE;
@@ -591,23 +577,29 @@ public class WindowAnimator {
Slog.i(TAG, "!!! animate: entry time=" + mCurrentTime);
}
- // Update animations of all applications, including those
- // associated with exiting/removed apps
+ if (WindowManagerService.SHOW_TRANSACTIONS) Slog.i(
+ TAG, ">>> OPEN TRANSACTION animateLocked");
Surface.openTransaction();
-
try {
updateWindowsAppsAndRotationAnimationsLocked();
- performAnimationsLocked(winAnimatorList);
- // THIRD LOOP: Update the surfaces of all windows.
+ for (int i = mWinAnimatorLists.size() - 1; i >= 0; i--) {
+ final WinAnimatorList winAnimatorList = mWinAnimatorLists.get(i);
- if (mScreenRotationAnimation != null) {
- mScreenRotationAnimation.updateSurfacesInTransaction();
+ // Update animations of all applications, including those
+ // associated with exiting/removed apps
+ performAnimationsLocked(winAnimatorList);
+
+ final int N = winAnimatorList.size();
+ for (int j = 0; j < N; j++) {
+ winAnimatorList.get(j).prepareSurfaceLocked(true);
+ }
}
- final int N = winAnimatorList.size();
- for (int i = 0; i < N; i++) {
- winAnimatorList.get(i).prepareSurfaceLocked(true);
+ testTokenMayBeDrawnLocked();
+
+ if (mScreenRotationAnimation != null) {
+ mScreenRotationAnimation.updateSurfacesInTransaction();
}
if (mDimParams != null) {
@@ -634,6 +626,15 @@ public class WindowAnimator {
Log.wtf(TAG, "Unhandled exception in Window Manager", e);
} finally {
Surface.closeTransaction();
+ if (WindowManagerService.SHOW_TRANSACTIONS) Slog.i(
+ TAG, "<<< CLOSE TRANSACTION animateLocked");
+ }
+
+ for (int i = mPendingLayoutChanges.size() - 1; i >= 0; i--) {
+ if ((mPendingLayoutChanges.valueAt(i)
+ & WindowManagerPolicy.FINISH_LAYOUT_REDO_WALLPAPER) != 0) {
+ mPendingActions |= WALLPAPER_ACTION_PENDING;
+ }
}
if (mBulkUpdateParams != 0 || mPendingLayoutChanges.size() > 0) {