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 #include "GrTextureProvider.h" | 12 #include "GrDrawContext.h" |
13 | 13 |
14 class GrContext; | |
14 class GrTexture; | 15 class GrTexture; |
15 class GrContext; | |
16 #endif | |
17 | 16 |
18 struct SkRect; | 17 struct SkRect; |
19 | 18 |
20 namespace SkGpuBlurUtils { | 19 namespace SkGpuBlurUtils { |
21 | |
22 #if SK_SUPPORT_GPU | |
23 /** | 20 /** |
24 * Applies a 2D Gaussian blur to a given texture. | 21 * Applies a 2D Gaussian blur to a given texture. |
25 * @param context The GPU context | 22 * @param context The GPU context |
26 * @param srcTexture The source texture to be blurred. | 23 * @param srcTexture The source texture to be blurred. |
27 * @param gammaCorrect Should blur be gamma-correct (sRGB to linear, etc.. .) | 24 * @param gammaCorrect Should blur be gamma-correct (sRGB to linear, etc.. .) |
28 * @param dstBounds The destination bounds, relative to the source text ure. | 25 * @param dstBounds The destination bounds, relative to the source text ure. |
29 * @param srcBounds The source bounds, relative to the source texture. If non-null, | 26 * @param srcBounds The source bounds, relative to the source texture. If non-null, |
30 * no pixels will be sampled outside of this rectangle . | 27 * no pixels will be sampled outside of this rectangle . |
31 * @param sigmaX The blur's standard deviation in X. | 28 * @param sigmaX The blur's standard deviation in X. |
32 * @param sigmaY The blur's standard deviation in Y. | 29 * @param sigmaY The blur's standard deviation in Y. |
33 * @return the blurred texture, which may be srcTexture reffed, or a | 30 * @return the blurred texture, which may be srcTexture reffed, or a |
34 * new texture. It is the caller's responsibility to unref this texture. | 31 * new texture. It is the caller's responsibility to unref this texture. |
bsalomon
2016/05/11 13:07:42
Maybe update this comment and note that callers ma
robertphillips
2016/05/11 14:26:30
Done.
| |
35 */ | 32 */ |
36 GrTexture* GaussianBlur(GrContext* context, | 33 sk_sp<GrDrawContext> GaussianBlur(GrContext* context, |
37 GrTexture* srcTexture, | 34 GrTexture* srcTexture, |
38 bool gammaCorrect, | 35 bool gammaCorrect, |
39 const SkRect& dstBounds, | 36 const SkRect& dstBounds, |
40 const SkRect* srcBounds, | 37 const SkRect* srcBounds, |
41 float sigmaX, | 38 float sigmaX, |
42 float sigmaY); | 39 float sigmaY); |
43 #endif | |
44 | 40 |
45 }; | 41 }; |
46 | 42 |
47 #endif | 43 #endif |
44 #endif | |
OLD | NEW |