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 |
11 #include "SkFilterQuality.h" | |
11 #include "SkFlattenable.h" | 12 #include "SkFlattenable.h" |
12 #include "SkMatrix.h" | 13 #include "SkMatrix.h" |
13 #include "SkRect.h" | 14 #include "SkRect.h" |
14 #include "SkTemplates.h" | 15 #include "SkTemplates.h" |
15 | 16 |
16 class SkBitmap; | 17 class SkBitmap; |
17 class SkColorFilter; | 18 class SkColorFilter; |
18 class SkBaseDevice; | 19 class SkBaseDevice; |
19 class SkSurfaceProps; | 20 class SkSurfaceProps; |
20 struct SkIPoint; | 21 struct SkIPoint; |
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
185 * should be used to offset access to the input images, and should also | 186 * should be used to offset access to the input images, and should also |
186 * be added to the "offset" parameter in onFilterImage and | 187 * be added to the "offset" parameter in onFilterImage and |
187 * filterImageGPU(). (The latter ensures that the resulting buffer is | 188 * filterImageGPU(). (The latter ensures that the resulting buffer is |
188 * drawn in the correct location.) | 189 * drawn in the correct location.) |
189 */ | 190 */ |
190 bool cropRectIsSet() const { return fCropRect.flags() != 0x0; } | 191 bool cropRectIsSet() const { return fCropRect.flags() != 0x0; } |
191 | 192 |
192 // Default impl returns union of all input bounds. | 193 // Default impl returns union of all input bounds. |
193 virtual void computeFastBounds(const SkRect&, SkRect*) const; | 194 virtual void computeFastBounds(const SkRect&, SkRect*) const; |
194 | 195 |
196 /** | |
197 * Create an SkMatrixImageFilter, which transforms its input by the given ma trix. | |
198 */ | |
199 static SkImageFilter* CreateMatrix(const SkMatrix& matrix, | |
Stephen White
2015/03/19 18:47:42
BTW, I was thinking of changing this to CreateMatr
reed1
2015/03/19 20:50:01
Agreed, CreateMatrixFilter is more consistent with
| |
200 SkFilterQuality, | |
201 SkImageFilter* input = NULL); | |
202 | |
195 #if SK_SUPPORT_GPU | 203 #if SK_SUPPORT_GPU |
196 /** | 204 /** |
197 * Wrap the given texture in a texture-backed SkBitmap. | 205 * Wrap the given texture in a texture-backed SkBitmap. |
198 */ | 206 */ |
199 static void WrapTexture(GrTexture* texture, int width, int height, SkBitmap* result); | 207 static void WrapTexture(GrTexture* texture, int width, int height, SkBitmap* result); |
200 | 208 |
201 /** | 209 /** |
202 * Recursively evaluate this filter on the GPU. If the filter has no GPU | 210 * Recursively evaluate this filter on the GPU. If the filter has no GPU |
203 * implementation, it will be processed in software and uploaded to the GPU. | 211 * implementation, it will be processed in software and uploaded to the GPU. |
204 */ | 212 */ |
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
349 */ | 357 */ |
350 #define SK_IMAGEFILTER_UNFLATTEN_COMMON(localVar, expectedCount) \ | 358 #define SK_IMAGEFILTER_UNFLATTEN_COMMON(localVar, expectedCount) \ |
351 Common localVar; \ | 359 Common localVar; \ |
352 do { \ | 360 do { \ |
353 if (!localVar.unflatten(buffer, expectedCount)) { \ | 361 if (!localVar.unflatten(buffer, expectedCount)) { \ |
354 return NULL; \ | 362 return NULL; \ |
355 } \ | 363 } \ |
356 } while (0) | 364 } while (0) |
357 | 365 |
358 #endif | 366 #endif |
OLD | NEW |