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 SkWriteBuffer_DEFINED | 9 #ifndef SkWriteBuffer_DEFINED |
10 #define SkWriteBuffer_DEFINED | 10 #define SkWriteBuffer_DEFINED |
(...skipping 25 matching lines...) Expand all Loading... |
36 | 36 |
37 bool isCrossProcess() const { | 37 bool isCrossProcess() const { |
38 return SkToBool(fFlags & kCrossProcess_Flag); | 38 return SkToBool(fFlags & kCrossProcess_Flag); |
39 } | 39 } |
40 | 40 |
41 SkWriter32* getWriter32() { return &fWriter; } | 41 SkWriter32* getWriter32() { return &fWriter; } |
42 void reset(void* storage = NULL, size_t storageSize = 0) { | 42 void reset(void* storage = NULL, size_t storageSize = 0) { |
43 fWriter.reset(storage, storageSize); | 43 fWriter.reset(storage, storageSize); |
44 } | 44 } |
45 | 45 |
46 uint32_t* reserve(size_t size) { return fWriter.reserve(size); } | |
47 | |
48 size_t bytesWritten() const { return fWriter.bytesWritten(); } | 46 size_t bytesWritten() const { return fWriter.bytesWritten(); } |
49 | 47 |
50 void writeByteArray(const void* data, size_t size); | 48 void writeByteArray(const void* data, size_t size); |
51 void writeDataAsByteArray(SkData* data) { this->writeByteArray(data->data(),
data->size()); } | 49 void writeDataAsByteArray(SkData* data) { this->writeByteArray(data->data(),
data->size()); } |
52 void writeBool(bool value); | 50 void writeBool(bool value); |
53 void writeScalar(SkScalar value); | 51 void writeScalar(SkScalar value); |
54 void writeScalarArray(const SkScalar* value, uint32_t count); | 52 void writeScalarArray(const SkScalar* value, uint32_t count); |
55 void writeInt(int32_t value); | 53 void writeInt(int32_t value); |
56 void writeIntArray(const int32_t* value, uint32_t count); | 54 void writeIntArray(const int32_t* value, uint32_t count); |
57 void writeUInt(uint32_t value); | 55 void writeUInt(uint32_t value); |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
115 SkBitmapHeap* fBitmapHeap; | 113 SkBitmapHeap* fBitmapHeap; |
116 SkRefCntSet* fTFSet; | 114 SkRefCntSet* fTFSet; |
117 | 115 |
118 SkAutoTUnref<SkPixelSerializer> fPixelSerializer; | 116 SkAutoTUnref<SkPixelSerializer> fPixelSerializer; |
119 | 117 |
120 // Only used if we do not have an fFactorySet | 118 // Only used if we do not have an fFactorySet |
121 SkTHashMap<SkString, uint32_t> fFlattenableDict; | 119 SkTHashMap<SkString, uint32_t> fFlattenableDict; |
122 }; | 120 }; |
123 | 121 |
124 #endif // SkWriteBuffer_DEFINED | 122 #endif // SkWriteBuffer_DEFINED |
OLD | NEW |