OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2013 Google Inc. | 2 * Copyright 2013 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 SkGpuBlurUtils_DEFINED | 8 #ifndef SkGpuBlurUtils_DEFINED |
9 #define SkGpuBlurUtils_DEFINED | 9 #define SkGpuBlurUtils_DEFINED |
10 | 10 |
11 #if SK_SUPPORT_GPU | 11 #if SK_SUPPORT_GPU |
12 class GrTexture; | 12 class GrTexture; |
13 class GrContext; | 13 class GrContext; |
14 #endif | 14 #endif |
15 | 15 |
16 struct SkRect; | 16 struct SkRect; |
17 | 17 |
18 namespace SkGpuBlurUtils { | 18 namespace SkGpuBlurUtils { |
19 | 19 |
20 #if SK_SUPPORT_GPU | 20 #if SK_SUPPORT_GPU |
21 /** | 21 /** |
22 * Applies a 2D Gaussian blur to a given texture. | 22 * Applies a 2D Gaussian blur to a given texture. |
23 * @param context The GPU context | 23 * @param context The GPU context |
24 * @param srcTexture The source texture to be blurred. | 24 * @param srcTexture The source texture to be blurred. |
25 * @param canClobberSrc If true, srcTexture may be overwritten, and | 25 * @param canClobberSrc If true, srcTexture may be overwritten, and |
26 * may be returned as the result. | 26 * may be returned as the result. |
27 * @param rect The destination rectangle. | 27 * @param rect The destination rectangle. |
| 28 * @param cropToRect If true, do not sample any pixels outside the |
| 29 * source rect. |
28 * @param sigmaX The blur's standard deviation in X. | 30 * @param sigmaX The blur's standard deviation in X. |
29 * @param sigmaY The blur's standard deviation in Y. | 31 * @param sigmaY The blur's standard deviation in Y. |
30 * @return the blurred texture, which may be srcTexture reffed, or a | 32 * @return the blurred texture, which may be srcTexture reffed, or a |
31 * new texture. It is the caller's responsibility to unref this texture. | 33 * new texture. It is the caller's responsibility to unref this texture. |
32 */ | 34 */ |
33 GrTexture* GaussianBlur(GrContext* context, | 35 GrTexture* GaussianBlur(GrContext* context, |
34 GrTexture* srcTexture, | 36 GrTexture* srcTexture, |
35 bool canClobberSrc, | 37 bool canClobberSrc, |
36 const SkRect& rect, | 38 const SkRect& rect, |
| 39 bool cropToRect, |
37 float sigmaX, | 40 float sigmaX, |
38 float sigmaY); | 41 float sigmaY); |
39 #endif | 42 #endif |
40 | 43 |
41 }; | 44 }; |
42 | 45 |
43 #endif | 46 #endif |
OLD | NEW |