Index: include/core/SkPicture.h |
diff --git a/include/core/SkPicture.h b/include/core/SkPicture.h |
index 82d6835dbd9e15906f53d3e550439d9b20d95263..43acb83e0c75c5415b422962fbd76c35ed9e04a7 100644 |
--- a/include/core/SkPicture.h |
+++ b/include/core/SkPicture.h |
@@ -68,6 +68,14 @@ public: |
static SkPicture* CreateFromStream(SkStream*, |
InstallPixelRefProc proc = &SkImageDecoder::DecodeMemory); |
+ /** |
+ * Recreate a picture that was serialized into a buffer. |
+ * @param SkReadBuffer Serialized picture data. |
+ * @return A new SkPicture representing the serialized data, or NULL if the buffer is |
+ * invalid. |
+ */ |
+ static SkPicture* CreateFromBuffer(SkReadBuffer&); |
reed1
2014/02/05 21:05:06
Does this not need/want the same optional paramete
sugoi1
2014/02/05 21:33:06
I'm assuming you're talking about "InstallPixelRef
scroggo
2014/02/05 22:20:11
This is almost true. In the case of a subclass of
|
+ |
virtual ~SkPicture(); |
/** |
@@ -187,6 +195,11 @@ public: |
void serialize(SkWStream*, EncodeBitmap encoder = NULL) const; |
/** |
+ * Serialize to a buffer. |
+ */ |
+ void flatten(SkWriteBuffer&) const; |
+ |
+ /** |
* Returns true if any bitmaps may be produced when this SkPicture |
* is replayed. |
* Returns false if called while still recording. |
@@ -245,6 +258,7 @@ protected: |
// will be ready to be parsed to create an SkPicturePlayback. |
// If false is returned, SkPictInfo is unmodified. |
static bool StreamIsSKP(SkStream*, SkPictInfo*); |
+ static bool BufferIsSKP(SkReadBuffer&, SkPictInfo*); |
private: |
friend class SkFlatPicture; |
friend class SkPicturePlayback; |