diff options
author | 2016-08-25 13:54:30 -0700 | |
---|---|---|
committer | 2016-08-25 13:54:30 -0700 | |
commit | 44df651ebefc284acc2f66425dff3ea0b0e14b36 (patch) | |
tree | 324bcf1b278ed44e168f0a6c548fd9a194014b6c /include/core/SkCanvas.h | |
parent | 4d866dfc46bc381da1761d05ce8b5a3bb0cd7f00 (diff) |
Add drawRegion() API to SkCanvas
This will allow us to optimize for the RectGrid macrobench.
Currently, SkiaGL is much slower than OpenGL.
SkiaGL 12 items/s
OpenGL 160 items/s
This contains everything except for the fast implementation on GPU.
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2277053002
Review-Url: https://codereview.chromium.org/2277053002
Diffstat (limited to 'include/core/SkCanvas.h')
-rw-r--r-- | include/core/SkCanvas.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/include/core/SkCanvas.h b/include/core/SkCanvas.h index bc3b25dc1b..780af107af 100644 --- a/include/core/SkCanvas.h +++ b/include/core/SkCanvas.h @@ -703,6 +703,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) { + 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 @@ -1412,6 +1420,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&); |