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

Commit 21edd573 authored by Galia Peycheva's avatar Galia Peycheva Committed by Android (Google) Code Review
Browse files

Merge "Fix SF crashing when blur layer rect is empty" into sc-dev

parents f0dcab5d e425ac83
Loading
Loading
Loading
Loading
+23 −20
Original line number Diff line number Diff line
@@ -821,6 +821,8 @@ status_t SkiaGLRenderEngine::drawLayers(const DisplaySettings& display,
            // rect to be blurred in the coordinate space of blurInput
            const auto blurRect = canvas->getTotalMatrix().mapRect(bounds);

            // TODO(b/182216890): Filter out empty layers earlier
            if (blurRect.width() > 0 && blurRect.height() > 0) {
                if (layer->backgroundBlurRadius > 0) {
                    ATRACE_NAME("BackgroundBlur");
                    auto blurredImage =
@@ -829,8 +831,8 @@ status_t SkiaGLRenderEngine::drawLayers(const DisplaySettings& display,

                    cachedBlurs[layer->backgroundBlurRadius] = blurredImage;

                mBlurFilter->drawBlurRegion(canvas, getBlurRegion(layer), blurRect, blurredImage,
                                            blurInput);
                    mBlurFilter->drawBlurRegion(canvas, getBlurRegion(layer), blurRect,
                                                blurredImage, blurInput);
                }
                for (auto region : layer->blurRegions) {
                    if (cachedBlurs[region.blurRadius] == nullptr) {
@@ -844,6 +846,7 @@ status_t SkiaGLRenderEngine::drawLayers(const DisplaySettings& display,
                                                cachedBlurs[region.blurRadius], blurInput);
                }
            }
        }

        // Shadows are assumed to live only on their own layer - it's not valid
        // to draw the boundary rectangles when there is already a caster shadow