OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2011 Google Inc. | 2 * Copyright 2011 Google Inc. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 | 7 |
8 #ifndef SkReadBuffer_DEFINED | 8 #ifndef SkReadBuffer_DEFINED |
9 #define SkReadBuffer_DEFINED | 9 #define SkReadBuffer_DEFINED |
10 | 10 |
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
127 void readPaint(SkPaint* paint) { paint->unflatten(*this); } | 127 void readPaint(SkPaint* paint) { paint->unflatten(*this); } |
128 | 128 |
129 virtual SkFlattenable* readFlattenable(SkFlattenable::Type); | 129 virtual SkFlattenable* readFlattenable(SkFlattenable::Type); |
130 template <typename T> T* readFlattenable() { | 130 template <typename T> T* readFlattenable() { |
131 return (T*) this->readFlattenable(T::GetFlattenableType()); | 131 return (T*) this->readFlattenable(T::GetFlattenableType()); |
132 } | 132 } |
133 SkColorFilter* readColorFilter() { return this->readFlattenable<SkColorFilte
r>(); } | 133 SkColorFilter* readColorFilter() { return this->readFlattenable<SkColorFilte
r>(); } |
134 SkDrawLooper* readDrawLooper() { return this->readFlattenable<SkDrawLooper
>(); } | 134 SkDrawLooper* readDrawLooper() { return this->readFlattenable<SkDrawLooper
>(); } |
135 SkImageFilter* readImageFilter() { return this->readFlattenable<SkImageFilte
r>(); } | 135 SkImageFilter* readImageFilter() { return this->readFlattenable<SkImageFilte
r>(); } |
136 SkMaskFilter* readMaskFilter() { return this->readFlattenable<SkMaskFilter
>(); } | 136 SkMaskFilter* readMaskFilter() { return this->readFlattenable<SkMaskFilter
>(); } |
137 SkPathEffect* readPathEffect() { return this->readFlattenable<SkPathEffect
>(); } | 137 sk_sp<SkPathEffect> readPathEffect() { |
| 138 return sk_sp<SkPathEffect>(this->readFlattenable<SkPathEffect>()); |
| 139 } |
138 SkRasterizer* readRasterizer() { return this->readFlattenable<SkRasterizer
>(); } | 140 SkRasterizer* readRasterizer() { return this->readFlattenable<SkRasterizer
>(); } |
139 sk_sp<SkShader> readShader() { return sk_sp<SkShader>(this->readFlattena
ble<SkShader>()); } | 141 sk_sp<SkShader> readShader() { return sk_sp<SkShader>(this->readFlattena
ble<SkShader>()); } |
140 SkXfermode* readXfermode() { return this->readFlattenable<SkXfermode>(
); } | 142 SkXfermode* readXfermode() { return this->readFlattenable<SkXfermode>(
); } |
141 | 143 |
142 /** | 144 /** |
143 * Like readFlattenable() but explicitly just skips the data that was writt
en for the | 145 * Like readFlattenable() but explicitly just skips the data that was writt
en for the |
144 * flattenable (or the sentinel that there wasn't one). | 146 * flattenable (or the sentinel that there wasn't one). |
145 */ | 147 */ |
146 virtual void skipFlattenable(); | 148 virtual void skipFlattenable(); |
147 | 149 |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
241 SkPicture::InstallPixelRefProc fBitmapDecoder; | 243 SkPicture::InstallPixelRefProc fBitmapDecoder; |
242 | 244 |
243 #ifdef DEBUG_NON_DETERMINISTIC_ASSERT | 245 #ifdef DEBUG_NON_DETERMINISTIC_ASSERT |
244 // Debugging counter to keep track of how many bitmaps we | 246 // Debugging counter to keep track of how many bitmaps we |
245 // have decoded. | 247 // have decoded. |
246 int fDecodedBitmapIndex; | 248 int fDecodedBitmapIndex; |
247 #endif // DEBUG_NON_DETERMINISTIC_ASSERT | 249 #endif // DEBUG_NON_DETERMINISTIC_ASSERT |
248 }; | 250 }; |
249 | 251 |
250 #endif // SkReadBuffer_DEFINED | 252 #endif // SkReadBuffer_DEFINED |
OLD | NEW |