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/GrGLFragmentProcessor.h" | 8 #include "gl/GrGLFragmentProcessor.h" |
9 #include "gl/GrGLTexture.h" | 9 #include "gl/GrGLTexture.h" |
10 #include "gl/builders/GrGLProgramBuilder.h" | 10 #include "gl/builders/GrGLProgramBuilder.h" |
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
148 for (int i = 0; i < kernelSize.width() * kernelSize.height(); i++) { | 148 for (int i = 0; i < kernelSize.width() * kernelSize.height(); i++) { |
149 fKernel[i] = SkScalarToFloat(kernel[i]); | 149 fKernel[i] = SkScalarToFloat(kernel[i]); |
150 } | 150 } |
151 fKernelOffset[0] = static_cast<float>(kernelOffset.x()); | 151 fKernelOffset[0] = static_cast<float>(kernelOffset.x()); |
152 fKernelOffset[1] = static_cast<float>(kernelOffset.y()); | 152 fKernelOffset[1] = static_cast<float>(kernelOffset.y()); |
153 } | 153 } |
154 | 154 |
155 GrMatrixConvolutionEffect::~GrMatrixConvolutionEffect() { | 155 GrMatrixConvolutionEffect::~GrMatrixConvolutionEffect() { |
156 } | 156 } |
157 | 157 |
158 void GrMatrixConvolutionEffect::getGLProcessorKey(const GrGLSLCaps& caps, | 158 void GrMatrixConvolutionEffect::onGetGLProcessorKey(const GrGLSLCaps& caps, |
159 GrProcessorKeyBuilder* b) cons
t { | 159 GrProcessorKeyBuilder* b) cons
t { |
160 GrGLMatrixConvolutionEffect::GenKey(*this, caps, b); | 160 GrGLMatrixConvolutionEffect::GenKey(*this, caps, b); |
161 } | 161 } |
162 | 162 |
163 GrGLFragmentProcessor* GrMatrixConvolutionEffect::createGLInstance() const { | 163 GrGLFragmentProcessor* GrMatrixConvolutionEffect::createGLInstance() const { |
164 return SkNEW_ARGS(GrGLMatrixConvolutionEffect, (*this)); | 164 return SkNEW_ARGS(GrGLMatrixConvolutionEffect, (*this)); |
165 } | 165 } |
166 | 166 |
167 bool GrMatrixConvolutionEffect::onIsEqual(const GrFragmentProcessor& sBase) cons
t { | 167 bool GrMatrixConvolutionEffect::onIsEqual(const GrFragmentProcessor& sBase) cons
t { |
168 const GrMatrixConvolutionEffect& s = sBase.cast<GrMatrixConvolutionEffect>()
; | 168 const GrMatrixConvolutionEffect& s = sBase.cast<GrMatrixConvolutionEffect>()
; |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
254 d->fTextures[texIdx], | 254 d->fTextures[texIdx], |
255 bounds, | 255 bounds, |
256 kernelSize, | 256 kernelSize, |
257 kernel.get(), | 257 kernel.get(), |
258 gain, | 258 gain, |
259 bias, | 259 bias, |
260 kernelOffset, | 260 kernelOffset, |
261 tileMode, | 261 tileMode, |
262 convolveAlpha); | 262 convolveAlpha); |
263 } | 263 } |
OLD | NEW |