Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(209)

Side by Side Diff: src/gpu/effects/GrMatrixConvolutionEffect.cpp

Issue 654273002: Push isEqual/onIsEqual down from GrProcessor to subclasses. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/gpu/effects/GrMatrixConvolutionEffect.h ('k') | src/gpu/effects/GrOvalEffect.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "gl/builders/GrGLProgramBuilder.h" 7 #include "gl/builders/GrGLProgramBuilder.h"
8 #include "GrMatrixConvolutionEffect.h" 8 #include "GrMatrixConvolutionEffect.h"
9 #include "gl/GrGLProcessor.h" 9 #include "gl/GrGLProcessor.h"
10 #include "gl/GrGLSL.h" 10 #include "gl/GrGLSL.h"
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after
169 fKernelOffset[1] = static_cast<float>(kernelOffset.y()); 169 fKernelOffset[1] = static_cast<float>(kernelOffset.y());
170 } 170 }
171 171
172 GrMatrixConvolutionEffect::~GrMatrixConvolutionEffect() { 172 GrMatrixConvolutionEffect::~GrMatrixConvolutionEffect() {
173 } 173 }
174 174
175 const GrBackendFragmentProcessorFactory& GrMatrixConvolutionEffect::getFactory() const { 175 const GrBackendFragmentProcessorFactory& GrMatrixConvolutionEffect::getFactory() const {
176 return GrTBackendFragmentProcessorFactory<GrMatrixConvolutionEffect>::getIns tance(); 176 return GrTBackendFragmentProcessorFactory<GrMatrixConvolutionEffect>::getIns tance();
177 } 177 }
178 178
179 bool GrMatrixConvolutionEffect::onIsEqual(const GrProcessor& sBase) const { 179 bool GrMatrixConvolutionEffect::onIsEqual(const GrFragmentProcessor& sBase) cons t {
180 const GrMatrixConvolutionEffect& s = sBase.cast<GrMatrixConvolutionEffect>() ; 180 const GrMatrixConvolutionEffect& s = sBase.cast<GrMatrixConvolutionEffect>() ;
181 return this->texture(0) == s.texture(0) && 181 return this->texture(0) == s.texture(0) &&
182 fKernelSize == s.kernelSize() && 182 fKernelSize == s.kernelSize() &&
183 !memcmp(fKernel, s.kernel(), 183 !memcmp(fKernel, s.kernel(),
184 fKernelSize.width() * fKernelSize.height() * sizeof(float)) & & 184 fKernelSize.width() * fKernelSize.height() * sizeof(float)) & &
185 fGain == s.gain() && 185 fGain == s.gain() &&
186 fBias == s.bias() && 186 fBias == s.bias() &&
187 fKernelOffset == s.kernelOffset() && 187 fKernelOffset == s.kernelOffset() &&
188 fConvolveAlpha == s.convolveAlpha() && 188 fConvolveAlpha == s.convolveAlpha() &&
189 fDomain == s.domain(); 189 fDomain == s.domain();
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 }
OLDNEW
« no previous file with comments | « src/gpu/effects/GrMatrixConvolutionEffect.h ('k') | src/gpu/effects/GrOvalEffect.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698