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

Unified Diff: include/core/SkDrawable.h

Issue 1837913003: Add support for serializing/deserializing of SkDrawable (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Add ability to specify custom flattenable factories on SkReadBuffer Created 4 years, 9 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: include/core/SkDrawable.h
diff --git a/include/core/SkDrawable.h b/include/core/SkDrawable.h
index 2f0a62d8b5eb8c824a8c91927fa52a6ecd7b5f5a..59a0a37fc19a6f1034d450450d13caba5165e2e5 100644
--- a/include/core/SkDrawable.h
+++ b/include/core/SkDrawable.h
@@ -8,9 +8,10 @@
#ifndef SkDrawable_DEFINED
#define SkDrawable_DEFINED
-#include "SkRefCnt.h"
+#include "SkFlattenable.h"
class SkCanvas;
+class SkMatrix;
class SkPicture;
struct SkRect;
@@ -21,7 +22,7 @@ struct SkRect;
* allow for clients of the drawable that may want to cache the results, the drawable must
* change its generation ID whenever its internal state changes such that it will draw differently.
*/
-class SkDrawable : public SkRefCnt {
+class SkDrawable : public SkFlattenable {
public:
SkDrawable();
@@ -58,6 +59,9 @@ public:
*/
void notifyDrawingChanged();
+ SK_DEFINE_FLATTENABLE_TYPE(SkDrawable)
+ virtual Factory getFactory() const { return nullptr; }
reed1 2016/03/31 18:42:05 Is this an override of the method in SkFlattenable
msarett 2016/04/01 14:11:44 Yes! Fixed.
+
protected:
virtual SkRect onGetBounds() = 0;
virtual void onDraw(SkCanvas*) = 0;
« no previous file with comments | « gyp/core.gypi ('k') | include/core/SkFlattenable.h » ('j') | include/core/SkFlattenable.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698