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

Unified Diff: include/core/SkPicture.h

Issue 2341693004: add helpers for using SkData with picture serialization (Closed)
Patch Set: update sampleview Created 4 years, 3 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 | « dm/DMSrcSink.cpp ('k') | samplecode/GMSampleView.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/core/SkPicture.h
diff --git a/include/core/SkPicture.h b/include/core/SkPicture.h
index 9ba851005d59088968629569d193fa493e81560c..c8de7daf84b06b8a2d344a80b1df4cf091fa3822 100644
--- a/include/core/SkPicture.h
+++ b/include/core/SkPicture.h
@@ -75,6 +75,9 @@ public:
*/
static sk_sp<SkPicture> MakeFromStream(SkStream*, SkImageDeserializer*);
static sk_sp<SkPicture> MakeFromStream(SkStream*);
+ static sk_sp<SkPicture> MakeFromData(const void* data, size_t size,
+ SkImageDeserializer* = nullptr);
+ static sk_sp<SkPicture> MakeFromData(const SkData* data, SkImageDeserializer* = nullptr);
/**
* Recreate a picture that was serialized into a buffer. If the creation requires bitmap
@@ -121,10 +124,16 @@ public:
uint32_t uniqueID() const;
/**
- * Serialize to a stream. If non NULL, serializer will be used to serialize
- * bitmaps and images in the picture.
+ * Serialize the picture to SkData. If non nullptr, pixel-serializer will be used to
+ * customize how images reference by the picture are serialized/compressed.
*/
- void serialize(SkWStream*, SkPixelSerializer* = NULL) const;
+ sk_sp<SkData> serialize(SkPixelSerializer* = nullptr) const;
+
+ /**
+ * Serialize to a stream. If non nullptr, pixel-serializer will be used to
+ * customize how images reference by the picture are serialized/compressed.
+ */
+ void serialize(SkWStream*, SkPixelSerializer* = nullptr) const;
/**
* Serialize to a buffer.
« no previous file with comments | « dm/DMSrcSink.cpp ('k') | samplecode/GMSampleView.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698