diff options
author | reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2012-12-12 19:02:53 +0000 |
---|---|---|
committer | reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2012-12-12 19:02:53 +0000 |
commit | 68d61ed83ec7b6e98e9623c2f5c9e7b1a32d25bb (patch) | |
tree | 1462843b0770736314438d38676b3dd542bd9d1a /include/core/SkCanvas.h | |
parent | 8cdf0f52ff395d4053f7ed5c20861c42eba25d31 (diff) |
make RRect and Oval first-class drawing primitives in SkCanvas.
add RRect as a first-class clip primitive.
Review URL: https://codereview.appspot.com/6923058
git-svn-id: http://skia.googlecode.com/svn/trunk@6762 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'include/core/SkCanvas.h')
-rw-r--r-- | include/core/SkCanvas.h | 47 |
1 files changed, 36 insertions, 11 deletions
diff --git a/include/core/SkCanvas.h b/include/core/SkCanvas.h index 5bbfc74a9a..3b3dbc4224 100644 --- a/include/core/SkCanvas.h +++ b/include/core/SkCanvas.h @@ -27,6 +27,7 @@ class SkDraw; class SkDrawFilter; class SkMetaData; class SkPicture; +class SkRRect; class SkSurface_Base; /** \class SkCanvas @@ -339,20 +340,35 @@ public: */ void resetMatrix(); - /** Modify the current clip with the specified rectangle. - @param rect The rect to intersect with the current clip - @param op The region op to apply to the current clip - @return true if the canvas' clip is non-empty - */ + /** + * Modify the current clip with the specified rectangle. + * @param rect The rect to combine with the current clip + * @param op The region op to apply to the current clip + * @param doAntiAlias true if the clip should be antialiased + * @return true if the canvas' clip is non-empty + */ virtual bool clipRect(const SkRect& rect, SkRegion::Op op = SkRegion::kIntersect_Op, bool doAntiAlias = false); - /** Modify the current clip with the specified path. - @param path The path to apply to the current clip - @param op The region op to apply to the current clip - @return true if the canvas' new clip is non-empty - */ + /** + * Modify the current clip with the specified SkRRect. + * @param rrect The rrect to combine with the current clip + * @param op The region op to apply to the current clip + * @param doAntiAlias true if the clip should be antialiased + * @return true if the canvas' clip is non-empty + */ + virtual bool clipRRect(const SkRRect& rrect, + SkRegion::Op op = SkRegion::kIntersect_Op, + bool doAntiAlias = false); + + /** + * Modify the current clip with the specified path. + * @param path The path to combine with the current clip + * @param op The region op to apply to the current clip + * @param doAntiAlias true if the clip should be antialiased + * @return true if the canvas' new clip is non-empty + */ virtual bool clipPath(const SkPath& path, SkRegion::Op op = SkRegion::kIntersect_Op, bool doAntiAlias = false); @@ -577,7 +593,16 @@ public: @param oval The rectangle bounds of the oval to be drawn @param paint The paint used to draw the oval */ - void drawOval(const SkRect& oval, const SkPaint&); + virtual void drawOval(const SkRect& oval, const SkPaint&); + + /** + * Draw the specified RRect using the specified paint The rrect will be filled or stroked + * based on the Style in the paint. + * + * @param rrect The round-rect to draw + * @param paint The paint used to draw the round-rect + */ + virtual void drawRRect(const SkRRect& rrect, const SkPaint& paint); /** Draw the specified circle using the specified paint. If radius is <= 0, then nothing will be drawn. The circle will be filled |