Merge "Make launcher opaque when scrim becomes opaque" into sc-dev

This commit is contained in:
Lucas Dupin
2021-05-20 23:11:46 +00:00
committed by Android (Google) Code Review
2 changed files with 17 additions and 9 deletions
@@ -217,17 +217,11 @@ public class DepthController implements StateHandler<LauncherState>,
}
if (supportsBlur) {
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);
}
boolean isOpaque = mLauncher.getScrimView().isFullyOpaque();
int blur = isOpaque ? 0 : (int) (mDepth * mMaxBlurRadius);
new TransactionCompat()
.setBackgroundBlurRadius(mSurface, blur)
.setOpaque(mSurface, isOpaque)
.apply();
}
}