Index: src/core/SkCanvas.cpp |
diff --git a/src/core/SkCanvas.cpp b/src/core/SkCanvas.cpp |
index 504c9908abbb8015a65e7bfd7b77a2662d21154a..7ec1bb8c850fa5fbcddd95a0ddec35cf9cd7fc33 100644 |
--- a/src/core/SkCanvas.cpp |
+++ b/src/core/SkCanvas.cpp |
@@ -2263,6 +2263,28 @@ void SkCanvas::drawVertices(VertexMode vmode, int vertexCount, |
LOOPER_END |
} |
+void SkCanvas::drawPatch(const SkPatch& patch, const SkPaint& paint) { |
+ |
+ // Since a patch is always within the convex hull of the control points, we discard it when its |
+ // bounding rectangle is completely outside the current clip. |
+ SkRect bounds; |
+ bounds.set(patch.getControlPoints(), 12); |
+ if (this->quickReject(bounds)) { |
+ return; |
+ } |
+ |
+ SkMatrix mat = this->getTotalMatrix(); |
+ SkScalar scaleX = mat.getScaleX(), scaleY = mat.getScaleY(); |
+ |
+ LOOPER_BEGIN(paint, SkDrawFilter::kPath_Type, NULL) |
bsalomon
2014/07/28 20:56:26
Should we add a new SkDrawFilter::kPatch? Not real
dandov
2014/07/29 18:45:46
Mike said that for now I could just leave it as a
|
+ |
+ while (iter.next()) { |
+ iter.fDevice->drawPatch(iter, patch, paint); |
+ } |
+ |
+ LOOPER_END |
+} |
+ |
////////////////////////////////////////////////////////////////////////////// |
// These methods are NOT virtual, and therefore must call back into virtual |
// methods, rather than actually drawing themselves. |