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

Unified Diff: src/core/SkCanvasDrawable.h

Issue 727363003: wip for drawables (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: works, but I took a few short-cuts Created 6 years, 1 month 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/SkCanvasDrawable.h
diff --git a/src/core/SkCanvasDrawable.h b/src/core/SkCanvasDrawable.h
index 807bbc7ab1e1d8e731960a8563acc0b0e51ec09f..32142dc71804b6434f76ad73a2c66ffbb2dcf21e 100644
--- a/src/core/SkCanvasDrawable.h
+++ b/src/core/SkCanvasDrawable.h
@@ -10,6 +10,7 @@
#include "SkRefCnt.h"
+class SkBBHFactory;
class SkCanvas;
struct SkRect;
@@ -31,6 +32,11 @@ public:
*/
void draw(SkCanvas*);
+ SkPicture* newPictureSnapshot(SkBBHFactory* bbhFactory, uint32_t recordFlags);
+ SkPicture* newPictureSnapshot() {
+ return this->newPictureSnapshot(NULL, 0);
+ }
+
/**
* Return a unique value for this instance. If two calls to this return the same value,
* it is presumed that calling the draw() method will render the same thing as well.
@@ -45,7 +51,7 @@ public:
* set the parameter to that rectangle. If one is not known, ignore the parameter and
* return false.
mtklein 2014/11/17 20:23:21 Update docs?
reed1 2014/11/17 20:35:58 Done.
*/
- bool getBounds(SkRect*);
+ SkRect getBounds();
/**
* Calling this invalidates the previous generation ID, and causes a new one to be computed
@@ -55,9 +61,9 @@ public:
void notifyDrawingChanged();
protected:
+ virtual SkRect onGetBounds() = 0;
virtual void onDraw(SkCanvas*) = 0;
-
- virtual bool onGetBounds(SkRect*) { return false; }
+ virtual SkPicture* onNewPictureSnapshot(SkBBHFactory*, uint32_t recordFlags);
private:
int32_t fGenerationID;
« no previous file with comments | « src/core/SkCanvas.cpp ('k') | src/core/SkCanvasDrawable.cpp » ('j') | src/core/SkRecordDraw.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698