michael@0: /* michael@0: * Copyright 2013 Google Inc. michael@0: * michael@0: * Use of this source code is governed by a BSD-style license that can be michael@0: * found in the LICENSE file. michael@0: */ michael@0: michael@0: #ifndef SkGpuBlurUtils_DEFINED michael@0: #define SkGpuBlurUtils_DEFINED michael@0: michael@0: #if SK_SUPPORT_GPU michael@0: class GrTexture; michael@0: class GrContext; michael@0: #endif michael@0: michael@0: struct SkRect; michael@0: michael@0: namespace SkGpuBlurUtils { michael@0: michael@0: #if SK_SUPPORT_GPU michael@0: /** michael@0: * Applies a 2D Gaussian blur to a given texture. michael@0: * @param context The GPU context michael@0: * @param srcTexture The source texture to be blurred. michael@0: * @param canClobberSrc If true, srcTexture may be overwritten, and michael@0: * may be returned as the result. michael@0: * @param rect The destination rectangle. michael@0: * @param cropToRect If true, do not sample any pixels outside the michael@0: * source rect. michael@0: * @param sigmaX The blur's standard deviation in X. michael@0: * @param sigmaY The blur's standard deviation in Y. michael@0: * @return the blurred texture, which may be srcTexture reffed, or a michael@0: * new texture. It is the caller's responsibility to unref this texture. michael@0: */ michael@0: GrTexture* GaussianBlur(GrContext* context, michael@0: GrTexture* srcTexture, michael@0: bool canClobberSrc, michael@0: const SkRect& rect, michael@0: bool cropToRect, michael@0: float sigmaX, michael@0: float sigmaY); michael@0: #endif michael@0: michael@0: }; michael@0: michael@0: #endif