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

Commit b7cc48ab 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 udc-dev am: be2ac9c7

parents cd35f59c be2ac9c7
Loading
Loading
Loading
Loading
+13 −1
Original line number Original line Diff line number Diff line
@@ -813,8 +813,20 @@ void SkiaRenderEngine::drawLayersInternal(
            if (!blurInput) {
            if (!blurInput) {
                blurInput = activeSurface->makeImageSnapshot();
                blurInput = activeSurface->makeImageSnapshot();
            }
            }

            // rect to be blurred in the coordinate space of blurInput
            // 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
            // if the clip needs to be applied then apply it now and make sure
            // it is restored before we attempt to draw any shadows.
            // it is restored before we attempt to draw any shadows.