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. The blurred result is retur
ned |
| 22 * as a drawContext in case the caller wishes to future draw into the result. |
| 23 * Note: one of sigmaX and sigmaY should be non-zero! |
25 * @param context The GPU context | 24 * @param context The GPU context |
26 * @param srcTexture The source texture to be blurred. | 25 * @param srcTexture The source texture to be blurred. |
27 * @param gammaCorrect Should blur be gamma-correct (sRGB to linear, etc..
.) | 26 * @param gammaCorrect Should blur be gamma-correct (sRGB to linear, etc..
.) |
28 * @param dstBounds The destination bounds, relative to the source text
ure. | 27 * @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, | 28 * @param srcBounds The source bounds, relative to the source texture.
If non-null, |
30 * no pixels will be sampled outside of this rectangle
. | 29 * no pixels will be sampled outside of this rectangle
. |
31 * @param sigmaX The blur's standard deviation in X. | 30 * @param sigmaX The blur's standard deviation in X. |
32 * @param sigmaY The blur's standard deviation in Y. | 31 * @param sigmaY The blur's standard deviation in Y. |
33 * @return the blurred texture, which may be srcTexture reffed, or a | 32 * @return The drawContext containing the blurred result. |
34 * new texture. It is the caller's responsibility to unref this texture. | |
35 */ | 33 */ |
36 GrTexture* GaussianBlur(GrContext* context, | 34 sk_sp<GrDrawContext> GaussianBlur(GrContext* context, |
37 GrTexture* srcTexture, | 35 GrTexture* srcTexture, |
38 bool gammaCorrect, | 36 bool gammaCorrect, |
39 const SkRect& dstBounds, | 37 const SkRect& dstBounds, |
40 const SkRect* srcBounds, | 38 const SkRect* srcBounds, |
41 float sigmaX, | 39 float sigmaX, |
42 float sigmaY); | 40 float sigmaY); |
43 #endif | |
44 | 41 |
45 }; | 42 }; |
46 | 43 |
47 #endif | 44 #endif |
| 45 #endif |
OLD | NEW |