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

Commit 4844e6f8 authored by Galia Peycheva's avatar Galia Peycheva Committed by Automerger Merge Worker
Browse files

Merge "Fix SF crashing when blur layer rect is empty" into sc-dev am: 21edd573

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/native/+/13876046

Change-Id: I3ae9634c14c3a47ae47056d5112176e9152bb801
parents 0ea4b798 21edd573
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