| 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" |
| 13 |
| 12 class GrTexture; | 14 class GrTexture; |
| 13 class GrContext; | 15 class GrContext; |
| 14 #endif | 16 #endif |
| 15 | 17 |
| 16 struct SkRect; | 18 struct SkRect; |
| 17 | 19 |
| 18 namespace SkGpuBlurUtils { | 20 namespace SkGpuBlurUtils { |
| 19 | 21 |
| 20 #if SK_SUPPORT_GPU | 22 #if SK_SUPPORT_GPU |
| 21 /** | 23 /** |
| 22 * Applies a 2D Gaussian blur to a given texture. | 24 * Applies a 2D Gaussian blur to a given texture. |
| 23 * @param context The GPU context | 25 * @param context The GPU context |
| 24 * @param srcTexture The source texture to be blurred. | 26 * @param srcTexture The source texture to be blurred. |
| 25 * @param canClobberSrc If true, srcTexture may be overwritten, and | 27 * @param canClobberSrc If true, srcTexture may be overwritten, and |
| 26 * may be returned as the result. | 28 * may be returned as the result. |
| 27 * @param rect The destination rectangle. | 29 * @param rect The destination rectangle. |
| 28 * @param cropToRect If true, do not sample any pixels outside the | 30 * @param cropToRect If true, do not sample any pixels outside the |
| 29 * source rect. | 31 * source rect. |
| 30 * @param sigmaX The blur's standard deviation in X. | 32 * @param sigmaX The blur's standard deviation in X. |
| 31 * @param sigmaY The blur's standard deviation in Y. | 33 * @param sigmaY The blur's standard deviation in Y. |
| 32 * @return the blurred texture, which may be srcTexture reffed, or a | 34 * @return the blurred texture, which may be srcTexture reffed, or a |
| 33 * new texture. It is the caller's responsibility to unref this texture. | 35 * new texture. It is the caller's responsibility to unref this texture. |
| 34 */ | 36 */ |
| 35 GrTexture* GaussianBlur(GrContext* context, | 37 GrTexture* GaussianBlur(GrContext* context, |
| 36 GrTexture* srcTexture, | 38 GrTexture* srcTexture, |
| 37 bool canClobberSrc, | 39 bool canClobberSrc, |
| 38 const SkRect& rect, | 40 const SkRect& rect, |
| 39 bool cropToRect, | 41 bool cropToRect, |
| 40 float sigmaX, | 42 float sigmaX, |
| 41 float sigmaY); | 43 float sigmaY, |
| 44 GrTextureProvider::SizeConstraint); |
| 42 #endif | 45 #endif |
| 43 | 46 |
| 44 }; | 47 }; |
| 45 | 48 |
| 46 #endif | 49 #endif |
| OLD | NEW |