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 "GrRenderTargetContext.h" | 12 #include "GrRenderTargetContext.h" |
13 | 13 |
14 class GrContext; | 14 class GrContext; |
15 class GrTexture; | 15 class GrTextureProxy; |
16 | 16 |
17 struct SkRect; | 17 struct SkRect; |
18 | 18 |
19 namespace SkGpuBlurUtils { | 19 namespace SkGpuBlurUtils { |
20 /** | 20 /** |
21 * Applies a 2D Gaussian blur to a given texture. The blurred result is retur
ned | 21 * Applies a 2D Gaussian blur to a given texture. The blurred result is retur
ned |
22 * as a renderTargetContext in case the caller wishes to future draw into the
result. | 22 * as a renderTargetContext in case the caller wishes to future draw into the
result. |
23 * Note: one of sigmaX and sigmaY should be non-zero! | 23 * Note: one of sigmaX and sigmaY should be non-zero! |
24 * @param context The GPU context | 24 * @param context The GPU context |
25 * @param srcTexture The source texture to be blurred. | 25 * @param srcTexture The source texture to be blurred. |
26 * @param colorSpace Color space of the source (used for the renderTarge
tContext result, | 26 * @param colorSpace Color space of the source (used for the renderTarge
tContext result, |
27 * too). | 27 * too). |
28 * @param dstBounds The destination bounds, relative to the source text
ure. | 28 * @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, | 29 * @param srcBounds The source bounds, relative to the source texture.
If non-null, |
30 * no pixels will be sampled outside of this rectangle
. | 30 * no pixels will be sampled outside of this rectangle
. |
31 * @param sigmaX The blur's standard deviation in X. | 31 * @param sigmaX The blur's standard deviation in X. |
32 * @param sigmaY The blur's standard deviation in Y. | 32 * @param sigmaY The blur's standard deviation in Y. |
33 * @param fit backing fit for the returned render target context | 33 * @param fit backing fit for the returned render target context |
34 * @return The renderTargetContext containing the blurred resu
lt. | 34 * @return The renderTargetContext containing the blurred resu
lt. |
35 */ | 35 */ |
36 sk_sp<GrRenderTargetContext> GaussianBlur(GrContext* context, | 36 sk_sp<GrRenderTargetContext> GaussianBlur(GrContext* context, |
37 GrTexture* srcTexture, | 37 GrTextureProxy* srcTexture, |
38 sk_sp<SkColorSpace> colorSpace, | 38 sk_sp<SkColorSpace> colorSpace, |
39 const SkIRect& dstBounds, | 39 const SkIRect& dstBounds, |
40 const SkIRect* srcBounds, | 40 const SkIRect* srcBounds, |
41 float sigmaX, | 41 float sigmaX, |
42 float sigmaY, | 42 float sigmaY, |
43 SkBackingFit fit = SkBackingFit::k
Approx); | 43 SkBackingFit fit = SkBackingFit::k
Approx); |
44 }; | 44 }; |
45 | 45 |
46 #endif | 46 #endif |
47 #endif | 47 #endif |
OLD | NEW |