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

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

Issue 654313002: Auto-compare GrProcessors' texture accesses in isEqual(). (Closed) Base URL: https://skia.googlesource.com/skia.git@xformcomp
Patch Set: update 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/GrSingleTextureEffect.h ('k') | src/gpu/effects/GrYUVtoRGBEffect.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 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 "GrTextureDomain.h" 9 #include "GrTextureDomain.h"
10 #include "GrSimpleTextureEffect.h" 10 #include "GrSimpleTextureEffect.h"
(...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after
258 GrTextureDomainEffect::~GrTextureDomainEffect() { 258 GrTextureDomainEffect::~GrTextureDomainEffect() {
259 259
260 } 260 }
261 261
262 const GrBackendFragmentProcessorFactory& GrTextureDomainEffect::getFactory() con st { 262 const GrBackendFragmentProcessorFactory& GrTextureDomainEffect::getFactory() con st {
263 return GrTBackendFragmentProcessorFactory<GrTextureDomainEffect>::getInstanc e(); 263 return GrTBackendFragmentProcessorFactory<GrTextureDomainEffect>::getInstanc e();
264 } 264 }
265 265
266 bool GrTextureDomainEffect::onIsEqual(const GrFragmentProcessor& sBase) const { 266 bool GrTextureDomainEffect::onIsEqual(const GrFragmentProcessor& sBase) const {
267 const GrTextureDomainEffect& s = sBase.cast<GrTextureDomainEffect>(); 267 const GrTextureDomainEffect& s = sBase.cast<GrTextureDomainEffect>();
268 return this->hasSameTextureParamsMatrixAndSourceCoords(s) && 268 return this->fTextureDomain == s.fTextureDomain;
269 this->fTextureDomain == s.fTextureDomain;
270 } 269 }
271 270
272 void GrTextureDomainEffect::onComputeInvariantOutput(InvariantOutput* inout) con st { 271 void GrTextureDomainEffect::onComputeInvariantOutput(InvariantOutput* inout) con st {
273 if (GrTextureDomain::kDecal_Mode == fTextureDomain.mode()) { // TODO: helper 272 if (GrTextureDomain::kDecal_Mode == fTextureDomain.mode()) { // TODO: helper
274 inout->mulByUnknownColor(); 273 inout->mulByUnknownColor();
275 } else { 274 } else {
276 this->updateInvariantOutputForModulation(inout); 275 this->updateInvariantOutputForModulation(inout);
277 } 276 }
278 } 277 }
279 278
(...skipping 17 matching lines...) Expand all
297 const SkMatrix& matrix = GrProcessorUnitTest::TestMatrix(random); 296 const SkMatrix& matrix = GrProcessorUnitTest::TestMatrix(random);
298 bool bilerp = mode != GrTextureDomain::kRepeat_Mode ? random->nextBool() : f alse; 297 bool bilerp = mode != GrTextureDomain::kRepeat_Mode ? random->nextBool() : f alse;
299 GrCoordSet coords = random->nextBool() ? kLocal_GrCoordSet : kPosition_GrCoo rdSet; 298 GrCoordSet coords = random->nextBool() ? kLocal_GrCoordSet : kPosition_GrCoo rdSet;
300 return GrTextureDomainEffect::Create(textures[texIdx], 299 return GrTextureDomainEffect::Create(textures[texIdx],
301 matrix, 300 matrix,
302 domain, 301 domain,
303 mode, 302 mode,
304 bilerp ? GrTextureParams::kBilerp_Filte rMode : GrTextureParams::kNone_FilterMode, 303 bilerp ? GrTextureParams::kBilerp_Filte rMode : GrTextureParams::kNone_FilterMode,
305 coords); 304 coords);
306 } 305 }
OLDNEW
« no previous file with comments | « src/gpu/effects/GrSingleTextureEffect.h ('k') | src/gpu/effects/GrYUVtoRGBEffect.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698