| 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 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 185 * rect is set at construction time, and determines which pixels from the | 185 * rect is set at construction time, and determines which pixels from the |
| 186 * input image will be processed. The size of the crop rect should be | 186 * input image will be processed. The size of the crop rect should be |
| 187 * used as the size of the destination image. The origin of this rect | 187 * used as the size of the destination image. The origin of this rect |
| 188 * should be used to offset access to the input images, and should also | 188 * should be used to offset access to the input images, and should also |
| 189 * be added to the "offset" parameter in onFilterImage and | 189 * be added to the "offset" parameter in onFilterImage and |
| 190 * filterImageGPU(). (The latter ensures that the resulting buffer is | 190 * filterImageGPU(). (The latter ensures that the resulting buffer is |
| 191 * drawn in the correct location.) | 191 * drawn in the correct location.) |
| 192 */ | 192 */ |
| 193 bool cropRectIsSet() const { return fCropRect.flags() != 0x0; } | 193 bool cropRectIsSet() const { return fCropRect.flags() != 0x0; } |
| 194 | 194 |
| 195 CropRect getCropRect() const { return fCropRect; } |
| 196 |
| 195 // Default impl returns union of all input bounds. | 197 // Default impl returns union of all input bounds. |
| 196 virtual void computeFastBounds(const SkRect&, SkRect*) const; | 198 virtual void computeFastBounds(const SkRect&, SkRect*) const; |
| 197 | 199 |
| 198 /** | 200 /** |
| 199 * Create an SkMatrixImageFilter, which transforms its input by the given ma
trix. | 201 * Create an SkMatrixImageFilter, which transforms its input by the given ma
trix. |
| 200 */ | 202 */ |
| 201 static SkImageFilter* CreateMatrixFilter(const SkMatrix& matrix, | 203 static SkImageFilter* CreateMatrixFilter(const SkMatrix& matrix, |
| 202 SkFilterQuality, | 204 SkFilterQuality, |
| 203 SkImageFilter* input = NULL); | 205 SkImageFilter* input = NULL); |
| 204 | 206 |
| (...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 362 */ | 364 */ |
| 363 #define SK_IMAGEFILTER_UNFLATTEN_COMMON(localVar, expectedCount) \ | 365 #define SK_IMAGEFILTER_UNFLATTEN_COMMON(localVar, expectedCount) \ |
| 364 Common localVar; \ | 366 Common localVar; \ |
| 365 do { \ | 367 do { \ |
| 366 if (!localVar.unflatten(buffer, expectedCount)) { \ | 368 if (!localVar.unflatten(buffer, expectedCount)) { \ |
| 367 return NULL; \ | 369 return NULL; \ |
| 368 } \ | 370 } \ |
| 369 } while (0) | 371 } while (0) |
| 370 | 372 |
| 371 #endif | 373 #endif |
| OLD | NEW |