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

Unified Diff: src/effects/SkPerlinNoiseShader.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/effects/SkMorphologyImageFilter.cpp ('k') | src/effects/SkTableColorFilter.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/effects/SkPerlinNoiseShader.cpp
diff --git a/src/effects/SkPerlinNoiseShader.cpp b/src/effects/SkPerlinNoiseShader.cpp
index 38a778406f26729582ea3247b6387a8e76a640f0..b6611209a499df00b12de36a9af7ddff38490fed 100644
--- a/src/effects/SkPerlinNoiseShader.cpp
+++ b/src/effects/SkPerlinNoiseShader.cpp
@@ -602,20 +602,18 @@ private:
/////////////////////////////////////////////////////////////////////
GR_DEFINE_FRAGMENT_PROCESSOR_TEST(GrPerlinNoiseEffect);
-GrFragmentProcessor* GrPerlinNoiseEffect::TestCreate(SkRandom* random,
- GrContext* context,
- const GrCaps&,
- GrTexture**) {
- int numOctaves = random->nextRangeU(2, 10);
- bool stitchTiles = random->nextBool();
- SkScalar seed = SkIntToScalar(random->nextU());
- SkISize tileSize = SkISize::Make(random->nextRangeU(4, 4096), random->nextRangeU(4, 4096));
- SkScalar baseFrequencyX = random->nextRangeScalar(0.01f,
- 0.99f);
- SkScalar baseFrequencyY = random->nextRangeScalar(0.01f,
- 0.99f);
-
- SkShader* shader = random->nextBool() ?
+GrFragmentProcessor* GrPerlinNoiseEffect::TestCreate(GrProcessorTestData* d) {
+ int numOctaves = d->fRandom->nextRangeU(2, 10);
+ bool stitchTiles = d->fRandom->nextBool();
+ SkScalar seed = SkIntToScalar(d->fRandom->nextU());
+ SkISize tileSize = SkISize::Make(d->fRandom->nextRangeU(4, 4096),
+ d->fRandom->nextRangeU(4, 4096));
+ SkScalar baseFrequencyX = d->fRandom->nextRangeScalar(0.01f,
+ 0.99f);
+ SkScalar baseFrequencyY = d->fRandom->nextRangeScalar(0.01f,
+ 0.99f);
+
+ SkShader* shader = d->fRandom->nextBool() ?
SkPerlinNoiseShader::CreateFractalNoise(baseFrequencyX, baseFrequencyY, numOctaves, seed,
stitchTiles ? &tileSize : NULL) :
SkPerlinNoiseShader::CreateTurbulence(baseFrequencyX, baseFrequencyY, numOctaves, seed,
@@ -625,8 +623,8 @@ GrFragmentProcessor* GrPerlinNoiseEffect::TestCreate(SkRandom* random,
GrColor paintColor;
GrFragmentProcessor* effect;
GrPaint grPaint;
- SkAssertResult(shader->asFragmentProcessor(context, paint,
- GrTest::TestMatrix(random), NULL,
+ SkAssertResult(shader->asFragmentProcessor(d->fContext, paint,
+ GrTest::TestMatrix(d->fRandom), NULL,
&paintColor, grPaint.getShaderDataManager(),
&effect));
« no previous file with comments | « src/effects/SkMorphologyImageFilter.cpp ('k') | src/effects/SkTableColorFilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698