Loading services/java/com/android/server/wm/AppWindowAnimator.java +9 −14 Original line number Diff line number Diff line Loading @@ -22,7 +22,6 @@ public class AppWindowAnimator { boolean animating; Animation animation; boolean animInitialized; boolean hasTransformation; final Transformation transformation = new Transformation(); Loading Loading @@ -58,12 +57,15 @@ public class AppWindowAnimator { mAnimator = atoken.mAnimator; } public void setAnimation(Animation anim) { public void setAnimation(Animation anim, int width, int height) { if (WindowManagerService.localLOGV) Slog.v( TAG, "Setting animation in " + mAppToken + ": " + anim); TAG, "Setting animation in " + mAppToken + ": " + anim + " wxh=" + width + "x" + height); animation = anim; animating = false; animInitialized = anim.isInitialized(); if (!anim.isInitialized()) { anim.initialize(width, height, width, height); } anim.restrictDuration(WindowManagerService.MAX_ANIMATION_DURATION); anim.scaleCurrentDuration(mService.mTransitionAnimationScale); int zorder = anim.getZAdjustment(); Loading @@ -87,7 +89,6 @@ public class AppWindowAnimator { public void setDummyAnimation() { if (WindowManagerService.localLOGV) Slog.v(TAG, "Setting dummy animation in " + mAppToken); animation = sDummyAnimation; animInitialized = false; hasTransformation = true; transformation.clear(); transformation.setAlpha(mAppToken.reportedVisible ? 1 : 0); Loading @@ -97,7 +98,6 @@ public class AppWindowAnimator { if (animation != null) { animation = null; animating = true; animInitialized = false; } clearThumbnail(); if (mAppToken.deferClearAllDrawn) { Loading Loading @@ -189,7 +189,7 @@ public class AppWindowAnimator { } // This must be called while inside a transaction. boolean stepAnimationLocked(long currentTime, int dw, int dh) { boolean stepAnimationLocked(long currentTime) { if (mService.okToDisplay()) { // We will run animations as long as the display isn't frozen. Loading @@ -206,12 +206,8 @@ public class AppWindowAnimator { if (!animating) { if (WindowManagerService.DEBUG_ANIM) Slog.v( TAG, "Starting animation in " + mAppToken + " @ " + currentTime + ": dw=" + dw + " dh=" + dh + " scale=" + mService.mTransitionAnimationScale " @ " + currentTime + " scale=" + mService.mTransitionAnimationScale + " allDrawn=" + mAppToken.allDrawn + " animating=" + animating); if (!animInitialized) { animation.initialize(dw, dh, dw, dh); } animation.setStartTime(currentTime); animating = true; if (thumbnail != null) { Loading Loading @@ -290,8 +286,7 @@ public class AppWindowAnimator { pw.print(" allDrawn="); pw.print(allDrawn); pw.print(" animLayerAdjustment="); pw.println(animLayerAdjustment); if (animating || animation != null) { pw.print(prefix); pw.print("animating="); pw.print(animating); pw.print(" animInitialized="); pw.println(animInitialized); pw.print(prefix); pw.print("animating="); pw.println(animating); pw.print(prefix); pw.print("animation="); pw.println(animation); } if (hasTransformation) { Loading services/java/com/android/server/wm/DimSurface.java +9 −2 Original line number Diff line number Diff line Loading @@ -18,6 +18,7 @@ package com.android.server.wm; import android.graphics.PixelFormat; import android.util.Slog; import android.view.DisplayInfo; import android.view.Surface; import android.view.SurfaceSession; Loading @@ -31,8 +32,11 @@ class DimSurface { int mDimColor = 0; int mLayer = -1; int mLastDimWidth, mLastDimHeight; final DisplayContent mDisplayContent; DimSurface(SurfaceSession session, final int layerStack) { DimSurface(SurfaceSession session, DisplayContent displayContent) { mDisplayContent = displayContent; final int layerStack = displayContent.getDisplayId(); try { if (WindowManagerService.DEBUG_SURFACE_TRACE) { mDimSurface = new WindowStateAnimator.SurfaceTrace(session, Loading @@ -58,7 +62,10 @@ class DimSurface { /** * Show the dim surface. */ void show(int dw, int dh, int layer, int color) { void show(int layer, int color) { final DisplayInfo info = mDisplayContent.getDisplayInfo(); final int dw = info.logicalWidth; final int dh = info.logicalHeight; if (mDimSurface == null) { Slog.e(TAG, "show: no Surface"); return; Loading services/java/com/android/server/wm/WindowAnimator.java +7 −26 Original line number Diff line number Diff line Loading @@ -52,13 +52,6 @@ public class WindowAnimator { // Layout changes for individual Displays. Indexed by displayId. SparseIntArray mPendingLayoutChanges = new SparseIntArray(); // TODO: Assign these from each iteration through DisplayContent. Only valid between loops. /** Overall window dimensions */ int mDw, mDh; /** Interior window dimensions */ int mInnerDw, mInnerDh; /** Time of current animation step. Reset on each iteration */ long mCurrentTime; Loading Loading @@ -311,7 +304,7 @@ public class WindowAnimator { final AppWindowAnimator appAnimator = mAppAnimators.get(i); final boolean wasAnimating = appAnimator.animation != null && appAnimator.animation != AppWindowAnimator.sDummyAnimation; if (appAnimator.stepAnimationLocked(mCurrentTime, mInnerDw, mInnerDh)) { if (appAnimator.stepAnimationLocked(mCurrentTime)) { mAnimating = true; } else if (wasAnimating) { // stopped animating, do one more pass through the layout Loading @@ -327,7 +320,7 @@ public class WindowAnimator { final AppWindowAnimator appAnimator = mService.mExitingAppTokens.get(i).mAppAnimator; final boolean wasAnimating = appAnimator.animation != null && appAnimator.animation != AppWindowAnimator.sDummyAnimation; if (appAnimator.stepAnimationLocked(mCurrentTime, mInnerDw, mInnerDh)) { if (appAnimator.stepAnimationLocked(mCurrentTime)) { mAnimating = true; } else if (wasAnimating) { // stopped animating, do one more pass through the layout Loading Loading @@ -579,7 +572,7 @@ public class WindowAnimator { } if (windowAnimationBackgroundSurface != null) { windowAnimationBackgroundSurface.show(mDw, mDh, windowAnimationBackgroundSurface.show( animLayer - WindowManagerService.LAYER_OFFSET_DIM, windowAnimationBackgroundColor); } Loading @@ -590,9 +583,9 @@ public class WindowAnimator { } } /** See if any windows have been drawn, so they (and others associated with them) can now be * shown. */ private void testTokenMayBeDrawnLocked() { // See if any windows have been drawn, so they (and others // associated with them) can now be shown. final int NT = mAppAnimators.size(); for (int i=0; i<NT; i++) { AppWindowAnimator appAnimator = mAppAnimators.get(i); Loading Loading @@ -750,14 +743,6 @@ public class WindowAnimator { mCurrentFocus = currentFocus; } void setDisplayDimensions(final int curWidth, final int curHeight, final int appWidth, final int appHeight) { mDw = curWidth; mDh = curHeight; mInnerDw = appWidth; mInnerDh = appHeight; } boolean isDimmingLocked(int displayId) { return getDisplayContentsAnimatorLocked(displayId).mDimParams != null; } Loading Loading @@ -876,10 +861,6 @@ public class WindowAnimator { pw.print(" mForceHiding="); pw.println(forceHidingToString()); pw.print(prefix); pw.print("mCurrentTime="); pw.println(TimeUtils.formatUptime(mCurrentTime)); pw.print(prefix); pw.print("mDw="); pw.print(mDw); pw.print(" mDh="); pw.print(mDh); pw.print(" mInnerDw="); pw.print(mInnerDw); pw.print(" mInnerDh="); pw.println(mInnerDh); } if (mBulkUpdateParams != 0) { pw.print(prefix); pw.print("mBulkUpdateParams=0x"); Loading Loading @@ -961,8 +942,8 @@ public class WindowAnimator { public DisplayContentsAnimator(int displayId) { mDimAnimator = new DimAnimator(mService.mFxSession, displayId); mWindowAnimationBackgroundSurface = new DimSurface(mService.mFxSession, displayId); mWindowAnimationBackgroundSurface = new DimSurface(mService.mFxSession, mService.getDisplayContentLocked(displayId)); } } } services/java/com/android/server/wm/WindowManagerService.java +4 −10 Original line number Diff line number Diff line Loading @@ -3076,10 +3076,11 @@ public class WindowManagerService extends IWindowManager.Stub // is running. if (okToDisplay()) { DisplayInfo displayInfo = getDefaultDisplayInfoLocked(); final int width = displayInfo.appWidth; final int height = displayInfo.appHeight; if (DEBUG_APP_TRANSITIONS || DEBUG_ANIM) Slog.v(TAG, "applyAnimation: atoken=" + atoken); Animation a = mAppTransition.loadAnimation(lp, transit, enter, displayInfo.appWidth, displayInfo.appHeight); Animation a = mAppTransition.loadAnimation(lp, transit, enter, width, height); if (a != null) { if (DEBUG_ANIM) { RuntimeException e = null; Loading @@ -3089,7 +3090,7 @@ public class WindowManagerService extends IWindowManager.Stub } Slog.v(TAG, "Loaded animation " + a + " for " + atoken, e); } atoken.mAppAnimator.setAnimation(a); atoken.mAppAnimator.setAnimation(a, width, height); } } else { atoken.mAppAnimator.clearAnimation(); Loading Loading @@ -6257,8 +6258,6 @@ public class WindowManagerService extends IWindowManager.Stub displayInfo.getAppMetrics(mDisplayMetrics, null); mDisplayManagerService.setDisplayInfoOverrideFromWindowManager( displayContent.getDisplayId(), displayInfo); mAnimator.setDisplayDimensions(dw, dh, appWidth, appHeight); } if (false) { Slog.i(TAG, "Set app display size: " + appWidth + " x " + appHeight); Loading Loading @@ -6563,11 +6562,6 @@ public class WindowManagerService extends IWindowManager.Stub mIsTouchDevice = mContext.getPackageManager().hasSystemFeature( PackageManager.FEATURE_TOUCHSCREEN); final DisplayInfo displayInfo = getDefaultDisplayInfoLocked(); mAnimator.setDisplayDimensions( displayInfo.logicalWidth, displayInfo.logicalHeight, displayInfo.appWidth, displayInfo.appHeight); mPolicy.setInitialDisplaySize(displayContent.getDisplay(), displayContent.mInitialDisplayWidth, displayContent.mInitialDisplayHeight, Loading Loading
services/java/com/android/server/wm/AppWindowAnimator.java +9 −14 Original line number Diff line number Diff line Loading @@ -22,7 +22,6 @@ public class AppWindowAnimator { boolean animating; Animation animation; boolean animInitialized; boolean hasTransformation; final Transformation transformation = new Transformation(); Loading Loading @@ -58,12 +57,15 @@ public class AppWindowAnimator { mAnimator = atoken.mAnimator; } public void setAnimation(Animation anim) { public void setAnimation(Animation anim, int width, int height) { if (WindowManagerService.localLOGV) Slog.v( TAG, "Setting animation in " + mAppToken + ": " + anim); TAG, "Setting animation in " + mAppToken + ": " + anim + " wxh=" + width + "x" + height); animation = anim; animating = false; animInitialized = anim.isInitialized(); if (!anim.isInitialized()) { anim.initialize(width, height, width, height); } anim.restrictDuration(WindowManagerService.MAX_ANIMATION_DURATION); anim.scaleCurrentDuration(mService.mTransitionAnimationScale); int zorder = anim.getZAdjustment(); Loading @@ -87,7 +89,6 @@ public class AppWindowAnimator { public void setDummyAnimation() { if (WindowManagerService.localLOGV) Slog.v(TAG, "Setting dummy animation in " + mAppToken); animation = sDummyAnimation; animInitialized = false; hasTransformation = true; transformation.clear(); transformation.setAlpha(mAppToken.reportedVisible ? 1 : 0); Loading @@ -97,7 +98,6 @@ public class AppWindowAnimator { if (animation != null) { animation = null; animating = true; animInitialized = false; } clearThumbnail(); if (mAppToken.deferClearAllDrawn) { Loading Loading @@ -189,7 +189,7 @@ public class AppWindowAnimator { } // This must be called while inside a transaction. boolean stepAnimationLocked(long currentTime, int dw, int dh) { boolean stepAnimationLocked(long currentTime) { if (mService.okToDisplay()) { // We will run animations as long as the display isn't frozen. Loading @@ -206,12 +206,8 @@ public class AppWindowAnimator { if (!animating) { if (WindowManagerService.DEBUG_ANIM) Slog.v( TAG, "Starting animation in " + mAppToken + " @ " + currentTime + ": dw=" + dw + " dh=" + dh + " scale=" + mService.mTransitionAnimationScale " @ " + currentTime + " scale=" + mService.mTransitionAnimationScale + " allDrawn=" + mAppToken.allDrawn + " animating=" + animating); if (!animInitialized) { animation.initialize(dw, dh, dw, dh); } animation.setStartTime(currentTime); animating = true; if (thumbnail != null) { Loading Loading @@ -290,8 +286,7 @@ public class AppWindowAnimator { pw.print(" allDrawn="); pw.print(allDrawn); pw.print(" animLayerAdjustment="); pw.println(animLayerAdjustment); if (animating || animation != null) { pw.print(prefix); pw.print("animating="); pw.print(animating); pw.print(" animInitialized="); pw.println(animInitialized); pw.print(prefix); pw.print("animating="); pw.println(animating); pw.print(prefix); pw.print("animation="); pw.println(animation); } if (hasTransformation) { Loading
services/java/com/android/server/wm/DimSurface.java +9 −2 Original line number Diff line number Diff line Loading @@ -18,6 +18,7 @@ package com.android.server.wm; import android.graphics.PixelFormat; import android.util.Slog; import android.view.DisplayInfo; import android.view.Surface; import android.view.SurfaceSession; Loading @@ -31,8 +32,11 @@ class DimSurface { int mDimColor = 0; int mLayer = -1; int mLastDimWidth, mLastDimHeight; final DisplayContent mDisplayContent; DimSurface(SurfaceSession session, final int layerStack) { DimSurface(SurfaceSession session, DisplayContent displayContent) { mDisplayContent = displayContent; final int layerStack = displayContent.getDisplayId(); try { if (WindowManagerService.DEBUG_SURFACE_TRACE) { mDimSurface = new WindowStateAnimator.SurfaceTrace(session, Loading @@ -58,7 +62,10 @@ class DimSurface { /** * Show the dim surface. */ void show(int dw, int dh, int layer, int color) { void show(int layer, int color) { final DisplayInfo info = mDisplayContent.getDisplayInfo(); final int dw = info.logicalWidth; final int dh = info.logicalHeight; if (mDimSurface == null) { Slog.e(TAG, "show: no Surface"); return; Loading
services/java/com/android/server/wm/WindowAnimator.java +7 −26 Original line number Diff line number Diff line Loading @@ -52,13 +52,6 @@ public class WindowAnimator { // Layout changes for individual Displays. Indexed by displayId. SparseIntArray mPendingLayoutChanges = new SparseIntArray(); // TODO: Assign these from each iteration through DisplayContent. Only valid between loops. /** Overall window dimensions */ int mDw, mDh; /** Interior window dimensions */ int mInnerDw, mInnerDh; /** Time of current animation step. Reset on each iteration */ long mCurrentTime; Loading Loading @@ -311,7 +304,7 @@ public class WindowAnimator { final AppWindowAnimator appAnimator = mAppAnimators.get(i); final boolean wasAnimating = appAnimator.animation != null && appAnimator.animation != AppWindowAnimator.sDummyAnimation; if (appAnimator.stepAnimationLocked(mCurrentTime, mInnerDw, mInnerDh)) { if (appAnimator.stepAnimationLocked(mCurrentTime)) { mAnimating = true; } else if (wasAnimating) { // stopped animating, do one more pass through the layout Loading @@ -327,7 +320,7 @@ public class WindowAnimator { final AppWindowAnimator appAnimator = mService.mExitingAppTokens.get(i).mAppAnimator; final boolean wasAnimating = appAnimator.animation != null && appAnimator.animation != AppWindowAnimator.sDummyAnimation; if (appAnimator.stepAnimationLocked(mCurrentTime, mInnerDw, mInnerDh)) { if (appAnimator.stepAnimationLocked(mCurrentTime)) { mAnimating = true; } else if (wasAnimating) { // stopped animating, do one more pass through the layout Loading Loading @@ -579,7 +572,7 @@ public class WindowAnimator { } if (windowAnimationBackgroundSurface != null) { windowAnimationBackgroundSurface.show(mDw, mDh, windowAnimationBackgroundSurface.show( animLayer - WindowManagerService.LAYER_OFFSET_DIM, windowAnimationBackgroundColor); } Loading @@ -590,9 +583,9 @@ public class WindowAnimator { } } /** See if any windows have been drawn, so they (and others associated with them) can now be * shown. */ private void testTokenMayBeDrawnLocked() { // See if any windows have been drawn, so they (and others // associated with them) can now be shown. final int NT = mAppAnimators.size(); for (int i=0; i<NT; i++) { AppWindowAnimator appAnimator = mAppAnimators.get(i); Loading Loading @@ -750,14 +743,6 @@ public class WindowAnimator { mCurrentFocus = currentFocus; } void setDisplayDimensions(final int curWidth, final int curHeight, final int appWidth, final int appHeight) { mDw = curWidth; mDh = curHeight; mInnerDw = appWidth; mInnerDh = appHeight; } boolean isDimmingLocked(int displayId) { return getDisplayContentsAnimatorLocked(displayId).mDimParams != null; } Loading Loading @@ -876,10 +861,6 @@ public class WindowAnimator { pw.print(" mForceHiding="); pw.println(forceHidingToString()); pw.print(prefix); pw.print("mCurrentTime="); pw.println(TimeUtils.formatUptime(mCurrentTime)); pw.print(prefix); pw.print("mDw="); pw.print(mDw); pw.print(" mDh="); pw.print(mDh); pw.print(" mInnerDw="); pw.print(mInnerDw); pw.print(" mInnerDh="); pw.println(mInnerDh); } if (mBulkUpdateParams != 0) { pw.print(prefix); pw.print("mBulkUpdateParams=0x"); Loading Loading @@ -961,8 +942,8 @@ public class WindowAnimator { public DisplayContentsAnimator(int displayId) { mDimAnimator = new DimAnimator(mService.mFxSession, displayId); mWindowAnimationBackgroundSurface = new DimSurface(mService.mFxSession, displayId); mWindowAnimationBackgroundSurface = new DimSurface(mService.mFxSession, mService.getDisplayContentLocked(displayId)); } } }
services/java/com/android/server/wm/WindowManagerService.java +4 −10 Original line number Diff line number Diff line Loading @@ -3076,10 +3076,11 @@ public class WindowManagerService extends IWindowManager.Stub // is running. if (okToDisplay()) { DisplayInfo displayInfo = getDefaultDisplayInfoLocked(); final int width = displayInfo.appWidth; final int height = displayInfo.appHeight; if (DEBUG_APP_TRANSITIONS || DEBUG_ANIM) Slog.v(TAG, "applyAnimation: atoken=" + atoken); Animation a = mAppTransition.loadAnimation(lp, transit, enter, displayInfo.appWidth, displayInfo.appHeight); Animation a = mAppTransition.loadAnimation(lp, transit, enter, width, height); if (a != null) { if (DEBUG_ANIM) { RuntimeException e = null; Loading @@ -3089,7 +3090,7 @@ public class WindowManagerService extends IWindowManager.Stub } Slog.v(TAG, "Loaded animation " + a + " for " + atoken, e); } atoken.mAppAnimator.setAnimation(a); atoken.mAppAnimator.setAnimation(a, width, height); } } else { atoken.mAppAnimator.clearAnimation(); Loading Loading @@ -6257,8 +6258,6 @@ public class WindowManagerService extends IWindowManager.Stub displayInfo.getAppMetrics(mDisplayMetrics, null); mDisplayManagerService.setDisplayInfoOverrideFromWindowManager( displayContent.getDisplayId(), displayInfo); mAnimator.setDisplayDimensions(dw, dh, appWidth, appHeight); } if (false) { Slog.i(TAG, "Set app display size: " + appWidth + " x " + appHeight); Loading Loading @@ -6563,11 +6562,6 @@ public class WindowManagerService extends IWindowManager.Stub mIsTouchDevice = mContext.getPackageManager().hasSystemFeature( PackageManager.FEATURE_TOUCHSCREEN); final DisplayInfo displayInfo = getDefaultDisplayInfoLocked(); mAnimator.setDisplayDimensions( displayInfo.logicalWidth, displayInfo.logicalHeight, displayInfo.appWidth, displayInfo.appHeight); mPolicy.setInitialDisplaySize(displayContent.getDisplay(), displayContent.mInitialDisplayWidth, displayContent.mInitialDisplayHeight, Loading