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 #include "GrMatrixConvolutionEffect.h" | 7 #include "GrMatrixConvolutionEffect.h" |
8 #include "gl/GrGLProcessor.h" | 8 #include "gl/GrGLProcessor.h" |
9 #include "gl/GrGLSL.h" | 9 #include "gl/GrGLSL.h" |
10 #include "gl/GrGLTexture.h" | 10 #include "gl/GrGLTexture.h" |
11 #include "gl/builders/GrGLProgramBuilder.h" | 11 #include "gl/builders/GrGLProgramBuilder.h" |
12 | 12 |
13 class GrGLMatrixConvolutionEffect : public GrGLFragmentProcessor { | 13 class GrGLMatrixConvolutionEffect : public GrGLFragmentProcessor { |
14 public: | 14 public: |
15 GrGLMatrixConvolutionEffect(const GrProcessor&); | 15 GrGLMatrixConvolutionEffect(const GrProcessor&); |
16 virtual void emitCode(GrGLFPBuilder*, | 16 virtual void emitCode(GrGLFPBuilder*, |
17 const GrFragmentProcessor&, | 17 const GrFragmentProcessor&, |
18 const char* outputColor, | 18 const char* outputColor, |
19 const char* inputColor, | 19 const char* inputColor, |
20 const TransformedCoordsArray&, | 20 const TransformedCoordsArray&, |
21 const TextureSamplerArray&) SK_OVERRIDE; | 21 const TextureSamplerArray&) SK_OVERRIDE; |
22 | 22 |
23 static inline void GenKey(const GrProcessor&, const GrGLCaps&, GrProcessorKe
yBuilder*); | 23 static inline void GenKey(const GrProcessor&, const GrGLCaps&, GrProcessorKe
yBuilder*); |
24 | 24 |
25 virtual void setData(const GrGLProgramDataManager&, const GrProcessor&) SK_O
VERRIDE; | 25 void setData(const GrGLProgramDataManager&, const GrProcessor&) SK_OVERRIDE; |
26 | 26 |
27 private: | 27 private: |
28 typedef GrGLProgramDataManager::UniformHandle UniformHandle; | 28 typedef GrGLProgramDataManager::UniformHandle UniformHandle; |
29 SkISize fKernelSize; | 29 SkISize fKernelSize; |
30 bool fConvolveAlpha; | 30 bool fConvolveAlpha; |
31 | 31 |
32 UniformHandle fBoundsUni; | 32 UniformHandle fBoundsUni; |
33 UniformHandle fKernelUni; | 33 UniformHandle fKernelUni; |
34 UniformHandle fImageIncrementUni; | 34 UniformHandle fImageIncrementUni; |
35 UniformHandle fKernelOffsetUni; | 35 UniformHandle fKernelOffsetUni; |
(...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
266 return GrMatrixConvolutionEffect::Create(textures[texIdx], | 266 return GrMatrixConvolutionEffect::Create(textures[texIdx], |
267 bounds, | 267 bounds, |
268 kernelSize, | 268 kernelSize, |
269 kernel.get(), | 269 kernel.get(), |
270 gain, | 270 gain, |
271 bias, | 271 bias, |
272 kernelOffset, | 272 kernelOffset, |
273 tileMode, | 273 tileMode, |
274 convolveAlpha); | 274 convolveAlpha); |
275 } | 275 } |
OLD | NEW |