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

Unified Diff: include/core/SkPicture.h

Issue 2187613002: Deserialize pictures with custom image-deserializer (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: fix legacy case, remove null-check Created 4 years, 4 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 | « include/core/SkImageDeserializer.h ('k') | src/core/SkPicture.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 885eb59c9b44945377a40e80711d792b978d886b..7cfa6679f3fdc2c96d2bb68c23a1531f44ecad31 100644
--- a/include/core/SkPicture.h
+++ b/include/core/SkPicture.h
@@ -16,6 +16,9 @@ class GrContext;
class SkBigPicture;
class SkBitmap;
class SkCanvas;
+class SkData;
+class SkImage;
+class SkImageDeserializer;
class SkPath;
class SkPictureData;
class SkPixelSerializer;
@@ -49,6 +52,7 @@ public:
*/
typedef bool (*InstallPixelRefProc)(const void* src, size_t length, SkBitmap* dst);
+#ifdef SK_SUPPORT_LEGACY_PICTUREINSTALLPIXELREF
/**
* Recreate a picture that was serialized into a stream.
* @param SkStream Serialized picture data. Ownership is unchanged by this call.
@@ -58,17 +62,18 @@ public:
* invalid.
*/
static sk_sp<SkPicture> MakeFromStream(SkStream*, InstallPixelRefProc proc);
+ static sk_sp<SkPicture> MakeFromStream(SkStream* stream, std::nullptr_t) {
+ return MakeFromStream(stream);
+ }
+#endif
/**
* Recreate a picture that was serialized into a stream.
*
- * Any serialized images in the stream will be passed to
- * SkImageGenerator::NewFromEncoded.
- *
- * @param SkStream Serialized picture data. Ownership is unchanged by this call.
- * @return A new SkPicture representing the serialized data, or NULL if the stream is
- * invalid.
+ * Any serialized images in the stream will be passed the image-deserializer, or if that is
+ * null, to the default deserializer that will call SkImage::MakeFromEncoded().
*/
+ static sk_sp<SkPicture> MakeFromStream(SkStream*, SkImageDeserializer*);
static sk_sp<SkPicture> MakeFromStream(SkStream*);
/**
@@ -188,7 +193,7 @@ private:
template <typename> friend class SkMiniPicture;
void serialize(SkWStream*, SkPixelSerializer*, SkRefCntSet* typefaces) const;
- static sk_sp<SkPicture> MakeFromStream(SkStream*, InstallPixelRefProc, SkTypefacePlayback*);
+ static sk_sp<SkPicture> MakeFromStream(SkStream*, SkImageDeserializer*, SkTypefacePlayback*);
friend class SkPictureData;
virtual int numSlowPaths() const = 0;
« no previous file with comments | « include/core/SkImageDeserializer.h ('k') | src/core/SkPicture.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698