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

Unified Diff: include/core/SkCanvas.h

Issue 2277053002: Add drawRegion() API to SkCanvas (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Added shader to test Created 4 years, 4 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 | « gm/drawregionmodes.cpp ('k') | include/core/SkDevice.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/core/SkCanvas.h
diff --git a/include/core/SkCanvas.h b/include/core/SkCanvas.h
index 1e0301179a53d7f71d73a0372ee2cca7725ea667..0409057cab13828945543a8e1e0843e5744f4a0b 100644
--- a/include/core/SkCanvas.h
+++ b/include/core/SkCanvas.h
@@ -702,6 +702,14 @@ public:
void drawRectCoords(SkScalar left, SkScalar top, SkScalar right,
SkScalar bottom, const SkPaint& paint);
+ /** Draw the outline of the specified region using the specified paint.
+ @param region The region to be drawn
+ @param paint The paint used to draw the region
+ */
+ void drawRegion(const SkRegion& region, const SkPaint& paint) {
reed1 2016/08/26 12:27:02 tiny nit: most of these non-virtuals we also put i
msarett 2016/08/26 13:20:14 SGTM, see https://codereview.chromium.org/22866930
+ this->onDrawRegion(region, paint);
+ }
+
/** Draw the specified oval using the specified paint. The oval will be
filled or framed based on the Style in the paint.
@param oval The rectangle bounds of the oval to be drawn
@@ -1389,6 +1397,7 @@ protected:
virtual void onDrawPaint(const SkPaint&);
virtual void onDrawRect(const SkRect&, const SkPaint&);
+ virtual void onDrawRegion(const SkRegion& region, const SkPaint& paint);
virtual void onDrawOval(const SkRect&, const SkPaint&);
virtual void onDrawArc(const SkRect&, SkScalar startAngle, SkScalar sweepAngle, bool useCenter,
const SkPaint&);
« no previous file with comments | « gm/drawregionmodes.cpp ('k') | include/core/SkDevice.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698