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

Unified Diff: include/core/SkCanvas.h

Issue 448793004: add drawPicture variant that takes a matrix and paint (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: more dummies so we can land Created 6 years, 4 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
« no previous file with comments | « gyp/gmslides.gypi ('k') | include/core/SkDevice.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/core/SkCanvas.h
diff --git a/include/core/SkCanvas.h b/include/core/SkCanvas.h
index eef9d9004a4f6f7502ef31b809f4b6746baf0299..791511e768088720ad5dd9192bc5a64fd21dd1a1 100644
--- a/include/core/SkCanvas.h
+++ b/include/core/SkCanvas.h
@@ -973,6 +973,20 @@ public:
*/
void drawPicture(const SkPicture* picture);
+ /**
+ * Draw the picture into this canvas.
+ *
+ * If matrix is non-null, apply that matrix to the CTM when drawing this picture. This is
+ * logically equivalent to
+ * save/concat/drawPicture/restore
+ *
+ * If paint is non-null, draw the picture into a temporary buffer, and then apply the paint's
+ * alpha/colorfilter/imagefilter/xfermode to that buffer as it is drawn to the canvas.
+ * This is logically equivalent to
+ * saveLayer(paint)/drawPicture/restore
+ */
+ void drawPicture(const SkPicture*, const SkMatrix* matrix, const SkPaint* paint);
+
enum VertexMode {
kTriangles_VertexMode,
kTriangleStrip_VertexMode,
@@ -1223,9 +1237,9 @@ protected:
virtual void onDiscard();
- virtual void onDrawPicture(const SkPicture* picture);
// temporary, until we can migrate existing overrides in chrome
- virtual void onDrawPicture(const SkPicture*, const SkMatrix*, const SkPaint*) {}
+ virtual void onDrawPicture(const SkPicture*) {}
+ virtual void onDrawPicture(const SkPicture*, const SkMatrix*, const SkPaint*);
// Returns the canvas to be used by DrawIter. Default implementation
// returns this. Subclasses that encapsulate an indirect canvas may
« no previous file with comments | « gyp/gmslides.gypi ('k') | include/core/SkDevice.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698