From 58194b579cf9bc9a313ac96316474e9d02b48363 Mon Sep 17 00:00:00 2001 From: Andrii Kulian Date: Mon, 7 Aug 2017 15:53:44 -0700 Subject: Round animation progress for computing size for background Round background crop animation progress when it's less then epsilon to match fullscreen size and eliminate a line of couple pixels high bleeding through from an app underneath. This happens when animating letterboxed app from recents and can be visible at the end of animation below nav bar. Bug: 63156733 Bug: 62893418 Test: go/wm-smoke Test: Trigger animations to/from recents with different rotations. Change-Id: Ia4e93c81eac93a886007d53da3a685a69d4cb4de --- .../java/com/android/server/wm/SurfaceControlWithBackground.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/services/core/java/com/android/server/wm/SurfaceControlWithBackground.java b/services/core/java/com/android/server/wm/SurfaceControlWithBackground.java index f5ef2e66f0a6..85ea3c0e1fff 100644 --- a/services/core/java/com/android/server/wm/SurfaceControlWithBackground.java +++ b/services/core/java/com/android/server/wm/SurfaceControlWithBackground.java @@ -180,6 +180,11 @@ class SurfaceControlWithBackground extends SurfaceControl { // Compute new scaled width and height for background that will depend on current animation // progress. Those consist of current crop rect for the main surface + scaled areas outside // of letterboxed area. + // TODO: Because the progress is computed with low precision we're getting smaller values + // for background width/height then screen size at the end of the animation. Will round when + // the value is smaller then some empiric epsilon. However, this should be fixed by + // computing correct frames for letterboxed windows in WindowState. + d = d < 0.02f ? 0 : d; mWindowSurfaceController.getContainerRect(mTmpContainerRect); final int backgroundWidth = (int) (crop.width() + (mTmpContainerRect.width() - mLastWidth) * (1 - d) + 0.5); -- cgit v1.2.3-59-g8ed1b