| 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 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 123 virtual void readRect(SkRect* rect); | 123 virtual void readRect(SkRect* rect); |
| 124 virtual void readRegion(SkRegion* region); | 124 virtual void readRegion(SkRegion* region); |
| 125 | 125 |
| 126 virtual void readPath(SkPath* path); | 126 virtual void readPath(SkPath* path); |
| 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 sk_sp<SkColorFilter> readColorFilter() { |
| 134 return sk_sp<SkColorFilter>(this->readFlattenable<SkColorFilter>()); |
| 135 } |
| 134 sk_sp<SkDrawLooper> readDrawLooper() { | 136 sk_sp<SkDrawLooper> readDrawLooper() { |
| 135 return sk_sp<SkDrawLooper>(this->readFlattenable<SkDrawLooper>()); | 137 return sk_sp<SkDrawLooper>(this->readFlattenable<SkDrawLooper>()); |
| 136 } | 138 } |
| 137 SkImageFilter* readImageFilter() { return this->readFlattenable<SkImageFilte
r>(); } | 139 SkImageFilter* readImageFilter() { return this->readFlattenable<SkImageFilte
r>(); } |
| 138 SkMaskFilter* readMaskFilter() { return this->readFlattenable<SkMaskFilter
>(); } | 140 SkMaskFilter* readMaskFilter() { return this->readFlattenable<SkMaskFilter
>(); } |
| 139 sk_sp<SkPathEffect> readPathEffect() { | 141 sk_sp<SkPathEffect> readPathEffect() { |
| 140 return sk_sp<SkPathEffect>(this->readFlattenable<SkPathEffect>()); | 142 return sk_sp<SkPathEffect>(this->readFlattenable<SkPathEffect>()); |
| 141 } | 143 } |
| 142 sk_sp<SkRasterizer> readRasterizer() { | 144 sk_sp<SkRasterizer> readRasterizer() { |
| 143 return sk_sp<SkRasterizer>(this->readFlattenable<SkRasterizer>()); | 145 return sk_sp<SkRasterizer>(this->readFlattenable<SkRasterizer>()); |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 247 SkPicture::InstallPixelRefProc fBitmapDecoder; | 249 SkPicture::InstallPixelRefProc fBitmapDecoder; |
| 248 | 250 |
| 249 #ifdef DEBUG_NON_DETERMINISTIC_ASSERT | 251 #ifdef DEBUG_NON_DETERMINISTIC_ASSERT |
| 250 // Debugging counter to keep track of how many bitmaps we | 252 // Debugging counter to keep track of how many bitmaps we |
| 251 // have decoded. | 253 // have decoded. |
| 252 int fDecodedBitmapIndex; | 254 int fDecodedBitmapIndex; |
| 253 #endif // DEBUG_NON_DETERMINISTIC_ASSERT | 255 #endif // DEBUG_NON_DETERMINISTIC_ASSERT |
| 254 }; | 256 }; |
| 255 | 257 |
| 256 #endif // SkReadBuffer_DEFINED | 258 #endif // SkReadBuffer_DEFINED |
| OLD | NEW |