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

Commit 79d26c72 authored by Chris Craik's avatar Chris Craik
Browse files

Enable scissor for rounded outline clips

bug:17164074

Change-Id: I83ca428f4d7651c6774ab81ac390477fb90c5d38
parent 3acf66f5
Loading
Loading
Loading
Loading
+5 −3
Original line number Diff line number Diff line
@@ -196,13 +196,15 @@ void StatefulBaseRenderer::setClippingOutline(LinearAllocator& allocator, const
    float radius;
    if (!outline->getAsRoundRect(&bounds, &radius)) return; // only RR supported

    if (!MathUtils::isPositive(radius)) {
    bool outlineIsRounded = MathUtils::isPositive(radius);
    if (!outlineIsRounded || currentTransform()->isSimple()) {
        // TODO: consider storing this rect separately, so that this can't be replaced with clip ops
        clipRect(bounds.left, bounds.top, bounds.right, bounds.bottom, SkRegion::kIntersect_Op);
        return;
    }
    if (outlineIsRounded) {
        setClippingRoundRect(allocator, bounds, radius);
    }
}

void StatefulBaseRenderer::setClippingRoundRect(LinearAllocator& allocator,
        const Rect& rect, float radius) {