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

Unified Diff: src/core/SkCanvas.cpp

Issue 424663006: SkCanvas interface for drawing a patch. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Added array constructor for FwDCubicEvaluator Created 6 years, 5 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
Index: src/core/SkCanvas.cpp
diff --git a/src/core/SkCanvas.cpp b/src/core/SkCanvas.cpp
index 504c9908abbb8015a65e7bfd7b77a2662d21154a..d81e90a6ed4c976f87b6b066b01492d7a53a6e77 100644
--- a/src/core/SkCanvas.cpp
+++ b/src/core/SkCanvas.cpp
@@ -2263,6 +2263,25 @@ 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;
+ }
+
+ LOOPER_BEGIN(paint, SkDrawFilter::kPath_Type, NULL)
+
+ 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.

Powered by Google App Engine
This is Rietveld 408576698