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

Commit 20aeddd8 authored by Winson Chung's avatar Winson Chung
Browse files

Dedupe non-perceptable depth updates

Bug: 154304487
Change-Id: I6d96aca555932f4a51aed576d25f7150952bb562
parent e9edbabb
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;
        }