Chromium Code Reviews| Index: include/core/SkPicture.h |
| diff --git a/include/core/SkPicture.h b/include/core/SkPicture.h |
| index b2c2b62edec4ee3684dc4ef4ef3129a1e29f2ad8..f3057016e19443c9e5be961e9ac7cca264cee4b0 100644 |
| --- a/include/core/SkPicture.h |
| +++ b/include/core/SkPicture.h |
| @@ -15,6 +15,7 @@ |
| class SkBBoxHierarchy; |
| class SkCanvas; |
| +class SkData; |
| class SkPicturePlayback; |
| class SkPictureRecord; |
| class SkStream; |
| @@ -168,14 +169,28 @@ public: |
| */ |
| int height() const { return fHeight; } |
| + enum RecordPixelRefOffset { |
| + kYes_RecordPixelRefOffset, |
| + kNo_RecordPixelRefOffset, |
| + }; |
| + |
| /** |
| - * Function to encode an SkBitmap to an SkWStream. A function with this |
| - * signature can be passed to serialize() and SkOrderedWriteBuffer. The |
| - * function should return true if it succeeds. Otherwise it should return |
| - * false so that SkOrderedWriteBuffer can switch to another method of |
| - * storing SkBitmaps. |
| + * Function to encode an SkBitmap to an SkData. A function with this |
| + * signature can be passed to serialize() and SkOrderedWriteBuffer. |
| + * Returning NULL will tell the SkOrderedWriteBuffer to use |
| + * SkBitmap::flatten() to store the bitmap. |
| + * @param RecordPixelRefOffset Output parameter, telling the |
| + * SkOrderedWriteBuffer whether to record the bitmap's pixelRefOffset. |
| + * If set to kYes_RecordPixelRefOffset, the returned SkData contains |
| + * compressed data containing the entire image, so the pixelRefOffset |
| + * should also be recorded to the stream. If set to |
| + * kNo_RecordPixelRefOffset, only the extracted subset is written to |
| + * the returned SkData, so the offset should not be written to the |
| + * stream. |
| + * @return SkData If non-NULL, holds encoded data representing the passed |
| + * in bitmap. The caller is responsible for calling unref(). |
| */ |
| - typedef bool (*EncodeBitmap)(SkWStream*, const SkBitmap&); |
| + typedef SkData* (*EncodeBitmap)(RecordPixelRefOffset*, const SkBitmap&); |
|
scroggo
2013/05/20 19:50:52
Mike, you mentioned perhaps wanting to use the sam
|
| /** |
| * Serialize to a stream. If non NULL, encoder will be used to encode |