Index: include/core/SkCanvas.h |
=================================================================== |
--- include/core/SkCanvas.h (revision 13577) |
+++ include/core/SkCanvas.h (working copy) |
@@ -448,10 +448,9 @@ |
specified region. This does not intersect or in any other way account |
for the existing clip region. |
@param deviceRgn The region to copy into the current clip. |
- @return true if the new clip region is non-empty |
*/ |
- bool setClipRegion(const SkRegion& deviceRgn) { |
- return this->clipRegion(deviceRgn, SkRegion::kReplace_Op); |
+ void setClipRegion(const SkRegion& deviceRgn) { |
+ this->clipRegion(deviceRgn, SkRegion::kReplace_Op); |
} |
/** Return true if the specified rectangle, after being transformed by the |
@@ -979,7 +978,7 @@ |
* result, subsequent calls will be cheap (until the clip state changes, |
* which can happen on any clip..() or restore() call. |
*/ |
- bool isClipEmpty() const; |
+ virtual bool isClipEmpty() const; |
reed1
2014/02/27 18:43:50
Why does this need to be virtual, but not (also) g
robertphillips
2014/02/27 20:20:30
I learned about a new canvas entry point today. Pl
|
/** Return the current matrix on the canvas. |
This does not account for the translate in any of the devices. |
@@ -1078,6 +1077,16 @@ |
virtual void onDrawDRRect(const SkRRect&, const SkRRect&, const SkPaint&); |
+ enum ClipEdgeStyle { |
+ kHard_ClipEdgeStyle, |
+ kSoft_ClipEdgeStyle |
+ }; |
+ |
+ virtual void onClipRect(const SkRect& rect, SkRegion::Op op, ClipEdgeStyle edgeStyle); |
+ virtual void onClipRRect(const SkRRect& rrect, SkRegion::Op op, ClipEdgeStyle edgeStyle); |
+ virtual void onClipPath(const SkPath& path, SkRegion::Op op, ClipEdgeStyle edgeStyle); |
+ virtual void onClipRegion(const SkRegion& deviceRgn, SkRegion::Op op); |
+ |
// Returns the canvas to be used by DrawIter. Default implementation |
// returns this. Subclasses that encapsulate an indirect canvas may |
// need to overload this method. The impl must keep track of this, as it |
@@ -1094,7 +1103,7 @@ |
// Called by child classes that override clipPath and clipRRect to only |
// track fast conservative clip bounds, rather than exact clips. |
- bool updateClipConservativelyUsingBounds(const SkRect&, SkRegion::Op, |
+ void updateClipConservativelyUsingBounds(const SkRect&, SkRegion::Op, |
bool inverseFilled); |
// notify our surface (if we have one) that we are about to draw, so it |