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

Commit 55bf4746 authored by Leon Scroggins III's avatar Leon Scroggins III
Browse files

Skip a step when blurring

backgroundBlurRadius blurs the entire content behind the current layer.
The way we implement it is to draw into an off-screen and use that as
the source for the blur. But we draw the unblurred off-screen first.
This isn't necessary.

Bug: 206674290
Test: manual: notification shade, SilkFX app
Change-Id: I4caa7ef3b5357c723fdc81c8e18b159c87366b60
parent 092400a9
Loading
Loading
Loading
Loading
+15 −12
Original line number Diff line number Diff line
@@ -872,8 +872,10 @@ void SkiaGLRenderEngine::drawLayersInternal(
            // save a snapshot of the activeSurface to use as input to the blur shaders
            blurInput = activeSurface->makeImageSnapshot();

            // TODO we could skip this step if we know the blur will cover the entire image
            //  blit the offscreen framebuffer into the destination AHB
            // blit the offscreen framebuffer into the destination AHB, but only
            // if there are blur regions. backgroundBlurRadius blurs the entire
            // image below, so it can skip this step.
            if (layer.blurRegions.size()) {
                SkPaint paint;
                paint.setBlendMode(SkBlendMode::kSrc);
                if (CC_UNLIKELY(mCapture->isCaptureRunning())) {
@@ -885,6 +887,7 @@ void SkiaGLRenderEngine::drawLayersInternal(
                } else {
                    activeSurface->draw(dstCanvas, 0, 0, SkSamplingOptions(), &paint);
                }
            }

            // assign dstCanvas to canvas and ensure that the canvas state is up to date
            canvas = dstCanvas;