| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2014 Google Inc. | 2 * Copyright 2014 Google Inc. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
| 5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
| 6 */ | 6 */ |
| 7 | 7 |
| 8 #ifndef GrMatrixConvolutionEffect_DEFINED | 8 #ifndef GrMatrixConvolutionEffect_DEFINED |
| 9 #define GrMatrixConvolutionEffect_DEFINED | 9 #define GrMatrixConvolutionEffect_DEFINED |
| 10 | 10 |
| 11 #include "GrSingleTextureEffect.h" | 11 #include "GrSingleTextureEffect.h" |
| 12 #include "GrInvariantOutput.h" |
| 12 #include "GrTextureDomain.h" | 13 #include "GrTextureDomain.h" |
| 13 | 14 |
| 14 // A little bit less than the minimum # uniforms required by DX9SM2 (32). | 15 // A little bit less than the minimum # uniforms required by DX9SM2 (32). |
| 15 // Allows for a 5x5 kernel (or 25x1, for that matter). | 16 // Allows for a 5x5 kernel (or 25x1, for that matter). |
| 16 #define MAX_KERNEL_SIZE 25 | 17 #define MAX_KERNEL_SIZE 25 |
| 17 | 18 |
| 18 class GrGLMatrixConvolutionEffect; | 19 class GrGLMatrixConvolutionEffect; |
| 19 | 20 |
| 20 class GrMatrixConvolutionEffect : public GrSingleTextureEffect { | 21 class GrMatrixConvolutionEffect : public GrSingleTextureEffect { |
| 21 public: | 22 public: |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 72 const SkISize& kernelSize, | 73 const SkISize& kernelSize, |
| 73 const SkScalar* kernel, | 74 const SkScalar* kernel, |
| 74 SkScalar gain, | 75 SkScalar gain, |
| 75 SkScalar bias, | 76 SkScalar bias, |
| 76 const SkIPoint& kernelOffset, | 77 const SkIPoint& kernelOffset, |
| 77 GrTextureDomain::Mode tileMode, | 78 GrTextureDomain::Mode tileMode, |
| 78 bool convolveAlpha); | 79 bool convolveAlpha); |
| 79 | 80 |
| 80 virtual bool onIsEqual(const GrFragmentProcessor&) const SK_OVERRIDE; | 81 virtual bool onIsEqual(const GrFragmentProcessor&) const SK_OVERRIDE; |
| 81 | 82 |
| 82 virtual void onComputeInvariantOutput(InvariantOutput* inout) const SK_OVERR
IDE { | 83 virtual void onComputeInvariantOutput(GrInvariantOutput* inout) const SK_OVE
RRIDE { |
| 83 // TODO: Try to do better? | 84 // TODO: Try to do better? |
| 84 inout->mulByUnknownColor(); | 85 inout->mulByUnknownColor(); |
| 85 } | 86 } |
| 86 | 87 |
| 87 SkIRect fBounds; | 88 SkIRect fBounds; |
| 88 SkISize fKernelSize; | 89 SkISize fKernelSize; |
| 89 float fKernel[MAX_KERNEL_SIZE]; | 90 float fKernel[MAX_KERNEL_SIZE]; |
| 90 float fGain; | 91 float fGain; |
| 91 float fBias; | 92 float fBias; |
| 92 float fKernelOffset[2]; | 93 float fKernelOffset[2]; |
| 93 bool fConvolveAlpha; | 94 bool fConvolveAlpha; |
| 94 GrTextureDomain fDomain; | 95 GrTextureDomain fDomain; |
| 95 | 96 |
| 96 GR_DECLARE_FRAGMENT_PROCESSOR_TEST; | 97 GR_DECLARE_FRAGMENT_PROCESSOR_TEST; |
| 97 | 98 |
| 98 typedef GrSingleTextureEffect INHERITED; | 99 typedef GrSingleTextureEffect INHERITED; |
| 99 }; | 100 }; |
| 100 | 101 |
| 101 #endif | 102 #endif |
| OLD | NEW |