aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/effects/GrMatrixConvolutionEffect.h
diff options
context:
space:
mode:
authorGravatar Robert Phillips <robertphillips@google.com>2017-01-30 08:06:27 -0500
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-01-30 13:40:15 +0000
commit40fd7c94c24bb30d888c3d85a79cbb96c7fbf800 (patch)
tree075e886c01de864ba982910f1854f47ba1ae95d8 /src/gpu/effects/GrMatrixConvolutionEffect.h
parent55b72530fedeb58154635531751a8730982fbf2a (diff)
Push GrTextureProxy down to more effects
Change-Id: Ie3f32a88f25af082c25bc6daf3fe24e303e80f9e Reviewed-on: https://skia-review.googlesource.com/7616 Commit-Queue: Robert Phillips <robertphillips@google.com> Reviewed-by: Brian Salomon <bsalomon@google.com>
Diffstat (limited to 'src/gpu/effects/GrMatrixConvolutionEffect.h')
-rw-r--r--src/gpu/effects/GrMatrixConvolutionEffect.h38
1 files changed, 38 insertions, 0 deletions
diff --git a/src/gpu/effects/GrMatrixConvolutionEffect.h b/src/gpu/effects/GrMatrixConvolutionEffect.h
index 7cc88b651b..0bb7c5043a 100644
--- a/src/gpu/effects/GrMatrixConvolutionEffect.h
+++ b/src/gpu/effects/GrMatrixConvolutionEffect.h
@@ -43,6 +43,33 @@ public:
SkScalar sigmaX,
SkScalar sigmaY);
+ static sk_sp<GrFragmentProcessor> Make(GrContext* context,
+ sk_sp<GrTextureProxy> proxy,
+ const SkIRect& bounds,
+ const SkISize& kernelSize,
+ const SkScalar* kernel,
+ SkScalar gain,
+ SkScalar bias,
+ const SkIPoint& kernelOffset,
+ GrTextureDomain::Mode tileMode,
+ bool convolveAlpha) {
+ return sk_sp<GrFragmentProcessor>(
+ new GrMatrixConvolutionEffect(context, std::move(proxy), bounds, kernelSize, kernel,
+ gain, bias, kernelOffset, tileMode, convolveAlpha));
+ }
+
+ static sk_sp<GrFragmentProcessor> MakeGaussian(GrContext* context,
+ sk_sp<GrTextureProxy> proxy,
+ const SkIRect& bounds,
+ const SkISize& kernelSize,
+ SkScalar gain,
+ SkScalar bias,
+ const SkIPoint& kernelOffset,
+ GrTextureDomain::Mode tileMode,
+ bool convolveAlpha,
+ SkScalar sigmaX,
+ SkScalar sigmaY);
+
const SkIRect& bounds() const { return fBounds; }
const SkISize& kernelSize() const { return fKernelSize; }
const float* kernelOffset() const { return fKernelOffset; }
@@ -65,6 +92,17 @@ private:
GrTextureDomain::Mode tileMode,
bool convolveAlpha);
+ GrMatrixConvolutionEffect(GrContext*,
+ sk_sp<GrTextureProxy> proxy,
+ const SkIRect& bounds,
+ const SkISize& kernelSize,
+ const SkScalar* kernel,
+ SkScalar gain,
+ SkScalar bias,
+ const SkIPoint& kernelOffset,
+ GrTextureDomain::Mode tileMode,
+ bool convolveAlpha);
+
GrGLSLFragmentProcessor* onCreateGLSLInstance() const override;
void onGetGLSLProcessorKey(const GrShaderCaps&, GrProcessorKeyBuilder*) const override;