aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/effects/GrGaussianConvolutionFragmentProcessor.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/GrGaussianConvolutionFragmentProcessor.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/GrGaussianConvolutionFragmentProcessor.h')
-rw-r--r--src/gpu/effects/GrGaussianConvolutionFragmentProcessor.h19
1 files changed, 17 insertions, 2 deletions
diff --git a/src/gpu/effects/GrGaussianConvolutionFragmentProcessor.h b/src/gpu/effects/GrGaussianConvolutionFragmentProcessor.h
index da40ec2b93..b4f5cb7921 100644
--- a/src/gpu/effects/GrGaussianConvolutionFragmentProcessor.h
+++ b/src/gpu/effects/GrGaussianConvolutionFragmentProcessor.h
@@ -29,7 +29,18 @@ public:
tex, dir, halfWidth, gaussianSigma, useBounds, bounds));
}
- virtual ~GrGaussianConvolutionFragmentProcessor();
+ static sk_sp<GrFragmentProcessor> Make(GrContext* context,
+ sk_sp<GrTextureProxy> proxy,
+ Direction dir,
+ int halfWidth,
+ float gaussianSigma,
+ bool useBounds,
+ float* bounds) {
+ return sk_sp<GrFragmentProcessor>(new GrGaussianConvolutionFragmentProcessor(
+ context, std::move(proxy), dir, halfWidth, gaussianSigma, useBounds, bounds));
+ }
+
+ ~GrGaussianConvolutionFragmentProcessor() override;
const float* kernel() const { return fKernel; }
@@ -52,6 +63,10 @@ private:
GrGaussianConvolutionFragmentProcessor(GrTexture*, Direction, int halfWidth,
float gaussianSigma, bool useBounds, float bounds[2]);
+ GrGaussianConvolutionFragmentProcessor(GrContext*, sk_sp<GrTextureProxy>, Direction,
+ int halfWidth, float gaussianSigma, bool useBounds,
+ float bounds[2]);
+
GrGLSLFragmentProcessor* onCreateGLSLInstance() const override;
void onGetGLSLProcessorKey(const GrShaderCaps&, GrProcessorKeyBuilder*) const override;
@@ -69,7 +84,7 @@ private:
// TODO: Inline the kernel constants into the generated shader code. This may involve pulling
// some of the logic from SkGpuBlurUtils into this class related to radius/sigma calculations.
float fKernel[kMaxKernelWidth];
- bool fUseBounds;
+ bool fUseBounds;
float fBounds[2];
typedef Gr1DKernelEffect INHERITED;