summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author TreeHugger Robot <treehugger-gerrit@google.com> 2017-08-08 22:55:33 +0000
committer Android (Google) Code Review <android-gerrit@google.com> 2017-08-08 22:55:33 +0000
commit75176be75a16b7deb214740e55507359aca2edac (patch)
tree852d8e00024a08f153ea28d3de02be75545c4a30
parent3edc463902259d25e94d81d8c3ee0de2f5d1f32b (diff)
parent58194b579cf9bc9a313ac96316474e9d02b48363 (diff)
Merge "Round animation progress for computing size for background" into oc-dr1-dev
-rw-r--r--services/core/java/com/android/server/wm/SurfaceControlWithBackground.java5
1 files changed, 5 insertions, 0 deletions
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);