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

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

Issue 23576015: Change old PRG to be SkLCGRandom; change new one to SkRandom (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Fix some spurious SkMWCRandoms Created 7 years, 3 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 | Annotate | Revision Log
« no previous file with comments | « src/gpu/effects/GrSimpleTextureEffect.cpp ('k') | src/gpu/gl/GrGLProgramDesc.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 "GrTextureDomainEffect.h" 8 #include "GrTextureDomainEffect.h"
9 #include "GrSimpleTextureEffect.h" 9 #include "GrSimpleTextureEffect.h"
10 #include "GrTBackendEffectFactory.h" 10 #include "GrTBackendEffectFactory.h"
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after
203 *validFlags = 0; 203 *validFlags = 0;
204 } else { 204 } else {
205 this->updateConstantColorComponentsForModulation(color, validFlags); 205 this->updateConstantColorComponentsForModulation(color, validFlags);
206 } 206 }
207 } 207 }
208 208
209 /////////////////////////////////////////////////////////////////////////////// 209 ///////////////////////////////////////////////////////////////////////////////
210 210
211 GR_DEFINE_EFFECT_TEST(GrTextureDomainEffect); 211 GR_DEFINE_EFFECT_TEST(GrTextureDomainEffect);
212 212
213 GrEffectRef* GrTextureDomainEffect::TestCreate(SkMWCRandom* random, 213 GrEffectRef* GrTextureDomainEffect::TestCreate(SkRandom* random,
214 GrContext*, 214 GrContext*,
215 const GrDrawTargetCaps&, 215 const GrDrawTargetCaps&,
216 GrTexture* textures[]) { 216 GrTexture* textures[]) {
217 int texIdx = random->nextBool() ? GrEffectUnitTest::kSkiaPMTextureIdx : 217 int texIdx = random->nextBool() ? GrEffectUnitTest::kSkiaPMTextureIdx :
218 GrEffectUnitTest::kAlphaTextureIdx; 218 GrEffectUnitTest::kAlphaTextureIdx;
219 SkRect domain; 219 SkRect domain;
220 domain.fLeft = random->nextUScalar1(); 220 domain.fLeft = random->nextUScalar1();
221 domain.fRight = random->nextRangeScalar(domain.fLeft, SK_Scalar1); 221 domain.fRight = random->nextRangeScalar(domain.fLeft, SK_Scalar1);
222 domain.fTop = random->nextUScalar1(); 222 domain.fTop = random->nextUScalar1();
223 domain.fBottom = random->nextRangeScalar(domain.fTop, SK_Scalar1); 223 domain.fBottom = random->nextRangeScalar(domain.fTop, SK_Scalar1);
224 WrapMode wrapMode = random->nextBool() ? kClamp_WrapMode : kDecal_WrapMode; 224 WrapMode wrapMode = random->nextBool() ? kClamp_WrapMode : kDecal_WrapMode;
225 const SkMatrix& matrix = GrEffectUnitTest::TestMatrix(random); 225 const SkMatrix& matrix = GrEffectUnitTest::TestMatrix(random);
226 bool bilerp = random->nextBool(); 226 bool bilerp = random->nextBool();
227 CoordsType coords = random->nextBool() ? kLocal_CoordsType : kPosition_Coord sType; 227 CoordsType coords = random->nextBool() ? kLocal_CoordsType : kPosition_Coord sType;
228 return GrTextureDomainEffect::Create(textures[texIdx], 228 return GrTextureDomainEffect::Create(textures[texIdx],
229 matrix, 229 matrix,
230 domain, 230 domain,
231 wrapMode, 231 wrapMode,
232 bilerp ? GrTextureParams::kBilerp_Filte rMode : GrTextureParams::kNone_FilterMode, 232 bilerp ? GrTextureParams::kBilerp_Filte rMode : GrTextureParams::kNone_FilterMode,
233 coords); 233 coords);
234 } 234 }
OLDNEW
« no previous file with comments | « src/gpu/effects/GrSimpleTextureEffect.cpp ('k') | src/gpu/gl/GrGLProgramDesc.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698