Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2269)

Unified Diff: include/core/SkCanvas.h

Issue 183453002: add new onClip* methods to SkCanvas (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: remove debug Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « experimental/PdfViewer/SkNulCanvas.h ('k') | include/utils/SkDeferredCanvas.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/core/SkCanvas.h
===================================================================
--- include/core/SkCanvas.h (revision 13622)
+++ include/core/SkCanvas.h (working copy)
@@ -481,10 +481,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
@@ -548,13 +547,13 @@
in a way similar to quickReject, in that it tells you that drawing
outside of these bounds will be clipped out.
*/
- bool getClipBounds(SkRect* bounds) const;
+ virtual bool getClipBounds(SkRect* bounds) const;
/** Return the bounds of the current clip, in device coordinates; returns
true if non-empty. Maybe faster than getting the clip explicitly and
then taking its bounds.
*/
- bool getClipDeviceBounds(SkIRect* bounds) const;
+ virtual bool getClipDeviceBounds(SkIRect* bounds) const;
/** Fill the entire canvas' bitmap (restricted to the current clip) with the
@@ -1031,7 +1030,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;
/** Return the current matrix on the canvas.
This does not account for the translate in any of the devices.
@@ -1048,7 +1047,7 @@
/** Returns a description of the total clip; may be cheaper than
getting the clip and querying it directly.
*/
- ClipType getClipType() const;
+ virtual ClipType getClipType() const;
/** DEPRECATED -- need to move this guy to private/friend
* Return the current device clip (concatenation of all clip calls).
@@ -1130,6 +1129,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
« no previous file with comments | « experimental/PdfViewer/SkNulCanvas.h ('k') | include/utils/SkDeferredCanvas.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698