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 SkImageFilter_DEFINED | 8 #ifndef SkImageFilter_DEFINED |
9 #define SkImageFilter_DEFINED | 9 #define SkImageFilter_DEFINED |
10 | 10 |
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
219 // the inputs, calling ref() on each, and then waiting for Common's dest
ructor to call | 219 // the inputs, calling ref() on each, and then waiting for Common's dest
ructor to call |
220 // unref() on each. | 220 // unref() on each. |
221 void detachInputs(SkImageFilter** inputs); | 221 void detachInputs(SkImageFilter** inputs); |
222 | 222 |
223 private: | 223 private: |
224 CropRect fCropRect; | 224 CropRect fCropRect; |
225 // most filters accept at most 2 input-filters | 225 // most filters accept at most 2 input-filters |
226 SkAutoSTArray<2, SkImageFilter*> fInputs; | 226 SkAutoSTArray<2, SkImageFilter*> fInputs; |
227 uint32_t fUniqueID; | 227 uint32_t fUniqueID; |
228 | 228 |
229 void allocInputs(int count); | 229 bool allocInputs(size_t count); |
230 }; | 230 }; |
231 | 231 |
232 SkImageFilter(int inputCount, SkImageFilter** inputs, const CropRect* cropRe
ct = NULL, uint32_t uniqueID = 0); | 232 SkImageFilter(int inputCount, SkImageFilter** inputs, const CropRect* cropRe
ct = NULL, uint32_t uniqueID = 0); |
233 | 233 |
234 virtual ~SkImageFilter(); | 234 virtual ~SkImageFilter(); |
235 | 235 |
236 /** | 236 /** |
237 * Constructs a new SkImageFilter read from an SkReadBuffer object. | 237 * Constructs a new SkImageFilter read from an SkReadBuffer object. |
238 * | 238 * |
239 * @param inputCount The exact number of inputs expected for this SkImag
eFilter object. | 239 * @param inputCount The exact number of inputs expected for this SkImag
eFilter object. |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
325 */ | 325 */ |
326 #define SK_IMAGEFILTER_UNFLATTEN_COMMON(localVar, expectedCount) \ | 326 #define SK_IMAGEFILTER_UNFLATTEN_COMMON(localVar, expectedCount) \ |
327 Common localVar; \ | 327 Common localVar; \ |
328 do { \ | 328 do { \ |
329 if (!localVar.unflatten(buffer, expectedCount)) { \ | 329 if (!localVar.unflatten(buffer, expectedCount)) { \ |
330 return NULL; \ | 330 return NULL; \ |
331 } \ | 331 } \ |
332 } while (0) | 332 } while (0) |
333 | 333 |
334 #endif | 334 #endif |
OLD | NEW |