Merge "Do not blur if all apps is fully visible" into ub-launcher3-rvc-dev

This commit is contained in:
Lucas Dupin
2020-04-30 17:11:53 +00:00
committed by Android (Google) Code Review
@@ -193,8 +193,17 @@ public class DepthController implements LauncherStateManager.StateHandler {
if (windowToken != null) {
mWallpaperManager.setWallpaperZoomOut(windowToken, mDepth);
}
final int blur;
if (mLauncher.isInState(LauncherState.ALL_APPS) && mDepth == 1) {
// All apps has a solid background. We don't need to draw blurs after it's fully
// visible. This will take us out of GPU composition, saving battery and increasing
// performance.
blur = 0;
} else {
blur = (int) (mDepth * mMaxBlurRadius);
}
new TransactionCompat()
.setBackgroundBlurRadius(mSurface, (int) (mDepth * mMaxBlurRadius))
.setBackgroundBlurRadius(mSurface, blur)
.apply();
}
}