| OLD | NEW |
| 1 | 1 |
| 2 /* | 2 /* |
| 3 * Copyright 2011 Google Inc. | 3 * Copyright 2011 Google Inc. |
| 4 * | 4 * |
| 5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
| 6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
| 7 */ | 7 */ |
| 8 | 8 |
| 9 #ifndef SkOrderedWriteBuffer_DEFINED | 9 #ifndef SkOrderedWriteBuffer_DEFINED |
| 10 #define SkOrderedWriteBuffer_DEFINED | 10 #define SkOrderedWriteBuffer_DEFINED |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 77 | 77 |
| 78 /** | 78 /** |
| 79 * Set an SkBitmapHeap to store bitmaps rather than flattening. | 79 * Set an SkBitmapHeap to store bitmaps rather than flattening. |
| 80 * | 80 * |
| 81 * Incompatible with an EncodeBitmap function. If an EncodeBitmap function i
s set, setting an | 81 * Incompatible with an EncodeBitmap function. If an EncodeBitmap function i
s set, setting an |
| 82 * SkBitmapHeap will set the function to NULL in release mode and crash in d
ebug. | 82 * SkBitmapHeap will set the function to NULL in release mode and crash in d
ebug. |
| 83 */ | 83 */ |
| 84 void setBitmapHeap(SkBitmapHeap*); | 84 void setBitmapHeap(SkBitmapHeap*); |
| 85 | 85 |
| 86 /** | 86 /** |
| 87 * Provide a function to encode an SkBitmap to an SkStream. writeBitmap will
attempt to use | 87 * Provide a function to encode an SkBitmap to an SkData. writeBitmap will a
ttempt to use |
| 88 * bitmapEncoder to store the SkBitmap. If the reader does not provide a fun
ction to decode, it | 88 * bitmapEncoder to store the SkBitmap. If the reader does not provide a fun
ction to decode, it |
| 89 * will not be able to restore SkBitmaps, but will still be able to read the
rest of the stream. | 89 * will not be able to restore SkBitmaps, but will still be able to read the
rest of the stream. |
| 90 * bitmapEncoder will never be called with a NULL pixelRefOffset. |
| 90 * | 91 * |
| 91 * Incompatible with the SkBitmapHeap. If an encoder is set fBitmapHeap will
be set to NULL in | 92 * Incompatible with the SkBitmapHeap. If an encoder is set fBitmapHeap will
be set to NULL in |
| 92 * release and crash in debug. | 93 * release and crash in debug. |
| 93 */ | 94 */ |
| 94 void setBitmapEncoder(SkPicture::EncodeBitmap); | 95 void setBitmapEncoder(SkPicture::EncodeBitmap bitmapEncoder); |
| 95 | 96 |
| 96 private: | 97 private: |
| 97 SkFactorySet* fFactorySet; | 98 SkFactorySet* fFactorySet; |
| 98 SkNamedFactorySet* fNamedFactorySet; | 99 SkNamedFactorySet* fNamedFactorySet; |
| 99 SkWriter32 fWriter; | 100 SkWriter32 fWriter; |
| 100 | 101 |
| 101 SkBitmapHeap* fBitmapHeap; | 102 SkBitmapHeap* fBitmapHeap; |
| 102 SkRefCntSet* fTFSet; | 103 SkRefCntSet* fTFSet; |
| 103 | 104 |
| 104 SkPicture::EncodeBitmap fBitmapEncoder; | 105 SkPicture::EncodeBitmap fBitmapEncoder; |
| 105 | 106 |
| 106 typedef SkFlattenableWriteBuffer INHERITED; | 107 typedef SkFlattenableWriteBuffer INHERITED; |
| 107 }; | 108 }; |
| 108 | 109 |
| 109 #endif // SkOrderedWriteBuffer_DEFINED | 110 #endif // SkOrderedWriteBuffer_DEFINED |
| OLD | NEW |