aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/effects/GrGaussianConvolutionFragmentProcessor.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/gpu/effects/GrGaussianConvolutionFragmentProcessor.h')
-rw-r--r--src/gpu/effects/GrGaussianConvolutionFragmentProcessor.h15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/gpu/effects/GrGaussianConvolutionFragmentProcessor.h b/src/gpu/effects/GrGaussianConvolutionFragmentProcessor.h
index d6398726b5..5f520df23b 100644
--- a/src/gpu/effects/GrGaussianConvolutionFragmentProcessor.h
+++ b/src/gpu/effects/GrGaussianConvolutionFragmentProcessor.h
@@ -9,6 +9,7 @@
#define GrGaussianConvolutionFragmentProcessor_DEFINED
#include "Gr1DKernelEffect.h"
+#include "GrTextureDomain.h"
/**
* A 1D Gaussian convolution effect. The kernel is computed as an array of 2 * half-width weights.
@@ -22,10 +23,10 @@ public:
Direction dir,
int halfWidth,
float gaussianSigma,
- bool useBounds,
+ GrTextureDomain::Mode mode,
int* bounds) {
return sk_sp<GrFragmentProcessor>(new GrGaussianConvolutionFragmentProcessor(
- std::move(proxy), dir, halfWidth, gaussianSigma, useBounds, bounds));
+ std::move(proxy), dir, halfWidth, gaussianSigma, mode, bounds));
}
~GrGaussianConvolutionFragmentProcessor() override;
@@ -33,7 +34,9 @@ public:
const float* kernel() const { return fKernel; }
const int* bounds() const { return fBounds; }
- bool useBounds() const { return fUseBounds; }
+ bool useBounds() const { return fMode != GrTextureDomain::kIgnore_Mode; }
+
+ GrTextureDomain::Mode mode() const { return fMode; }
const char* name() const override { return "GaussianConvolution"; }
@@ -49,8 +52,8 @@ public:
private:
/// Convolve with a Gaussian kernel
GrGaussianConvolutionFragmentProcessor(sk_sp<GrTextureProxy>, Direction,
- int halfWidth, float gaussianSigma, bool useBounds,
- int bounds[2]);
+ int halfWidth, float gaussianSigma,
+ GrTextureDomain::Mode mode, int bounds[2]);
GrGLSLFragmentProcessor* onCreateGLSLInstance() const override;
@@ -63,8 +66,8 @@ 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;
int fBounds[2];
+ GrTextureDomain::Mode fMode;
typedef Gr1DKernelEffect INHERITED;
};