// use growToInclude to fit skp round rects & generate stats (RRs vs. real paths)
// check on # of rectorus's the RRs could handle
// rendering work
-// add entry points (clipRRect, drawRRect) - plumb down to SkBaseDevice
-// update SkPath.addRRect() to take an SkRRect - only use quads
-// -- alternatively add addRRectToPath here
+// update SkPath.addRRect() to only use quads
// add GM and bench
-// clipping opt
-// update SkClipStack to perform logic with RRs
// further out
-// add RR rendering shader to Ganesh (akin to cicle drawing code)
-// - only for simple RRs
// detect and triangulate RRectorii rather than falling back to SW in Ganesh
//
if (rrect.isRect()) {
// call the non-virtual version
return this->SkCanvas::clipRect(rrect.getBounds(), op, doAA);
- } else {
- SkPath path;
- path.addRRect(rrect);
- // call the non-virtual version
- return this->SkCanvas::clipPath(path, op, doAA);
}
+
+ SkRRect transformedRRect;
+ if (rrect.transform(*fMCRec->fMatrix, &transformedRRect)) {
+ AutoValidateClip avc(this);
+
+ fDeviceCMDirty = true;
+ fCachedLocalClipBoundsDirty = true;
+ doAA &= fAllowSoftClip;
+
+ fClipStack.clipDevRRect(transformedRRect, op, doAA);
+
+ SkPath devPath;
+ devPath.addRRect(transformedRRect);
+
+ return clipPathHelper(this, fMCRec->fRasterClip, devPath, op, doAA);
+ }
+
+ SkPath path;
+ path.addRRect(rrect);
+ // call the non-virtual version
+ return this->SkCanvas::clipPath(path, op, doAA);
}
bool SkCanvas::clipPath(const SkPath& path, SkRegion::Op op, bool doAA) {