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 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
201 } else { | 201 } else { |
202 this->updateConstantColorComponentsForModulation(color, validFlags); | 202 this->updateConstantColorComponentsForModulation(color, validFlags); |
203 } | 203 } |
204 } | 204 } |
205 | 205 |
206 /////////////////////////////////////////////////////////////////////////////// | 206 /////////////////////////////////////////////////////////////////////////////// |
207 | 207 |
208 GR_DEFINE_EFFECT_TEST(GrTextureDomainEffect); | 208 GR_DEFINE_EFFECT_TEST(GrTextureDomainEffect); |
209 | 209 |
210 GrEffectRef* GrTextureDomainEffect::TestCreate(SkMWCRandom* random, | 210 GrEffectRef* GrTextureDomainEffect::TestCreate(SkMWCRandom* random, |
211 GrContext* context, | 211 GrContext*, |
212 GrTexture* textures[]) { | 212 GrTexture* textures[]) { |
213 int texIdx = random->nextBool() ? GrEffectUnitTest::kSkiaPMTextureIdx : | 213 int texIdx = random->nextBool() ? GrEffectUnitTest::kSkiaPMTextureIdx : |
214 GrEffectUnitTest::kAlphaTextureIdx; | 214 GrEffectUnitTest::kAlphaTextureIdx; |
215 GrRect domain; | 215 GrRect domain; |
216 domain.fLeft = random->nextUScalar1(); | 216 domain.fLeft = random->nextUScalar1(); |
217 domain.fRight = random->nextRangeScalar(domain.fLeft, SK_Scalar1); | 217 domain.fRight = random->nextRangeScalar(domain.fLeft, SK_Scalar1); |
218 domain.fTop = random->nextUScalar1(); | 218 domain.fTop = random->nextUScalar1(); |
219 domain.fBottom = random->nextRangeScalar(domain.fTop, SK_Scalar1); | 219 domain.fBottom = random->nextRangeScalar(domain.fTop, SK_Scalar1); |
220 WrapMode wrapMode = random->nextBool() ? kClamp_WrapMode : kDecal_WrapMode; | 220 WrapMode wrapMode = random->nextBool() ? kClamp_WrapMode : kDecal_WrapMode; |
221 const SkMatrix& matrix = GrEffectUnitTest::TestMatrix(random); | 221 const SkMatrix& matrix = GrEffectUnitTest::TestMatrix(random); |
222 return GrTextureDomainEffect::Create(textures[texIdx], matrix, domain, wrapM
ode); | 222 return GrTextureDomainEffect::Create(textures[texIdx], matrix, domain, wrapM
ode); |
223 } | 223 } |
OLD | NEW |