summaryrefslogtreecommitdiffstats
path: root/services
diff options
context:
space:
mode:
authorCraig Mautner <cmautner@google.com>2012-12-17 17:21:55 -0800
committerCraig Mautner <cmautner@google.com>2012-12-17 17:35:58 -0800
commit3be73abc69eaef80c6d27169ca5f15e283a9debc (patch)
treee9cf02b46cc2f5e674cc93c9e0d14068d04f05b5 /services
parentda013c48d74aae3c5723eb569ebb324a94db27f2 (diff)
downloadframeworks_base-3be73abc69eaef80c6d27169ca5f15e283a9debc.zip
frameworks_base-3be73abc69eaef80c6d27169ca5f15e283a9debc.tar.gz
frameworks_base-3be73abc69eaef80c6d27169ca5f15e283a9debc.tar.bz2
Fade recents thumbnail to transparent earlier.
Reduce the gpu load by fading the recents thumbnail to an alpha of 0.0 before the remaining animations are completed. When alpha hits 0 the gpu treats the layer as hidden and can merge the remaining layers in time. This is a partial fix for 7729214. Change-Id: I9761bbd0554db6454c7eec0485be798b11672ff5
Diffstat (limited to 'services')
-rwxr-xr-xservices/java/com/android/server/wm/WindowManagerService.java20
1 files changed, 17 insertions, 3 deletions
diff --git a/services/java/com/android/server/wm/WindowManagerService.java b/services/java/com/android/server/wm/WindowManagerService.java
index 746254e..5b9fc9a 100755
--- a/services/java/com/android/server/wm/WindowManagerService.java
+++ b/services/java/com/android/server/wm/WindowManagerService.java
@@ -268,6 +268,9 @@ public class WindowManagerService extends IWindowManager.Stub
/** Amount of time (in milliseconds) to delay before declaring a window freeze timeout. */
static final int WINDOW_FREEZE_TIMEOUT_DURATION = 2000;
+ /** Fraction of animation at which the recents thumbnail becomes completely transparent */
+ static final float RECENTS_THUMBNAIL_FADEOUT_FRACTION = 0.25f;
+
/**
* If true, the window manager will do its own custom freezing and general
* management of the screen during rotation.
@@ -3383,13 +3386,24 @@ public class WindowManagerService extends IWindowManager.Stub
Animation scale = new ScaleAnimation(1, scaleW, 1, scaleH,
computePivot(mNextAppTransitionStartX, 1 / scaleW),
computePivot(mNextAppTransitionStartY, 1 / scaleH));
- AnimationSet set = new AnimationSet(true);
+ AnimationSet set = new AnimationSet(false);
Animation alpha = new AlphaAnimation(1, 0);
scale.setDuration(duration);
- scale.setInterpolator(
- new DecelerateInterpolator(THUMBNAIL_ANIMATION_DECELERATE_FACTOR));
+ scale.setInterpolator(AnimationUtils.loadInterpolator(mContext,
+ com.android.internal.R.interpolator.decelerate_quad));
set.addAnimation(scale);
alpha.setDuration(duration);
+ alpha.setInterpolator(new Interpolator() {
+ @Override
+ public float getInterpolation(float input) {
+ if (input < RECENTS_THUMBNAIL_FADEOUT_FRACTION) {
+ // linear response
+ return input / RECENTS_THUMBNAIL_FADEOUT_FRACTION;
+ }
+ // complete
+ return 1;
+ }
+ });
set.addAnimation(alpha);
set.setFillBefore(true);
a = set;