Merge "Dedupe non-perceptable depth updates" into ub-launcher3-rvc-dev am: f66e7c19bd
Change-Id: Id17c69166c72dccaf55ceacdc6e82f423db28cf0
This commit is contained in:
commit
441790c425
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue