diff options
author | Brian Salomon <bsalomon@google.com> | 2017-07-27 11:53:21 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2017-07-27 16:18:33 +0000 |
commit | b133ffe76973865955a93644092307cf3d98662c (patch) | |
tree | 18787d632702d7841c49088166c307fbea094427 /src/gpu/effects/GrGaussianConvolutionFragmentProcessor.h | |
parent | 164f6ecb842f530017acb7ee814b2a55444f4462 (diff) |
Remove Gr1DKernelEffect "helper" class.
Change-Id: I748e49eeacb782fb738c08d5475c442dbce3ad5a
Reviewed-on: https://skia-review.googlesource.com/27500
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Diffstat (limited to 'src/gpu/effects/GrGaussianConvolutionFragmentProcessor.h')
-rw-r--r-- | src/gpu/effects/GrGaussianConvolutionFragmentProcessor.h | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/src/gpu/effects/GrGaussianConvolutionFragmentProcessor.h b/src/gpu/effects/GrGaussianConvolutionFragmentProcessor.h index 7496c35d44..bdc4384a2c 100644 --- a/src/gpu/effects/GrGaussianConvolutionFragmentProcessor.h +++ b/src/gpu/effects/GrGaussianConvolutionFragmentProcessor.h @@ -8,7 +8,8 @@ #ifndef GrGaussianConvolutionFragmentProcessor_DEFINED #define GrGaussianConvolutionFragmentProcessor_DEFINED -#include "Gr1DKernelEffect.h" +#include "GrCoordTransform.h" +#include "GrFragmentProcessor.h" #include "GrTextureDomain.h" /** @@ -16,8 +17,10 @@ * Each texel is multiplied by it's weight and summed to determine the filtered color. The output * color is set to a modulation of the filtered and input colors. */ -class GrGaussianConvolutionFragmentProcessor : public Gr1DKernelEffect { +class GrGaussianConvolutionFragmentProcessor : public GrFragmentProcessor { public: + enum class Direction { kX, kY }; + /// Convolve with a Gaussian kernel static sk_sp<GrFragmentProcessor> Make(sk_sp<GrTextureProxy> proxy, Direction dir, @@ -35,6 +38,9 @@ public: const int* bounds() const { return fBounds; } bool useBounds() const { return fMode != GrTextureDomain::kIgnore_Mode; } + int radius() const { return fRadius; } + int width() const { return 2 * fRadius + 1; } + Direction direction() const { return fDirection; } GrTextureDomain::Mode mode() const { return fMode; } @@ -63,13 +69,17 @@ private: GR_DECLARE_FRAGMENT_PROCESSOR_TEST + GrCoordTransform fCoordTransform; + TextureSampler fTextureSampler; // 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]; int fBounds[2]; + int fRadius; + Direction fDirection; GrTextureDomain::Mode fMode; - typedef Gr1DKernelEffect INHERITED; + typedef GrFragmentProcessor INHERITED; }; #endif |