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

Unified Diff: src/core/SkPictureData.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 | « src/core/SkPicture.cpp ('k') | src/core/SkPictureData.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkPictureData.h
diff --git a/src/core/SkPictureData.h b/src/core/SkPictureData.h
index ec147f7e2117e23b8567749d861a7fa0523564f0..0e351509bc91858cf59c3e4f7990bddf832440aa 100644
--- a/src/core/SkPictureData.h
+++ b/src/core/SkPictureData.h
@@ -64,7 +64,7 @@ public:
// Does not affect ownership of SkStream.
static SkPictureData* CreateFromStream(SkStream*,
const SkPictInfo&,
- SkPicture::InstallPixelRefProc,
+ SkImageDeserializer*,
SkTypefacePlayback*);
static SkPictureData* CreateFromBuffer(SkReadBuffer&, const SkPictInfo&);
@@ -85,13 +85,13 @@ protected:
explicit SkPictureData(const SkPictInfo& info);
// Does not affect ownership of SkStream.
- bool parseStream(SkStream*, SkPicture::InstallPixelRefProc, SkTypefacePlayback*);
+ bool parseStream(SkStream*, SkImageDeserializer*, SkTypefacePlayback*);
bool parseBuffer(SkReadBuffer& buffer);
public:
- const SkBitmap& getBitmap(SkReadBuffer* reader) const {
+ const SkImage* getBitmapAsImage(SkReadBuffer* reader) const {
const int index = reader->readInt();
- return reader->validateIndex(index, fBitmaps.count()) ? fBitmaps[index] : fEmptyBitmap;
+ return reader->validateIndex(index, fBitmapImageCount) ? fBitmapImageRefs[index] : nullptr;
}
const SkImage* getImage(SkReadBuffer* reader) const {
@@ -149,11 +149,10 @@ private:
// these help us with reading/writing
// Does not affect ownership of SkStream.
bool parseStreamTag(SkStream*, uint32_t tag, uint32_t size,
- SkPicture::InstallPixelRefProc, SkTypefacePlayback*);
+ SkImageDeserializer*, SkTypefacePlayback*);
bool parseBufferTag(SkReadBuffer&, uint32_t tag, uint32_t size);
void flattenToBuffer(SkWriteBuffer&) const;
- SkTArray<SkBitmap> fBitmaps;
SkTArray<SkPaint> fPaints;
SkTArray<SkPath> fPaths;
@@ -170,6 +169,8 @@ private:
int fTextBlobCount;
const SkImage** fImageRefs;
int fImageCount;
+ const SkImage** fBitmapImageRefs;
+ int fBitmapImageCount;
SkPictureContentInfo fContentInfo;
« no previous file with comments | « src/core/SkPicture.cpp ('k') | src/core/SkPictureData.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698