OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2012 Google Inc. | 2 * Copyright 2012 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 GrConvolutionEffect_DEFINED | 8 #ifndef GrConvolutionEffect_DEFINED |
9 #define GrConvolutionEffect_DEFINED | 9 #define GrConvolutionEffect_DEFINED |
10 | 10 |
11 #include "Gr1DKernelEffect.h" | 11 #include "Gr1DKernelEffect.h" |
| 12 #include "GrInvariantOutput.h" |
12 | 13 |
13 class GrGLConvolutionEffect; | 14 class GrGLConvolutionEffect; |
14 | 15 |
15 /** | 16 /** |
16 * A convolution effect. The kernel is specified as an array of 2 * half-width | 17 * A convolution effect. The kernel is specified as an array of 2 * half-width |
17 * + 1 weights. Each texel is multiplied by it's weight and summed to determine | 18 * + 1 weights. Each texel is multiplied by it's weight and summed to determine |
18 * the output color. The output color is modulated by the input color. | 19 * the output color. The output color is modulated by the input color. |
19 */ | 20 */ |
20 class GrConvolutionEffect : public Gr1DKernelEffect { | 21 class GrConvolutionEffect : public Gr1DKernelEffect { |
21 | 22 |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 | 91 |
91 /// Convolve with a Gaussian kernel | 92 /// Convolve with a Gaussian kernel |
92 GrConvolutionEffect(GrTexture*, Direction, | 93 GrConvolutionEffect(GrTexture*, Direction, |
93 int halfWidth, | 94 int halfWidth, |
94 float gaussianSigma, | 95 float gaussianSigma, |
95 bool useBounds, | 96 bool useBounds, |
96 float bounds[2]); | 97 float bounds[2]); |
97 | 98 |
98 virtual bool onIsEqual(const GrFragmentProcessor&) const SK_OVERRIDE; | 99 virtual bool onIsEqual(const GrFragmentProcessor&) const SK_OVERRIDE; |
99 | 100 |
100 virtual void onComputeInvariantOutput(InvariantOutput* inout) const { | 101 virtual void onComputeInvariantOutput(GrInvariantOutput* inout) const { |
101 // If the texture was opaque we could know that the output color if we k
new the sum of the | 102 // If the texture was opaque we could know that the output color if we k
new the sum of the |
102 // kernel values. | 103 // kernel values. |
103 inout->mulByUnknownColor(); | 104 inout->mulByUnknownColor(); |
104 } | 105 } |
105 | 106 |
106 GR_DECLARE_FRAGMENT_PROCESSOR_TEST; | 107 GR_DECLARE_FRAGMENT_PROCESSOR_TEST; |
107 | 108 |
108 typedef Gr1DKernelEffect INHERITED; | 109 typedef Gr1DKernelEffect INHERITED; |
109 }; | 110 }; |
110 | 111 |
111 #endif | 112 #endif |
OLD | NEW |