| 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 24 matching lines...) Expand all Loading... |
| 35 SkWriter32* getWriter32() { return &fWriter; } | 35 SkWriter32* getWriter32() { return &fWriter; } |
| 36 void reset(void* storage, size_t storageSize) { fWriter.reset(storage, stora
geSize); } | 36 void reset(void* storage, size_t storageSize) { fWriter.reset(storage, stora
geSize); } |
| 37 | 37 |
| 38 // Returns true if we've written only into the storage passed into construct
or or reset. | 38 // Returns true if we've written only into the storage passed into construct
or or reset. |
| 39 // (You may be able to use this to avoid a call to writeToMemory.) | 39 // (You may be able to use this to avoid a call to writeToMemory.) |
| 40 bool wroteOnlyToStorage() const { return fWriter.wroteOnlyToStorage(); } | 40 bool wroteOnlyToStorage() const { return fWriter.wroteOnlyToStorage(); } |
| 41 | 41 |
| 42 void writeToMemory(void* dst) { fWriter.flatten(dst); } | 42 void writeToMemory(void* dst) { fWriter.flatten(dst); } |
| 43 uint32_t* reserve(size_t size) { return fWriter.reserve(size); } | 43 uint32_t* reserve(size_t size) { return fWriter.reserve(size); } |
| 44 | 44 |
| 45 uint32_t bytesWritten() const { return fWriter.bytesWritten(); } | 45 size_t bytesWritten() const { return fWriter.bytesWritten(); } |
| 46 // Deprecated. Please call bytesWritten instead. TODO(mtklein): clean up | 46 // Deprecated. Please call bytesWritten instead. TODO(mtklein): clean up |
| 47 uint32_t size() const { return this->bytesWritten(); } | 47 size_t size() const { return this->bytesWritten(); } |
| 48 | 48 |
| 49 virtual void writeByteArray(const void* data, size_t size) SK_OVERRIDE; | 49 virtual void writeByteArray(const void* data, size_t size) SK_OVERRIDE; |
| 50 virtual void writeBool(bool value) SK_OVERRIDE; | 50 virtual void writeBool(bool value) SK_OVERRIDE; |
| 51 virtual void writeFixed(SkFixed value) SK_OVERRIDE; | 51 virtual void writeFixed(SkFixed value) SK_OVERRIDE; |
| 52 virtual void writeScalar(SkScalar value) SK_OVERRIDE; | 52 virtual void writeScalar(SkScalar value) SK_OVERRIDE; |
| 53 virtual void writeScalarArray(const SkScalar* value, uint32_t count) SK_OVER
RIDE; | 53 virtual void writeScalarArray(const SkScalar* value, uint32_t count) SK_OVER
RIDE; |
| 54 virtual void writeInt(int32_t value) SK_OVERRIDE; | 54 virtual void writeInt(int32_t value) SK_OVERRIDE; |
| 55 virtual void writeIntArray(const int32_t* value, uint32_t count) SK_OVERRIDE
; | 55 virtual void writeIntArray(const int32_t* value, uint32_t count) SK_OVERRIDE
; |
| 56 virtual void writeUInt(uint32_t value) SK_OVERRIDE; | 56 virtual void writeUInt(uint32_t value) SK_OVERRIDE; |
| 57 virtual void write32(int32_t value) SK_OVERRIDE; | 57 virtual void write32(int32_t value) SK_OVERRIDE; |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 108 | 108 |
| 109 SkBitmapHeap* fBitmapHeap; | 109 SkBitmapHeap* fBitmapHeap; |
| 110 SkRefCntSet* fTFSet; | 110 SkRefCntSet* fTFSet; |
| 111 | 111 |
| 112 SkPicture::EncodeBitmap fBitmapEncoder; | 112 SkPicture::EncodeBitmap fBitmapEncoder; |
| 113 | 113 |
| 114 typedef SkFlattenableWriteBuffer INHERITED; | 114 typedef SkFlattenableWriteBuffer INHERITED; |
| 115 }; | 115 }; |
| 116 | 116 |
| 117 #endif // SkOrderedWriteBuffer_DEFINED | 117 #endif // SkOrderedWriteBuffer_DEFINED |
| OLD | NEW |