Merge "Get rid of some animation flickers and other bad things."
This commit is contained in:
committed by
Android (Google) Code Review
commit
1cd955b01d
@@ -53,19 +53,22 @@ class DimSurface {
|
||||
void show(int dw, int dh, int layer, int color) {
|
||||
if (!mDimShown) {
|
||||
if (WindowManagerService.SHOW_TRANSACTIONS) Slog.i(WindowManagerService.TAG, " DIM " + mDimSurface + ": SHOW pos=(0,0) (" +
|
||||
dw + "x" + dh + ")");
|
||||
dw + "x" + dh + " layer=" + layer + ")");
|
||||
mDimShown = true;
|
||||
try {
|
||||
mLastDimWidth = dw;
|
||||
mLastDimHeight = dh;
|
||||
mDimSurface.setPosition(0, 0);
|
||||
mDimSurface.setSize(dw, dh);
|
||||
mDimSurface.setLayer(layer);
|
||||
mDimSurface.show();
|
||||
} catch (RuntimeException e) {
|
||||
Slog.w(WindowManagerService.TAG, "Failure showing dim surface", e);
|
||||
}
|
||||
} else if (mLastDimWidth != dw || mLastDimHeight != dh || mDimColor != color
|
||||
|| mLayer != layer) {
|
||||
if (WindowManagerService.SHOW_TRANSACTIONS) Slog.i(WindowManagerService.TAG, " DIM " + mDimSurface + ": pos=(0,0) (" +
|
||||
dw + "x" + dh + " layer=" + layer + ")");
|
||||
mLastDimWidth = dw;
|
||||
mLastDimHeight = dh;
|
||||
mLayer = layer;
|
||||
@@ -80,6 +83,7 @@ class DimSurface {
|
||||
if (mDimShown) {
|
||||
mDimShown = false;
|
||||
try {
|
||||
if (WindowManagerService.SHOW_TRANSACTIONS) Slog.i(WindowManagerService.TAG, " HIDE " + mDimSurface);
|
||||
mDimSurface.hide();
|
||||
} catch (RuntimeException e) {
|
||||
Slog.w(WindowManagerService.TAG, "Illegal argument exception hiding dim surface");
|
||||
|
||||
@@ -7458,9 +7458,12 @@ public class WindowManagerService extends IWindowManager.Stub
|
||||
windowDetachedWallpaper = w;
|
||||
}
|
||||
if (w.mAnimation.getBackgroundColor() != 0) {
|
||||
windowAnimationBackground = w;
|
||||
windowAnimationBackgroundColor =
|
||||
w.mAnimation.getBackgroundColor();
|
||||
if (windowAnimationBackground == null || w.mAnimLayer <
|
||||
windowAnimationBackground.mAnimLayer) {
|
||||
windowAnimationBackground = w;
|
||||
windowAnimationBackgroundColor =
|
||||
w.mAnimation.getBackgroundColor();
|
||||
}
|
||||
}
|
||||
}
|
||||
animating = true;
|
||||
@@ -7469,14 +7472,18 @@ public class WindowManagerService extends IWindowManager.Stub
|
||||
// If this window's app token is running a detached wallpaper
|
||||
// animation, make a note so we can ensure the wallpaper is
|
||||
// displayed behind it.
|
||||
if (w.mAppToken != null && w.mAppToken.animation != null) {
|
||||
if (w.mAppToken != null && w.mAppToken.animation != null
|
||||
&& w.mAppToken.animating) {
|
||||
if (w.mAppToken.animation.getDetachWallpaper()) {
|
||||
windowDetachedWallpaper = w;
|
||||
}
|
||||
if (w.mAppToken.animation.getBackgroundColor() != 0) {
|
||||
windowAnimationBackground = w;
|
||||
windowAnimationBackgroundColor =
|
||||
w.mAppToken.animation.getBackgroundColor();
|
||||
if (windowAnimationBackground == null || w.mAnimLayer <
|
||||
windowAnimationBackground.mAnimLayer) {
|
||||
windowAnimationBackground = w;
|
||||
windowAnimationBackgroundColor =
|
||||
w.mAppToken.animation.getBackgroundColor();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user