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

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: rebase Created 4 years, 5 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 | « no previous file | src/core/SkBitmapProcShader.cpp » ('j') | src/core/SkBitmapProcShader.cpp » ('J')
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 75fe66d2bf92fe562311dd6e16c89506b33cfeed..625204db76a1827e6be58f9a53aab7631591658e 100644
--- a/include/core/SkPicture.h
+++ b/include/core/SkPicture.h
@@ -16,6 +16,8 @@ class GrContext;
class SkBigPicture;
class SkBitmap;
class SkCanvas;
+class SkData;
+class SkImage;
class SkPath;
class SkPictureData;
class SkPixelSerializer;
@@ -27,6 +29,13 @@ class SkWStream;
class SkWriteBuffer;
struct SkPictInfo;
+class SkImageDeserializer {
+public:
+ virtual ~SkImageDeserializer() {}
+
+ virtual sk_sp<SkImage> deserialize(sk_sp<SkData>, const SkIRect* subset) = 0;
+};
+
/** \class SkPicture
An SkPicture records drawing commands made to a canvas to be played back at a later time.
@@ -49,6 +58,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,6 +68,9 @@ public:
* invalid.
*/
static sk_sp<SkPicture> MakeFromStream(SkStream*, InstallPixelRefProc proc);
+#endif
+
+ static sk_sp<SkPicture> MakeFromStreamWithDeserializer(SkStream*, SkImageDeserializer*);
/**
* Recreate a picture that was serialized into a stream.
@@ -188,7 +201,8 @@ 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*, InstallPixelRefProc, SkTypefacePlayback*);
+ static sk_sp<SkPicture> MakeFromStream(SkStream*, SkImageDeserializer*, SkTypefacePlayback*);
friend class SkPictureData;
virtual int numSlowPaths() const = 0;
« no previous file with comments | « no previous file | src/core/SkBitmapProcShader.cpp » ('j') | src/core/SkBitmapProcShader.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698