blob: 357a0d729ca2146cc859a8516f277caeb5b50af9 [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
reedc9b5f8b2015-10-22 13:20:20 -070012#include "GrTextureProvider.h"
13
robertphillips@google.com736dd032013-07-15 15:06:54 +000014class GrTexture;
15class GrContext;
16#endif
17
18struct SkRect;
19
20namespace 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.
29 * @param rect The destination rectangle.
senorblanco@chromium.org194d7752013-07-24 22:19:24 +000030 * @param cropToRect If true, do not sample any pixels outside the
31 * source rect.
robertphillips@google.com736dd032013-07-15 15:06:54 +000032 * @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,
40 const SkRect& rect,
senorblanco@chromium.org194d7752013-07-24 22:19:24 +000041 bool cropToRect,
skia.committer@gmail.com977409a2013-07-16 07:00:56 +000042 float sigmaX,
reedc9b5f8b2015-10-22 13:20:20 -070043 float sigmaY,
44 GrTextureProvider::SizeConstraint);
robertphillips@google.com736dd032013-07-15 15:06:54 +000045#endif
46
47};
48
robertphillips@google.comcce41022013-07-15 15:47:10 +000049#endif