commit | 20aeddd853c3681ee31a34a7228979689eda5b63 | [log] [tgz] |
---|---|---|
author | Winson Chung <winsonc@google.com> | Fri Apr 17 16:16:44 2020 -0700 |
committer | Winson Chung <winsonc@google.com> | Fri Apr 17 16:16:44 2020 -0700 |
tree | eca7597ad80957a5a4c576cfca73062bfe498fce | |
parent | e9edbabbe2c171c783684e7721b2cd8c2f051a8a [diff] |
Dedupe non-perceptable depth updates Bug: 154304487 Change-Id: I6d96aca555932f4a51aed576d25f7150952bb562
diff --git a/quickstep/src/com/android/launcher3/statehandlers/DepthController.java b/quickstep/src/com/android/launcher3/statehandlers/DepthController.java index f83737e..5f5d6dc 100644 --- a/quickstep/src/com/android/launcher3/statehandlers/DepthController.java +++ b/quickstep/src/com/android/launcher3/statehandlers/DepthController.java
@@ -177,7 +177,14 @@ } private void setDepth(float depth) { - mDepth = depth; + // Round out the depth to dedupe frequent, non-perceptable updates + int depthI = (int) (depth * 256); + float depthF = depthI / 256f; + if (Float.compare(mDepth, depthF) == 0) { + return; + } + + mDepth = depthF; if (mSurface == null || !mSurface.isValid()) { return; }