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

Commit 53be7b79 authored by Florin Malita's avatar Florin Malita Committed by Android (Google) Code Review
Browse files

Merge "Implement SkCanvasGlue::clipRegion() using clipPath()."

parents 262d905e 1dc14ba3
Loading
Loading
Loading
Loading
+10 −1
Original line number Diff line number Diff line
@@ -298,7 +298,16 @@ public:
                               jlong deviceRgnHandle, jint op) {
        SkCanvas* canvas = getNativeCanvas(canvasHandle);
        SkRegion* deviceRgn = reinterpret_cast<SkRegion*>(deviceRgnHandle);
        canvas->clipRegion(*deviceRgn, static_cast<SkRegion::Op>(op));
        SkPath rgnPath;
        if (deviceRgn->getBoundaryPath(&rgnPath)) {
            // The region is specified in device space.
            SkMatrix savedMatrix = canvas->getTotalMatrix();
            canvas->resetMatrix();
            canvas->clipPath(rgnPath, static_cast<SkRegion::Op>(op));
            canvas->setMatrix(savedMatrix);
        } else {
            canvas->clipRect(SkRect::MakeEmpty(), static_cast<SkRegion::Op>(op));
        }
        return hasNonEmptyClip(*canvas);
    }