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 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
127 bool writeToStream(SkWStream*); | 127 bool writeToStream(SkWStream*); |
128 void writeToMemory(void* dst) { fWriter.flatten(dst); } | 128 void writeToMemory(void* dst) { fWriter.flatten(dst); } |
129 | 129 |
130 SkFactorySet* setFactoryRecorder(SkFactorySet*); | 130 SkFactorySet* setFactoryRecorder(SkFactorySet*); |
131 SkRefCntSet* setTypefaceRecorder(SkRefCntSet*); | 131 SkRefCntSet* setTypefaceRecorder(SkRefCntSet*); |
132 | 132 |
133 /** | 133 /** |
134 * Set an SkPixelSerializer to store an encoded representation of pixels, | 134 * Set an SkPixelSerializer to store an encoded representation of pixels, |
135 * e.g. SkBitmaps. | 135 * e.g. SkBitmaps. |
136 * | 136 * |
137 * Calls ref() on the serializer. | |
138 * | |
139 * TODO: Encode SkImage pixels as well. | 137 * TODO: Encode SkImage pixels as well. |
140 */ | 138 */ |
141 void setPixelSerializer(SkPixelSerializer*); | 139 void setPixelSerializer(sk_sp<SkPixelSerializer>); |
142 SkPixelSerializer* getPixelSerializer() const { return fPixelSerializer; } | 140 SkPixelSerializer* getPixelSerializer() const { return fPixelSerializer.get(
); } |
143 | 141 |
144 private: | 142 private: |
145 const uint32_t fFlags; | 143 const uint32_t fFlags; |
146 SkFactorySet* fFactorySet; | 144 SkFactorySet* fFactorySet; |
147 SkWriter32 fWriter; | 145 SkWriter32 fWriter; |
148 | 146 |
149 SkRefCntSet* fTFSet; | 147 SkRefCntSet* fTFSet; |
150 | 148 |
151 SkAutoTUnref<SkPixelSerializer> fPixelSerializer; | 149 sk_sp<SkPixelSerializer> fPixelSerializer; |
152 | 150 |
153 // Only used if we do not have an fFactorySet | 151 // Only used if we do not have an fFactorySet |
154 SkTHashMap<SkString, uint32_t> fFlattenableDict; | 152 SkTHashMap<SkString, uint32_t> fFlattenableDict; |
155 }; | 153 }; |
156 | 154 |
157 #endif // SkWriteBuffer_DEFINED | 155 #endif // SkWriteBuffer_DEFINED |
OLD | NEW |