| 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 "GrTextureDomainEffect.h" | 8 #include "GrTextureDomainEffect.h" |
| 9 #include "GrSimpleTextureEffect.h" | 9 #include "GrSimpleTextureEffect.h" |
| 10 #include "GrTBackendEffectFactory.h" | 10 #include "GrTBackendEffectFactory.h" |
| (...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 214 this->updateConstantColorComponentsForModulation(color, validFlags); | 214 this->updateConstantColorComponentsForModulation(color, validFlags); |
| 215 } | 215 } |
| 216 } | 216 } |
| 217 | 217 |
| 218 /////////////////////////////////////////////////////////////////////////////// | 218 /////////////////////////////////////////////////////////////////////////////// |
| 219 | 219 |
| 220 GR_DEFINE_EFFECT_TEST(GrTextureDomainEffect); | 220 GR_DEFINE_EFFECT_TEST(GrTextureDomainEffect); |
| 221 | 221 |
| 222 GrEffectRef* GrTextureDomainEffect::TestCreate(SkMWCRandom* random, | 222 GrEffectRef* GrTextureDomainEffect::TestCreate(SkMWCRandom* random, |
| 223 GrContext*, | 223 GrContext*, |
| 224 const GrDrawTargetCaps&, |
| 224 GrTexture* textures[]) { | 225 GrTexture* textures[]) { |
| 225 int texIdx = random->nextBool() ? GrEffectUnitTest::kSkiaPMTextureIdx : | 226 int texIdx = random->nextBool() ? GrEffectUnitTest::kSkiaPMTextureIdx : |
| 226 GrEffectUnitTest::kAlphaTextureIdx; | 227 GrEffectUnitTest::kAlphaTextureIdx; |
| 227 GrRect domain; | 228 GrRect domain; |
| 228 domain.fLeft = random->nextUScalar1(); | 229 domain.fLeft = random->nextUScalar1(); |
| 229 domain.fRight = random->nextRangeScalar(domain.fLeft, SK_Scalar1); | 230 domain.fRight = random->nextRangeScalar(domain.fLeft, SK_Scalar1); |
| 230 domain.fTop = random->nextUScalar1(); | 231 domain.fTop = random->nextUScalar1(); |
| 231 domain.fBottom = random->nextRangeScalar(domain.fTop, SK_Scalar1); | 232 domain.fBottom = random->nextRangeScalar(domain.fTop, SK_Scalar1); |
| 232 WrapMode wrapMode = random->nextBool() ? kClamp_WrapMode : kDecal_WrapMode; | 233 WrapMode wrapMode = random->nextBool() ? kClamp_WrapMode : kDecal_WrapMode; |
| 233 const SkMatrix& matrix = GrEffectUnitTest::TestMatrix(random); | 234 const SkMatrix& matrix = GrEffectUnitTest::TestMatrix(random); |
| 234 bool bilerp = random->nextBool(); | 235 bool bilerp = random->nextBool(); |
| 235 CoordsType coords = random->nextBool() ? kLocal_CoordsType : kPosition_Coord
sType; | 236 CoordsType coords = random->nextBool() ? kLocal_CoordsType : kPosition_Coord
sType; |
| 236 return GrTextureDomainEffect::Create(textures[texIdx], | 237 return GrTextureDomainEffect::Create(textures[texIdx], |
| 237 matrix, | 238 matrix, |
| 238 domain, | 239 domain, |
| 239 wrapMode, | 240 wrapMode, |
| 240 bilerp, | 241 bilerp, |
| 241 coords); | 242 coords); |
| 242 } | 243 } |
| OLD | NEW |