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

Side by Side Diff: src/gpu/effects/GrConvolutionEffect.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/GrConvolutionEffect.h ('k') | src/gpu/effects/GrCustomCoordsTextureEffect.h » ('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 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 #include "gl/builders/GrGLProgramBuilder.h" 8 #include "gl/builders/GrGLProgramBuilder.h"
9 #include "GrConvolutionEffect.h" 9 #include "GrConvolutionEffect.h"
10 #include "gl/GrGLProcessor.h" 10 #include "gl/GrGLProcessor.h"
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after
193 memcpy(fBounds, bounds, sizeof(fBounds)); 193 memcpy(fBounds, bounds, sizeof(fBounds));
194 } 194 }
195 195
196 GrConvolutionEffect::~GrConvolutionEffect() { 196 GrConvolutionEffect::~GrConvolutionEffect() {
197 } 197 }
198 198
199 const GrBackendFragmentProcessorFactory& GrConvolutionEffect::getFactory() const { 199 const GrBackendFragmentProcessorFactory& GrConvolutionEffect::getFactory() const {
200 return GrTBackendFragmentProcessorFactory<GrConvolutionEffect>::getInstance( ); 200 return GrTBackendFragmentProcessorFactory<GrConvolutionEffect>::getInstance( );
201 } 201 }
202 202
203 bool GrConvolutionEffect::onIsEqual(const GrProcessor& sBase) const { 203 bool GrConvolutionEffect::onIsEqual(const GrFragmentProcessor& sBase) const {
204 const GrConvolutionEffect& s = sBase.cast<GrConvolutionEffect>(); 204 const GrConvolutionEffect& s = sBase.cast<GrConvolutionEffect>();
205 return (this->texture(0) == s.texture(0) && 205 return (this->texture(0) == s.texture(0) &&
206 this->radius() == s.radius() && 206 this->radius() == s.radius() &&
207 this->direction() == s.direction() && 207 this->direction() == s.direction() &&
208 this->useBounds() == s.useBounds() && 208 this->useBounds() == s.useBounds() &&
209 0 == memcmp(fBounds, s.fBounds, sizeof(fBounds)) && 209 0 == memcmp(fBounds, s.fBounds, sizeof(fBounds)) &&
210 0 == memcmp(fKernel, s.fKernel, this->width() * sizeof(float))); 210 0 == memcmp(fKernel, s.fKernel, this->width() * sizeof(float)));
211 } 211 }
212 212
213 /////////////////////////////////////////////////////////////////////////////// 213 ///////////////////////////////////////////////////////////////////////////////
(...skipping 18 matching lines...) Expand all
232 } 232 }
233 233
234 bool useBounds = random->nextBool(); 234 bool useBounds = random->nextBool();
235 return GrConvolutionEffect::Create(textures[texIdx], 235 return GrConvolutionEffect::Create(textures[texIdx],
236 dir, 236 dir,
237 radius, 237 radius,
238 kernel, 238 kernel,
239 useBounds, 239 useBounds,
240 bounds); 240 bounds);
241 } 241 }
OLDNEW
« no previous file with comments | « src/gpu/effects/GrConvolutionEffect.h ('k') | src/gpu/effects/GrCustomCoordsTextureEffect.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698