From 264cb2ff68495b5fccbf06811fb0a3a19a7cb011 Mon Sep 17 00:00:00 2001 From: Lucas Dupin Date: Wed, 29 Apr 2020 10:40:58 -0700 Subject: [PATCH] Do not blur if all apps is fully visible Fixes: 155093795 Fixes: 155203546 Test: manual Change-Id: I30f4c027e5107a199791e908acbb7ffed94e6a77 --- .../launcher3/statehandlers/DepthController.java | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/quickstep/src/com/android/launcher3/statehandlers/DepthController.java b/quickstep/src/com/android/launcher3/statehandlers/DepthController.java index 5f5d6dc1f9..8c778c0653 100644 --- a/quickstep/src/com/android/launcher3/statehandlers/DepthController.java +++ b/quickstep/src/com/android/launcher3/statehandlers/DepthController.java @@ -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(); } }