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

Side by Side Diff: include/core/SkImageFilter.h

Issue 831583004: Adding check on input count (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 11 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
« no previous file with comments | « no previous file | src/core/SkImageFilter.cpp » ('j') | src/core/SkImageFilter.cpp » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 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
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
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
OLDNEW
« no previous file with comments | « no previous file | src/core/SkImageFilter.cpp » ('j') | src/core/SkImageFilter.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698