blob: 98be8130e28b7d178db781db0d0d896649ddb9cf [file] [log] [blame]
robertphillips@google.com736dd032013-07-15 15:06:54 +00001/*
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
12class GrTexture;
13class GrContext;
14#endif
15
16struct SkRect;
17
18namespace SkGpuBlurUtils {
19
20#if SK_SUPPORT_GPU
21 /**
22 * Applies a 2D Gaussian blur to a given texture.
23 * @param context The GPU context
24 * @param srcTexture The source texture to be blurred.
25 * @param canClobberSrc If true, srcTexture may be overwritten, and
26 * may be returned as the result.
27 * @param rect The destination rectangle.
senorblanco@chromium.org194d7752013-07-24 22:19:24 +000028 * @param cropToRect If true, do not sample any pixels outside the
29 * source rect.
robertphillips@google.com736dd032013-07-15 15:06:54 +000030 * @param sigmaX The blur's standard deviation in X.
31 * @param sigmaY The blur's standard deviation in Y.
32 * @return the blurred texture, which may be srcTexture reffed, or a
33 * new texture. It is the caller's responsibility to unref this texture.
34 */
35 GrTexture* GaussianBlur(GrContext* context,
36 GrTexture* srcTexture,
37 bool canClobberSrc,
38 const SkRect& rect,
senorblanco@chromium.org194d7752013-07-24 22:19:24 +000039 bool cropToRect,
skia.committer@gmail.com977409a2013-07-16 07:00:56 +000040 float sigmaX,
robertphillips@google.com736dd032013-07-15 15:06:54 +000041 float sigmaY);
42#endif
43
44};
45
robertphillips@google.comcce41022013-07-15 15:47:10 +000046#endif