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

Unified 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/gpu/effects/GrSimpleTextureEffect.cpp ('k') | tests/GLProgramsTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/effects/GrTextureDomain.cpp
diff --git a/src/gpu/effects/GrTextureDomain.cpp b/src/gpu/effects/GrTextureDomain.cpp
index 7ac3a1899620f1b29a2e34a4873e8429cb450901..31f51aad2224e83aa25728ebbd5d86d64b170f07 100644
--- a/src/gpu/effects/GrTextureDomain.cpp
+++ b/src/gpu/effects/GrTextureDomain.cpp
@@ -286,23 +286,20 @@ void GrTextureDomainEffect::onComputeInvariantOutput(GrInvariantOutput* inout) c
GR_DEFINE_FRAGMENT_PROCESSOR_TEST(GrTextureDomainEffect);
-GrFragmentProcessor* GrTextureDomainEffect::TestCreate(SkRandom* random,
- GrContext*,
- const GrCaps&,
- GrTexture* textures[]) {
- int texIdx = random->nextBool() ? GrProcessorUnitTest::kSkiaPMTextureIdx :
- GrProcessorUnitTest::kAlphaTextureIdx;
+GrFragmentProcessor* GrTextureDomainEffect::TestCreate(GrProcessorTestData* d) {
+ int texIdx = d->fRandom->nextBool() ? GrProcessorUnitTest::kSkiaPMTextureIdx :
+ GrProcessorUnitTest::kAlphaTextureIdx;
SkRect domain;
- domain.fLeft = random->nextUScalar1();
- domain.fRight = random->nextRangeScalar(domain.fLeft, SK_Scalar1);
- domain.fTop = random->nextUScalar1();
- domain.fBottom = random->nextRangeScalar(domain.fTop, SK_Scalar1);
+ domain.fLeft = d->fRandom->nextUScalar1();
+ domain.fRight = d->fRandom->nextRangeScalar(domain.fLeft, SK_Scalar1);
+ domain.fTop = d->fRandom->nextUScalar1();
+ domain.fBottom = d->fRandom->nextRangeScalar(domain.fTop, SK_Scalar1);
GrTextureDomain::Mode mode =
- (GrTextureDomain::Mode) random->nextULessThan(GrTextureDomain::kModeCount);
- const SkMatrix& matrix = GrTest::TestMatrix(random);
- bool bilerp = mode != GrTextureDomain::kRepeat_Mode ? random->nextBool() : false;
- GrCoordSet coords = random->nextBool() ? kLocal_GrCoordSet : kDevice_GrCoordSet;
- return GrTextureDomainEffect::Create(textures[texIdx],
+ (GrTextureDomain::Mode) d->fRandom->nextULessThan(GrTextureDomain::kModeCount);
+ const SkMatrix& matrix = GrTest::TestMatrix(d->fRandom);
+ bool bilerp = mode != GrTextureDomain::kRepeat_Mode ? d->fRandom->nextBool() : false;
+ GrCoordSet coords = d->fRandom->nextBool() ? kLocal_GrCoordSet : kDevice_GrCoordSet;
+ return GrTextureDomainEffect::Create(d->fTextures[texIdx],
matrix,
domain,
mode,
« 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