| OLD | NEW |
| 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 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 GrProcessor& sBase) const { | 266 bool GrTextureDomainEffect::onIsEqual(const GrProcessor& sBase) const { |
| 267 const GrTextureDomainEffect& s = sBase.cast<GrTextureDomainEffect>(); | 267 const GrTextureDomainEffect& s = sBase.cast<GrTextureDomainEffect>(); |
| 268 return this->hasSameTextureParamsMatrixAndSourceCoords(s) && | 268 return this->hasSameTextureParamsMatrixAndSourceCoords(s) && |
| 269 this->fTextureDomain == s.fTextureDomain; | 269 this->fTextureDomain == s.fTextureDomain; |
| 270 } | 270 } |
| 271 | 271 |
| 272 void GrTextureDomainEffect::getConstantColorComponents(GrColor* color, uint32_t*
validFlags) const { | 272 void GrTextureDomainEffect::onGetConstantColorComponents(GrColor* color, uint32_
t* validFlags, |
| 273 bool* isSingleComponent
) const { |
| 273 if (GrTextureDomain::kDecal_Mode == fTextureDomain.mode()) { // TODO: helper | 274 if (GrTextureDomain::kDecal_Mode == fTextureDomain.mode()) { // TODO: helper |
| 274 *validFlags = 0; | 275 *validFlags = 0; |
| 275 } else { | 276 } else { |
| 276 this->updateConstantColorComponentsForModulation(color, validFlags); | 277 this->updateConstantColorComponentsForModulation(color, validFlags); |
| 277 } | 278 } |
| 278 } | 279 } |
| 279 | 280 |
| 280 /////////////////////////////////////////////////////////////////////////////// | 281 /////////////////////////////////////////////////////////////////////////////// |
| 281 | 282 |
| 282 GR_DEFINE_FRAGMENT_PROCESSOR_TEST(GrTextureDomainEffect); | 283 GR_DEFINE_FRAGMENT_PROCESSOR_TEST(GrTextureDomainEffect); |
| (...skipping 14 matching lines...) Expand all Loading... |
| 297 const SkMatrix& matrix = GrProcessorUnitTest::TestMatrix(random); | 298 const SkMatrix& matrix = GrProcessorUnitTest::TestMatrix(random); |
| 298 bool bilerp = mode != GrTextureDomain::kRepeat_Mode ? random->nextBool() : f
alse; | 299 bool bilerp = mode != GrTextureDomain::kRepeat_Mode ? random->nextBool() : f
alse; |
| 299 GrCoordSet coords = random->nextBool() ? kLocal_GrCoordSet : kPosition_GrCoo
rdSet; | 300 GrCoordSet coords = random->nextBool() ? kLocal_GrCoordSet : kPosition_GrCoo
rdSet; |
| 300 return GrTextureDomainEffect::Create(textures[texIdx], | 301 return GrTextureDomainEffect::Create(textures[texIdx], |
| 301 matrix, | 302 matrix, |
| 302 domain, | 303 domain, |
| 303 mode, | 304 mode, |
| 304 bilerp ? GrTextureParams::kBilerp_Filte
rMode : GrTextureParams::kNone_FilterMode, | 305 bilerp ? GrTextureParams::kBilerp_Filte
rMode : GrTextureParams::kNone_FilterMode, |
| 305 coords); | 306 coords); |
| 306 } | 307 } |
| OLD | NEW |