Fix wallpaper crop during unlock animation

Do not crop wallpaper if the wallpaper target is animating but stack
clip mode is not STACK_CLIP_AFTER_ANIM. We can't crop wallpaper with
final bounds as the crop needs to apply before the transform.

bug: 28887408
Change-Id: I62b9a5ca818c3ca8d0af26d807318f63747b8ac4
This commit is contained in:
Chong Zhang
2016-05-23 16:43:48 -07:00
parent 0a9ccf2619
commit 616c7c10b9

View File

@@ -1334,7 +1334,17 @@ class WindowStateAnimator {
final WindowState wallpaperTarget = mWallpaperControllerLocked.getWallpaperTarget();
if (wallpaperTarget != null) {
final Task task = wallpaperTarget.getTask();
if (task != null && !task.isFullscreen()) {
final WindowStateAnimator winAnimator = wallpaperTarget.mWinAnimator;
// We can only crop the wallpaper using final crop with stack bounds if the target
// is not animating, or if it's animating with clip mode STACK_CLIP_AFTER_ANIM.
// If it's animating with mode STACK_CLIP_NONE, we shouldn't crop either the task
// itself or the wallpaper. If it's animating with STACK_CLIP_BEFORE_ANIM, the crop
// is before the transform on the task itself.
final boolean useFinalCropOnWallpaper = !winAnimator.isAnimationSet()
|| winAnimator.resolveStackClip() == STACK_CLIP_AFTER_ANIM;
if (task != null && !task.isFullscreen()
&& task.cropWindowsToStackBounds()
&& useFinalCropOnWallpaper){
final TaskStack stack = task.mStack;
if (stack != null && !stack.isFullscreen()) {
stack.getDimBounds(mTmpStackBounds);
@@ -1459,7 +1469,7 @@ class WindowStateAnimator {
// We need to ensure for each surface, that we disable transformation matrix
// scaling in the same transaction which we resize the surface in.
// As we are in SCALING_MODE_SCALE_TO_WINDOW, SurfaceFlinger will
// then take over the scaling until the new buffer arrives, and things
// then take over the scaling until the new buffer arrives, and things
// will be seamless.
mForceScaleUntilResize = true;
} else {