robertphillips@google.com | 736dd03 | 2013-07-15 15:06:54 +0000 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2013 Google Inc. |
| 3 | * |
| 4 | * Use of this source code is governed by a BSD-style license that can be |
| 5 | * found in the LICENSE file. |
| 6 | */ |
| 7 | |
| 8 | #ifndef SkGpuBlurUtils_DEFINED |
| 9 | #define SkGpuBlurUtils_DEFINED |
| 10 | |
| 11 | #if SK_SUPPORT_GPU |
reed | c9b5f8b | 2015-10-22 13:20:20 -0700 | [diff] [blame] | 12 | #include "GrTextureProvider.h" |
| 13 | |
robertphillips@google.com | 736dd03 | 2013-07-15 15:06:54 +0000 | [diff] [blame] | 14 | class GrTexture; |
| 15 | class GrContext; |
| 16 | #endif |
| 17 | |
| 18 | struct SkRect; |
| 19 | |
| 20 | namespace SkGpuBlurUtils { |
| 21 | |
| 22 | #if SK_SUPPORT_GPU |
| 23 | /** |
| 24 | * Applies a 2D Gaussian blur to a given texture. |
| 25 | * @param context The GPU context |
| 26 | * @param srcTexture The source texture to be blurred. |
| 27 | * @param canClobberSrc If true, srcTexture may be overwritten, and |
| 28 | * may be returned as the result. |
senorblanco | 07d56b1 | 2015-11-10 07:32:37 -0800 | [diff] [blame] | 29 | * @param dstBounds The destination bounds, relative to the source texture. |
| 30 | * @param srcBounds The source bounds, relative to the source texture. If non-null, |
| 31 | * no pixels will be sampled outside of this rectangle. |
robertphillips@google.com | 736dd03 | 2013-07-15 15:06:54 +0000 | [diff] [blame] | 32 | * @param sigmaX The blur's standard deviation in X. |
| 33 | * @param sigmaY The blur's standard deviation in Y. |
| 34 | * @return the blurred texture, which may be srcTexture reffed, or a |
| 35 | * new texture. It is the caller's responsibility to unref this texture. |
| 36 | */ |
| 37 | GrTexture* GaussianBlur(GrContext* context, |
| 38 | GrTexture* srcTexture, |
| 39 | bool canClobberSrc, |
senorblanco | 07d56b1 | 2015-11-10 07:32:37 -0800 | [diff] [blame] | 40 | const SkRect& dstBounds, |
| 41 | const SkRect* srcBounds, |
skia.committer@gmail.com | 977409a | 2013-07-16 07:00:56 +0000 | [diff] [blame] | 42 | float sigmaX, |
reed | 4e23cda | 2016-01-11 10:56:59 -0800 | [diff] [blame] | 43 | float sigmaY); |
robertphillips@google.com | 736dd03 | 2013-07-15 15:06:54 +0000 | [diff] [blame] | 44 | #endif |
| 45 | |
| 46 | }; |
| 47 | |
robertphillips@google.com | cce4102 | 2013-07-15 15:47:10 +0000 | [diff] [blame] | 48 | #endif |