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

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

Issue 1213623022: fix up test create functions (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: more cleanup Created 5 years, 5 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/GrSimpleTextureEffect.cpp ('k') | tests/GLProgramsTest.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 "GrTextureDomain.h" 8 #include "GrTextureDomain.h"
9 #include "GrInvariantOutput.h" 9 #include "GrInvariantOutput.h"
10 #include "GrSimpleTextureEffect.h" 10 #include "GrSimpleTextureEffect.h"
(...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after
279 } 279 }
280 } else { 280 } else {
281 this->updateInvariantOutputForModulation(inout); 281 this->updateInvariantOutputForModulation(inout);
282 } 282 }
283 } 283 }
284 284
285 /////////////////////////////////////////////////////////////////////////////// 285 ///////////////////////////////////////////////////////////////////////////////
286 286
287 GR_DEFINE_FRAGMENT_PROCESSOR_TEST(GrTextureDomainEffect); 287 GR_DEFINE_FRAGMENT_PROCESSOR_TEST(GrTextureDomainEffect);
288 288
289 GrFragmentProcessor* GrTextureDomainEffect::TestCreate(SkRandom* random, 289 GrFragmentProcessor* GrTextureDomainEffect::TestCreate(GrProcessorTestData* d) {
290 GrContext*, 290 int texIdx = d->fRandom->nextBool() ? GrProcessorUnitTest::kSkiaPMTextureIdx :
291 const GrCaps&, 291 GrProcessorUnitTest::kAlphaTextureIdx;
292 GrTexture* textures[]) {
293 int texIdx = random->nextBool() ? GrProcessorUnitTest::kSkiaPMTextureIdx :
294 GrProcessorUnitTest::kAlphaTextureIdx;
295 SkRect domain; 292 SkRect domain;
296 domain.fLeft = random->nextUScalar1(); 293 domain.fLeft = d->fRandom->nextUScalar1();
297 domain.fRight = random->nextRangeScalar(domain.fLeft, SK_Scalar1); 294 domain.fRight = d->fRandom->nextRangeScalar(domain.fLeft, SK_Scalar1);
298 domain.fTop = random->nextUScalar1(); 295 domain.fTop = d->fRandom->nextUScalar1();
299 domain.fBottom = random->nextRangeScalar(domain.fTop, SK_Scalar1); 296 domain.fBottom = d->fRandom->nextRangeScalar(domain.fTop, SK_Scalar1);
300 GrTextureDomain::Mode mode = 297 GrTextureDomain::Mode mode =
301 (GrTextureDomain::Mode) random->nextULessThan(GrTextureDomain::kModeCoun t); 298 (GrTextureDomain::Mode) d->fRandom->nextULessThan(GrTextureDomain::kMode Count);
302 const SkMatrix& matrix = GrTest::TestMatrix(random); 299 const SkMatrix& matrix = GrTest::TestMatrix(d->fRandom);
303 bool bilerp = mode != GrTextureDomain::kRepeat_Mode ? random->nextBool() : f alse; 300 bool bilerp = mode != GrTextureDomain::kRepeat_Mode ? d->fRandom->nextBool() : false;
304 GrCoordSet coords = random->nextBool() ? kLocal_GrCoordSet : kDevice_GrCoord Set; 301 GrCoordSet coords = d->fRandom->nextBool() ? kLocal_GrCoordSet : kDevice_GrC oordSet;
305 return GrTextureDomainEffect::Create(textures[texIdx], 302 return GrTextureDomainEffect::Create(d->fTextures[texIdx],
306 matrix, 303 matrix,
307 domain, 304 domain,
308 mode, 305 mode,
309 bilerp ? GrTextureParams::kBilerp_Filte rMode : GrTextureParams::kNone_FilterMode, 306 bilerp ? GrTextureParams::kBilerp_Filte rMode : GrTextureParams::kNone_FilterMode,
310 coords); 307 coords);
311 } 308 }
OLDNEW
« no previous file with comments | « src/gpu/effects/GrSimpleTextureEffect.cpp ('k') | tests/GLProgramsTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698