diff options
-rw-r--r-- | include/core/SkCanvas.h | 8 | ||||
-rw-r--r-- | src/core/SkCanvas.cpp | 12 |
2 files changed, 13 insertions, 7 deletions
diff --git a/include/core/SkCanvas.h b/include/core/SkCanvas.h index d9b3282d3e..acf0ad2a54 100644 --- a/include/core/SkCanvas.h +++ b/include/core/SkCanvas.h @@ -707,13 +707,7 @@ public: @param region The region to be drawn @param paint The paint used to draw the region */ - void drawRegion(const SkRegion& region, const SkPaint& paint) { - if (region.isEmpty()) { - return; - } - - this->onDrawRegion(region, paint); - } + void drawRegion(const SkRegion& region, const SkPaint& paint); /** Draw the specified oval using the specified paint. The oval will be filled or framed based on the Style in the paint. diff --git a/src/core/SkCanvas.cpp b/src/core/SkCanvas.cpp index 4cf40e9c5a..fc1897526c 100644 --- a/src/core/SkCanvas.cpp +++ b/src/core/SkCanvas.cpp @@ -1975,6 +1975,18 @@ void SkCanvas::drawRect(const SkRect& r, const SkPaint& paint) { this->onDrawRect(r, paint); } +void SkCanvas::drawRegion(const SkRegion& region, const SkPaint& paint) { + if (region.isEmpty()) { + return; + } + + if (region.isRect()) { + return this->drawIRect(region.getBounds(), paint); + } + + this->onDrawRegion(region, paint); +} + void SkCanvas::drawOval(const SkRect& r, const SkPaint& paint) { this->onDrawOval(r, paint); } |