Index: src/core/SkCanvas.cpp |
diff --git a/src/core/SkCanvas.cpp b/src/core/SkCanvas.cpp |
index 8f77afe78e1ca955b668a647b046d773daa83f26..09347517778e5881324c7deca1f75fe7ef7927df 100644 |
--- a/src/core/SkCanvas.cpp |
+++ b/src/core/SkCanvas.cpp |
@@ -2250,6 +2250,26 @@ void SkCanvas::onDrawRect(const SkRect& r, const SkPaint& paint) { |
} |
} |
+void SkCanvas::onDrawRegion(const SkRegion& region, const SkPaint& paint) { |
+ SkRect storage; |
+ SkRect regionRect = SkRect::Make(region.getBounds()); |
+ const SkRect* bounds = nullptr; |
+ if (paint.canComputeFastBounds()) { |
+ if (this->quickReject(paint.computeFastBounds(regionRect, &storage))) { |
+ return; |
+ } |
+ bounds = ®ionRect; |
+ } |
+ |
+ LOOPER_BEGIN(paint, SkDrawFilter::kRect_Type, bounds) |
+ |
+ while (iter.next()) { |
+ iter.fDevice->drawRegion(iter, region, looper.paint()); |
+ } |
+ |
+ LOOPER_END |
+} |
+ |
void SkCanvas::onDrawOval(const SkRect& oval, const SkPaint& paint) { |
TRACE_EVENT0("disabled-by-default-skia", "SkCanvas::drawOval()"); |
SkRect storage; |