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

Unified Diff: include/core/SkWriteBuffer.h

Issue 787833002: Revert of Replace EncodeBitmap with an interface. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years 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/SkPixelSerializer.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/SkWriteBuffer.h
diff --git a/include/core/SkWriteBuffer.h b/include/core/SkWriteBuffer.h
index 39739f2c244983324c8c778f38985b235ed85f33..4dbe17b0d9fd4b6d03a3f9da11a4452c89a31e65 100644
--- a/include/core/SkWriteBuffer.h
+++ b/include/core/SkWriteBuffer.h
@@ -12,7 +12,6 @@
#include "SkData.h"
#include "SkPath.h"
#include "SkPicture.h"
-#include "SkPixelSerializer.h"
#include "SkRefCnt.h"
#include "SkWriter32.h"
@@ -88,24 +87,21 @@
/**
* Set an SkBitmapHeap to store bitmaps rather than flattening.
*
- * Incompatible with an SkPixelSerializer. If an SkPixelSerializer is set,
- * setting an SkBitmapHeap will set the SkPixelSerializer to NULL in release
- * and crash in debug.
+ * Incompatible with an EncodeBitmap function. If an EncodeBitmap function is set, setting an
+ * SkBitmapHeap will set the function to NULL in release mode and crash in debug.
*/
void setBitmapHeap(SkBitmapHeap*);
/**
- * Set an SkPixelSerializer to store an encoded representation of pixels,
- * e.g. SkBitmaps.
+ * Provide a function to encode an SkBitmap to an SkData. writeBitmap will attempt to use
+ * bitmapEncoder to store the SkBitmap. If the reader does not provide a function to decode, it
+ * will not be able to restore SkBitmaps, but will still be able to read the rest of the stream.
+ * bitmapEncoder will never be called with a NULL pixelRefOffset.
*
- * Calls ref() on the serializer.
- *
- * TODO: Encode SkImage pixels as well.
- *
- * Incompatible with the SkBitmapHeap. If an encoder is set fBitmapHeap will
- * be set to NULL in release and crash in debug.
+ * Incompatible with the SkBitmapHeap. If an encoder is set fBitmapHeap will be set to NULL in
+ * release and crash in debug.
*/
- void setPixelSerializer(SkPixelSerializer*);
+ void setBitmapEncoder(SkPicture::EncodeBitmap bitmapEncoder);
private:
bool isValidating() const { return SkToBool(fFlags & kValidation_Flag); }
@@ -118,7 +114,7 @@
SkBitmapHeap* fBitmapHeap;
SkRefCntSet* fTFSet;
- SkAutoTUnref<SkPixelSerializer> fPixelSerializer;
+ SkPicture::EncodeBitmap fBitmapEncoder;
};
#endif // SkWriteBuffer_DEFINED
« no previous file with comments | « include/core/SkPixelSerializer.h ('k') | src/core/SkPicture.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698