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

Unified Diff: src/core/SkReadBuffer.h

Issue 2187613002: Deserialize pictures with custom image-deserializer (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: fix build 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
Index: src/core/SkReadBuffer.h
diff --git a/src/core/SkReadBuffer.h b/src/core/SkReadBuffer.h
index c853c0003623d0adfa6142f49d25cf8e226bf53e..b6c3f892b8d7cb9d8230296f346d5cceedd59d36 100644
--- a/src/core/SkReadBuffer.h
+++ b/src/core/SkReadBuffer.h
@@ -166,12 +166,11 @@ public:
virtual uint32_t getArrayCount();
/**
- * Returns false if the bitmap could not be completely read. In that case, it will be set
+ * Returns false if the image could not be completely read. In that case, it will be set
* to have width/height, but no pixels.
*/
- bool readBitmap(SkBitmap* bitmap);
-
- SkImage* readImage();
+ sk_sp<SkImage> readBitmapAsImage();
+ sk_sp<SkImage> readImage();
virtual SkTypeface* readTypeface();
@@ -208,9 +207,12 @@ public:
* encoded the SkBitmap. If the proper decoder cannot be used, a red bitmap with the
* appropriate size will be used.
*/
+#if 0
void setBitmapDecoder(SkPicture::InstallPixelRefProc bitmapDecoder) {
fBitmapDecoder = bitmapDecoder;
}
+#endif
+ void setImageDeserializer(SkImageDeserializer* factory) { fImageDeserializer = factory; }
// Default impelementations don't check anything.
virtual bool validate(bool isValid) { return isValid; }
@@ -259,7 +261,8 @@ private:
// Only used if we do not have an fFactoryArray.
SkTHashMap<SkString, SkFlattenable::Factory> fCustomFactory;
- SkPicture::InstallPixelRefProc fBitmapDecoder;
+// SkPicture::InstallPixelRefProc fBitmapDecoder;
+ SkImageDeserializer* fImageDeserializer;
#ifdef DEBUG_NON_DETERMINISTIC_ASSERT
// Debugging counter to keep track of how many bitmaps we

Powered by Google App Engine
This is Rietveld 408576698