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 |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 GrMatrixConvolutionEffect(GrTexture*, | 59 GrMatrixConvolutionEffect(GrTexture*, |
60 const SkIRect& bounds, | 60 const SkIRect& bounds, |
61 const SkISize& kernelSize, | 61 const SkISize& kernelSize, |
62 const SkScalar* kernel, | 62 const SkScalar* kernel, |
63 SkScalar gain, | 63 SkScalar gain, |
64 SkScalar bias, | 64 SkScalar bias, |
65 const SkIPoint& kernelOffset, | 65 const SkIPoint& kernelOffset, |
66 GrTextureDomain::Mode tileMode, | 66 GrTextureDomain::Mode tileMode, |
67 bool convolveAlpha); | 67 bool convolveAlpha); |
68 | 68 |
69 GrGLSLFragmentProcessor* onCreateGLInstance() const override; | 69 GrGLSLFragmentProcessor* onCreateGLSLInstance() const override; |
70 | 70 |
71 void onGetGLProcessorKey(const GrGLSLCaps&, GrProcessorKeyBuilder*) const ov
erride; | 71 void onGetGLSLProcessorKey(const GrGLSLCaps&, GrProcessorKeyBuilder*) const
override; |
72 | 72 |
73 bool onIsEqual(const GrFragmentProcessor&) const override; | 73 bool onIsEqual(const GrFragmentProcessor&) const override; |
74 | 74 |
75 void onComputeInvariantOutput(GrInvariantOutput* inout) const override { | 75 void onComputeInvariantOutput(GrInvariantOutput* inout) const override { |
76 // TODO: Try to do better? | 76 // TODO: Try to do better? |
77 inout->mulByUnknownFourComponents(); | 77 inout->mulByUnknownFourComponents(); |
78 } | 78 } |
79 | 79 |
80 SkIRect fBounds; | 80 SkIRect fBounds; |
81 SkISize fKernelSize; | 81 SkISize fKernelSize; |
82 float fKernel[MAX_KERNEL_SIZE]; | 82 float fKernel[MAX_KERNEL_SIZE]; |
83 float fGain; | 83 float fGain; |
84 float fBias; | 84 float fBias; |
85 float fKernelOffset[2]; | 85 float fKernelOffset[2]; |
86 bool fConvolveAlpha; | 86 bool fConvolveAlpha; |
87 GrTextureDomain fDomain; | 87 GrTextureDomain fDomain; |
88 | 88 |
89 GR_DECLARE_FRAGMENT_PROCESSOR_TEST; | 89 GR_DECLARE_FRAGMENT_PROCESSOR_TEST; |
90 | 90 |
91 typedef GrSingleTextureEffect INHERITED; | 91 typedef GrSingleTextureEffect INHERITED; |
92 }; | 92 }; |
93 | 93 |
94 #endif | 94 #endif |
OLD | NEW |