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

Commit 478ae569 authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Create renderEffect object only once as the blur radius does not change" into main

parents bf76d0d9 5900c412
Loading
Loading
Loading
Loading
+10 −6
Original line number Diff line number Diff line
@@ -527,6 +527,9 @@ public final class NotificationPanelViewController implements ShadeSurface, Dump
    private final ActivityStarter mActivityStarter;
    private final BrightnessMirrorShowingInteractor mBrightnessMirrorShowingInteractor;

    @Nullable
    private RenderEffect mBlurRenderEffect = null;

    @Inject
    public NotificationPanelViewController(NotificationPanelView view,
            NotificationWakeUpCoordinator coordinator,
@@ -912,13 +915,14 @@ public final class NotificationPanelViewController implements ShadeSurface, Dump

    private void handleBouncerShowingChanged(Boolean isBouncerShowing) {
        if (!com.android.systemui.Flags.bouncerUiRevamp()) return;

        if (isBouncerShowing && isExpanded()) {
            float shadeBlurEffect = mDepthController.getMaxBlurRadiusPx();
            mView.setRenderEffect(RenderEffect.createBlurEffect(
                    shadeBlurEffect,
                    shadeBlurEffect,
                    Shader.TileMode.CLAMP));
            if (mBlurRenderEffect == null) {
                mBlurRenderEffect = RenderEffect.createBlurEffect(
                        mDepthController.getMaxBlurRadiusPx(),
                        mDepthController.getMaxBlurRadiusPx(),
                        Shader.TileMode.CLAMP);
            }
            mView.setRenderEffect(mBlurRenderEffect);
        } else {
            mView.setRenderEffect(null);
        }