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

Unified Diff: include/core/SkCanvas.h

Issue 313613004: Alter SkCanvas::drawPicture (devirtualize, take const SkPicture, take pointer) (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Add staging entry point for Chromium and Android Created 6 years, 7 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') | 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 4aaf46b39703d33957098c0d98e1904b163808c1..ee8ad250d23027a3567f735f31e8a785cf10c86c 100644
--- a/include/core/SkCanvas.h
+++ b/include/core/SkCanvas.h
@@ -969,13 +969,13 @@ public:
drawPicture call.
@param picture The recorded drawing commands to analyze/optimize
*/
- void EXPERIMENTAL_optimize(SkPicture* picture);
+ void EXPERIMENTAL_optimize(const SkPicture* picture);
/** PRIVATE / EXPERIMENTAL -- do not call
Purge all the discardable optimization information associated with
'picture'. If NULL is passed in, purge all discardable information.
*/
- void EXPERIMENTAL_purge(SkPicture* picture);
+ void EXPERIMENTAL_purge(const SkPicture* picture);
/** Draw the picture into this canvas. This method effective brackets the
playback of the picture's draw calls with save/restore, so the state
@@ -983,7 +983,13 @@ public:
@param picture The recorded drawing commands to playback into this
canvas.
*/
- virtual void drawPicture(SkPicture& picture);
+ void drawPicture(const SkPicture* picture);
mtklein 2014/06/03 22:23:23 How come these aren't all const SkPicture&?
robertphillips 2014/06/03 23:17:21 It seems/seemed at bit odd to pass by reference so
+
+#ifdef SK_SUPPORT_LEGACY_DRAWPICTURE_API
+ virtual void drawPicture(SkPicture& picture) {
+ this->drawPicture(&picture);
+ }
+#endif
enum VertexMode {
kTriangles_VertexMode,
@@ -1242,6 +1248,8 @@ protected:
virtual void onDiscard();
+ virtual void onDrawPicture(const SkPicture* picture);
+
// Returns the canvas to be used by DrawIter. Default implementation
// returns this. Subclasses that encapsulate an indirect canvas may
// need to overload this method. The impl must keep track of this, as it
« no previous file with comments | « gyp/skia_for_chromium_defines.gypi ('k') | include/core/SkDevice.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698