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

Unified Diff: src/gpu/effects/GrSimpleTextureEffect.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/GrRRectEffect.cpp ('k') | src/gpu/effects/GrTextureDomain.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/effects/GrSimpleTextureEffect.cpp
diff --git a/src/gpu/effects/GrSimpleTextureEffect.cpp b/src/gpu/effects/GrSimpleTextureEffect.cpp
index 370b2ce9a9446d3e0a289586663ac868272312d1..0f6f4032a4953820e2f2c02ef5fc6d44a39274af 100644
--- a/src/gpu/effects/GrSimpleTextureEffect.cpp
+++ b/src/gpu/effects/GrSimpleTextureEffect.cpp
@@ -55,30 +55,27 @@ GrGLFragmentProcessor* GrSimpleTextureEffect::createGLInstance() const {
GR_DEFINE_FRAGMENT_PROCESSOR_TEST(GrSimpleTextureEffect);
-GrFragmentProcessor* GrSimpleTextureEffect::TestCreate(SkRandom* random,
- GrContext*,
- const GrCaps&,
- GrTexture* textures[]) {
- int texIdx = random->nextBool() ? GrProcessorUnitTest::kSkiaPMTextureIdx :
- GrProcessorUnitTest::kAlphaTextureIdx;
+GrFragmentProcessor* GrSimpleTextureEffect::TestCreate(GrProcessorTestData* d) {
+ int texIdx = d->fRandom->nextBool() ? GrProcessorUnitTest::kSkiaPMTextureIdx :
+ GrProcessorUnitTest::kAlphaTextureIdx;
static const SkShader::TileMode kTileModes[] = {
SkShader::kClamp_TileMode,
SkShader::kRepeat_TileMode,
SkShader::kMirror_TileMode,
};
SkShader::TileMode tileModes[] = {
- kTileModes[random->nextULessThan(SK_ARRAY_COUNT(kTileModes))],
- kTileModes[random->nextULessThan(SK_ARRAY_COUNT(kTileModes))],
+ kTileModes[d->fRandom->nextULessThan(SK_ARRAY_COUNT(kTileModes))],
+ kTileModes[d->fRandom->nextULessThan(SK_ARRAY_COUNT(kTileModes))],
};
- GrTextureParams params(tileModes, random->nextBool() ? GrTextureParams::kBilerp_FilterMode :
- GrTextureParams::kNone_FilterMode);
+ GrTextureParams params(tileModes, d->fRandom->nextBool() ? GrTextureParams::kBilerp_FilterMode :
+ GrTextureParams::kNone_FilterMode);
static const GrCoordSet kCoordSets[] = {
kLocal_GrCoordSet,
kDevice_GrCoordSet
};
- GrCoordSet coordSet = kCoordSets[random->nextULessThan(SK_ARRAY_COUNT(kCoordSets))];
+ GrCoordSet coordSet = kCoordSets[d->fRandom->nextULessThan(SK_ARRAY_COUNT(kCoordSets))];
- const SkMatrix& matrix = GrTest::TestMatrix(random);
- return GrSimpleTextureEffect::Create(textures[texIdx], matrix, coordSet);
+ const SkMatrix& matrix = GrTest::TestMatrix(d->fRandom);
+ return GrSimpleTextureEffect::Create(d->fTextures[texIdx], matrix, coordSet);
}
« no previous file with comments | « src/gpu/effects/GrRRectEffect.cpp ('k') | src/gpu/effects/GrTextureDomain.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698