Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(68)

Side by Side Diff: src/core/SkReadBuffer.h

Issue 1821533002: guard rasterizer and drawlooper setters (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: update android sdk Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 SkColorFilter* readColorFilter() { return this->readFlattenable<SkColorFilte r>(); }
134 SkDrawLooper* readDrawLooper() { return this->readFlattenable<SkDrawLooper >(); } 134 sk_sp<SkDrawLooper> readDrawLooper() {
135 return sk_sp<SkDrawLooper>(this->readFlattenable<SkDrawLooper>());
136 }
135 SkImageFilter* readImageFilter() { return this->readFlattenable<SkImageFilte r>(); } 137 SkImageFilter* readImageFilter() { return this->readFlattenable<SkImageFilte r>(); }
136 SkMaskFilter* readMaskFilter() { return this->readFlattenable<SkMaskFilter >(); } 138 SkMaskFilter* readMaskFilter() { return this->readFlattenable<SkMaskFilter >(); }
137 sk_sp<SkPathEffect> readPathEffect() { 139 sk_sp<SkPathEffect> readPathEffect() {
138 return sk_sp<SkPathEffect>(this->readFlattenable<SkPathEffect>()); 140 return sk_sp<SkPathEffect>(this->readFlattenable<SkPathEffect>());
139 } 141 }
140 SkRasterizer* readRasterizer() { return this->readFlattenable<SkRasterizer >(); } 142 sk_sp<SkRasterizer> readRasterizer() {
143 return sk_sp<SkRasterizer>(this->readFlattenable<SkRasterizer>());
144 }
141 sk_sp<SkShader> readShader() { return sk_sp<SkShader>(this->readFlattena ble<SkShader>()); } 145 sk_sp<SkShader> readShader() { return sk_sp<SkShader>(this->readFlattena ble<SkShader>()); }
142 SkXfermode* readXfermode() { return this->readFlattenable<SkXfermode>( ); } 146 SkXfermode* readXfermode() { return this->readFlattenable<SkXfermode>( ); }
143 147
144 /** 148 /**
145 * Like readFlattenable() but explicitly just skips the data that was writt en for the 149 * Like readFlattenable() but explicitly just skips the data that was writt en for the
146 * flattenable (or the sentinel that there wasn't one). 150 * flattenable (or the sentinel that there wasn't one).
147 */ 151 */
148 virtual void skipFlattenable(); 152 virtual void skipFlattenable();
149 153
150 // binary data and arrays 154 // binary data and arrays
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
243 SkPicture::InstallPixelRefProc fBitmapDecoder; 247 SkPicture::InstallPixelRefProc fBitmapDecoder;
244 248
245 #ifdef DEBUG_NON_DETERMINISTIC_ASSERT 249 #ifdef DEBUG_NON_DETERMINISTIC_ASSERT
246 // Debugging counter to keep track of how many bitmaps we 250 // Debugging counter to keep track of how many bitmaps we
247 // have decoded. 251 // have decoded.
248 int fDecodedBitmapIndex; 252 int fDecodedBitmapIndex;
249 #endif // DEBUG_NON_DETERMINISTIC_ASSERT 253 #endif // DEBUG_NON_DETERMINISTIC_ASSERT
250 }; 254 };
251 255
252 #endif // SkReadBuffer_DEFINED 256 #endif // SkReadBuffer_DEFINED
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698