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

Commit 35fc2de9 authored by Treehugger Robot's avatar Treehugger Robot Committed by Automerger Merge Worker
Browse files

Merge "RenderEngine: Limit the size of blur input to the display size" into...

Merge "RenderEngine: Limit the size of blur input to the display size" into udc-dev am: be2ac9c7 am: f6dc23b2 am: 5df98513

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



Change-Id: I5c24216ce241d2c3b61a78c6cc2fa5b0a6071cfc
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 230ffca3 5df98513
Loading
Loading
Loading
Loading
+13 −1
Original line number Diff line number Diff line
@@ -818,8 +818,20 @@ void SkiaRenderEngine::drawLayersInternal(
            if (!blurInput) {
                blurInput = activeSurface->makeImageSnapshot();
            }

            // rect to be blurred in the coordinate space of blurInput
            const auto blurRect = canvas->getTotalMatrix().mapRect(bounds.rect());
            SkRect blurRect = canvas->getTotalMatrix().mapRect(bounds.rect());

            // Some layers may be much bigger than the screen. If we used
            // `blurRect` directly, this would allocate a large buffer with no
            // benefit. Apply the clip, which already takes the display size
            // into account. The clipped size will then be used to calculate the
            // size of the buffer we will create for blurring.
            if (!blurRect.intersect(SkRect::Make(canvas->getDeviceClipBounds()))) {
                // This should not happen, but if it did, we would use the full
                // sized layer, which should still be fine.
                ALOGW("blur bounds does not intersect display clip!");
            }

            // if the clip needs to be applied then apply it now and make sure
            // it is restored before we attempt to draw any shadows.