Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f66e7c19 authored by Winson Chung's avatar Winson Chung Committed by Android (Google) Code Review
Browse files

Merge "Dedupe non-perceptable depth updates" into ub-launcher3-rvc-dev

parents 19b873d0 20aeddd8
Loading
Loading
Loading
Loading
+8 −1
Original line number Diff line number Diff line
@@ -177,7 +177,14 @@ public class DepthController implements LauncherStateManager.StateHandler {
    }

    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;
        }