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

Commit 5900c412 authored by Chandru S's avatar Chandru S
Browse files

Create renderEffect object only once as the blur radius does not change

Bug: 393219138
Test: NA
Flag: com.android.systemui.bouncer_ui_revamp
Change-Id: Ia36632ba2f76f5f558248cb014ae5ed03e8041d1
parent 54e7140b
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);
        }