| 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 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 223 | 223 |
| 224 CropRect getCropRect() const { return fCropRect; } | 224 CropRect getCropRect() const { return fCropRect; } |
| 225 | 225 |
| 226 // Default impl returns union of all input bounds. | 226 // Default impl returns union of all input bounds. |
| 227 virtual void computeFastBounds(const SkRect&, SkRect*) const; | 227 virtual void computeFastBounds(const SkRect&, SkRect*) const; |
| 228 | 228 |
| 229 // Can this filter DAG compute the resulting bounds of an object-space recta
ngle? | 229 // Can this filter DAG compute the resulting bounds of an object-space recta
ngle? |
| 230 bool canComputeFastBounds() const; | 230 bool canComputeFastBounds() const; |
| 231 | 231 |
| 232 /** | 232 /** |
| 233 * If this filter can be represented by another filter + a localMatrix, ret
urn that filter, |
| 234 * else return null. |
| 235 */ |
| 236 SkImageFilter* newWithLocalMatrix(const SkMatrix& matrix) const; |
| 237 |
| 238 /** |
| 233 * Create an SkMatrixImageFilter, which transforms its input by the given ma
trix. | 239 * Create an SkMatrixImageFilter, which transforms its input by the given ma
trix. |
| 234 */ | 240 */ |
| 235 static SkImageFilter* CreateMatrixFilter(const SkMatrix& matrix, | 241 static SkImageFilter* CreateMatrixFilter(const SkMatrix& matrix, |
| 236 SkFilterQuality, | 242 SkFilterQuality, |
| 237 SkImageFilter* input = NULL); | 243 SkImageFilter* input = NULL); |
| 238 | 244 |
| 239 /** | |
| 240 * Create an SkLocalMatrixImageFilter, which transform the filter parameters | |
| 241 * of its inputs by the given matrix. | |
| 242 */ | |
| 243 static SkImageFilter* CreateLocalMatrixFilter(const SkMatrix& matrix, | |
| 244 SkImageFilter* input); | |
| 245 | |
| 246 #if SK_SUPPORT_GPU | 245 #if SK_SUPPORT_GPU |
| 247 /** | 246 /** |
| 248 * Wrap the given texture in a texture-backed SkBitmap. | 247 * Wrap the given texture in a texture-backed SkBitmap. |
| 249 */ | 248 */ |
| 250 static void WrapTexture(GrTexture* texture, int width, int height, SkBitmap*
result); | 249 static void WrapTexture(GrTexture* texture, int width, int height, SkBitmap*
result); |
| 251 | 250 |
| 252 /** | 251 /** |
| 253 * Recursively evaluate this filter on the GPU. If the filter has no GPU | 252 * Recursively evaluate this filter on the GPU. If the filter has no GPU |
| 254 * implementation, it will be processed in software and uploaded to the GPU. | 253 * implementation, it will be processed in software and uploaded to the GPU. |
| 255 */ | 254 */ |
| (...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 411 */ | 410 */ |
| 412 #define SK_IMAGEFILTER_UNFLATTEN_COMMON(localVar, expectedCount) \ | 411 #define SK_IMAGEFILTER_UNFLATTEN_COMMON(localVar, expectedCount) \ |
| 413 Common localVar; \ | 412 Common localVar; \ |
| 414 do { \ | 413 do { \ |
| 415 if (!localVar.unflatten(buffer, expectedCount)) { \ | 414 if (!localVar.unflatten(buffer, expectedCount)) { \ |
| 416 return NULL; \ | 415 return NULL; \ |
| 417 } \ | 416 } \ |
| 418 } while (0) | 417 } while (0) |
| 419 | 418 |
| 420 #endif | 419 #endif |
| OLD | NEW |