Merge "Dedupe non-perceptable depth updates" into ub-launcher3-rvc-dev
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;
}