aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/core/SkFlattenable.h
diff options
context:
space:
mode:
authorGravatar Mike Reed <reed@google.com>2017-12-06 16:09:20 -0500
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-12-06 21:33:00 +0000
commitfadbfcd4aba676d44dfb08de1a83143a1c63b95c (patch)
treea67a5a69ce9e7e9d0bbbd4507c6a6f6f65c90ace /include/core/SkFlattenable.h
parenta492eb0e1f08311bfa47f46c660144e7bc8a6c0e (diff)
upgrade SkReadBuffer to always validate
Bug: skia: Change-Id: I054560b66c6cde346d939015326d8547879d2c4b Reviewed-on: https://skia-review.googlesource.com/81160 Reviewed-by: Mike Klein <mtklein@chromium.org> Commit-Queue: Mike Reed <reed@google.com>
Diffstat (limited to 'include/core/SkFlattenable.h')
-rw-r--r--include/core/SkFlattenable.h13
1 files changed, 12 insertions, 1 deletions
diff --git a/include/core/SkFlattenable.h b/include/core/SkFlattenable.h
index 40cbaa5d0d..b0bfbe23e7 100644
--- a/include/core/SkFlattenable.h
+++ b/include/core/SkFlattenable.h
@@ -10,10 +10,12 @@
#include "SkRefCnt.h"
+class SkData;
class SkReadBuffer;
class SkWriteBuffer;
-class SkPrivateEffectInitializer;
+struct SkSerialProcs;
+struct SkDeserialProcs;
/*
* Flattening is straight-forward:
@@ -113,9 +115,18 @@ public:
/**
* Override this if your subclass needs to record data that it will need to recreate itself
* from its CreateProc (returned by getFactory()).
+ *
+ * DEPRECATED public : will move to protected ... use serialize() instead
*/
virtual void flatten(SkWriteBuffer&) const {}
+ //
+ // public ways to serialize / deserialize
+ //
+ sk_sp<SkData> serialize(const SkSerialProcs* = nullptr) const;
+ static sk_sp<SkFlattenable> Deserialize(Type, const void* data, size_t length,
+ const SkDeserialProcs* procs = nullptr);
+
protected:
class PrivateInitializer {
public: