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

Unified Diff: include/core/SkPicture.h

Issue 540963002: Change SkPicture::draw to playback (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 3 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/skia_for_chromium_defines.gypi ('k') | samplecode/SampleAll.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/core/SkPicture.h
diff --git a/include/core/SkPicture.h b/include/core/SkPicture.h
index cebb9a76e7ca67ee76856361cfe2d3880c4cb607..325ffc78e0a15bc49b04b9fb1e9de39a2b774437 100644
--- a/include/core/SkPicture.h
+++ b/include/core/SkPicture.h
@@ -111,10 +111,20 @@ public:
SkPicture* clone() const;
#endif
- /** Replays the drawing commands on the specified canvas.
+ /** Replays the drawing commands on the specified canvas. Note that
+ this has the effect of unfurling this picture into the destination
+ canvas. Using the SkCanvas::drawPicture entry point gives the destination
+ canvas the option of just taking a ref.
@param canvas the canvas receiving the drawing commands.
+ @param callback a callback that allows interruption of playback
*/
- void draw(SkCanvas* canvas, SkDrawPictureCallback* = NULL) const;
+ void playback(SkCanvas* canvas, SkDrawPictureCallback* = NULL) const;
reed1 2014/09/04 15:13:38 I wonder if this class should also be renamed, to
+
+#ifdef SK_LEGACY_PICTURE_DRAW_API
+ void draw(SkCanvas* canvas, SkDrawPictureCallback* callback = NULL) const {
+ this->playback(canvas, callback);
+ }
+#endif
#ifdef SK_LEGACY_PICTURE_SIZE_API
int width() const { return SkScalarCeilToInt(fCullWidth); }
« no previous file with comments | « gyp/skia_for_chromium_defines.gypi ('k') | samplecode/SampleAll.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698