From cc3eccf57830ba1996266cb0fd0b01b9a07c65c3 Mon Sep 17 00:00:00 2001 From: Chong Zhang Date: Mon, 16 May 2016 18:25:45 -0700 Subject: [PATCH] Apply final crop during surface preservation Apply stack crop to the preserved surface so that it doesn't stick over the dock divider. bug: 28567495 Change-Id: Ib7a9d8ec82a7752ecbef60a86f441e35e16ac877 --- .../java/com/android/server/wm/WindowStateAnimator.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/services/core/java/com/android/server/wm/WindowStateAnimator.java b/services/core/java/com/android/server/wm/WindowStateAnimator.java index acf16896a8184..52273dced231c 100644 --- a/services/core/java/com/android/server/wm/WindowStateAnimator.java +++ b/services/core/java/com/android/server/wm/WindowStateAnimator.java @@ -1298,6 +1298,9 @@ class WindowStateAnimator { if (!finalClipRect.equals(mLastFinalClipRect)) { mLastFinalClipRect.set(finalClipRect); mSurfaceController.setFinalCropInTransaction(finalClipRect); + if (mDestroyPreservedSurfaceUponRedraw && mPendingDestroySurface != null) { + mPendingDestroySurface.setFinalCropInTransaction(finalClipRect); + } } } @@ -1370,7 +1373,8 @@ class WindowStateAnimator { // If we are animating, we either apply the clip before applying all the animation // transformation or after all the transformation. - final boolean useFinalClipRect = isAnimationSet() && stackClip == STACK_CLIP_AFTER_ANIM; + final boolean useFinalClipRect = isAnimationSet() && stackClip == STACK_CLIP_AFTER_ANIM + || mDestroyPreservedSurfaceUponRedraw; // We need to do some acrobatics with surface position, because their clip region is // relative to the inside of the surface, but the stack bounds aren't.