aboutsummaryrefslogtreecommitdiffhomepage
path: root/experimental/SkPerlinNoiseShader2
diff options
context:
space:
mode:
authorGravatar Brian Osman <brianosman@google.com>2016-10-19 11:12:09 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2016-10-19 16:01:07 +0000
commit9f532a3598891a74375a4659e0dc498b704e3cf1 (patch)
treeeed5fe2329eb3a24dec22cc062bfebf8a6f3c9a1 /experimental/SkPerlinNoiseShader2
parent5e3d9c2e31b61edcfac4fd7b31e98f826d42d9f0 (diff)
Add helper to create random AsFPArgs for Ganesh unit tests
Reduces copy-paste and eases maintenance. I'll be adding another field to AsFPArgs soon, and this is going to streamline that change. BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=3639 Change-Id: I6372ed5dce50a5ba9d73039bd4714e34502a1f75 Reviewed-on: https://skia-review.googlesource.com/3639 Commit-Queue: Brian Osman <brianosman@google.com> Reviewed-by: Brian Salomon <bsalomon@google.com>
Diffstat (limited to 'experimental/SkPerlinNoiseShader2')
-rw-r--r--experimental/SkPerlinNoiseShader2/SkPerlinNoiseShader2.cpp16
1 files changed, 4 insertions, 12 deletions
diff --git a/experimental/SkPerlinNoiseShader2/SkPerlinNoiseShader2.cpp b/experimental/SkPerlinNoiseShader2/SkPerlinNoiseShader2.cpp
index 593fda1247..091a55b4c8 100644
--- a/experimental/SkPerlinNoiseShader2/SkPerlinNoiseShader2.cpp
+++ b/experimental/SkPerlinNoiseShader2/SkPerlinNoiseShader2.cpp
@@ -727,12 +727,8 @@ sk_sp<GrFragmentProcessor> GrPerlinNoise2Effect::TestCreate(GrProcessorTestData*
SkPerlinNoiseShader2::MakeTurbulence(baseFrequencyX, baseFrequencyY, numOctaves, seed,
stitchTiles ? &tileSize : nullptr));
- GrPaint grPaint;
- SkMatrix viewMatrix = GrTest::TestMatrix(d->fRandom);
- auto colorSpace = GrTest::TestColorSpace(d->fRandom);
- return shader->asFragmentProcessor(SkShader::AsFPArgs(d->fContext, &viewMatrix, nullptr,
- kNone_SkFilterQuality, colorSpace.get(),
- SkSourceGammaTreatment::kRespect));
+ GrTest::TestAsFPArgs asFPArgs(d);
+ return shader->asFragmentProcessor(asFPArgs.args());
}
void GrGLPerlinNoise2::emitCode(EmitArgs& args) {
@@ -1136,12 +1132,8 @@ sk_sp<GrFragmentProcessor> GrImprovedPerlinNoiseEffect::TestCreate(GrProcessorTe
numOctaves,
z));
- GrPaint grPaint;
- SkMatrix viewMatrix = GrTest::TestMatrix(d->fRandom);
- auto colorSpace = GrTest::TestColorSpace(d->fRandom);
- return shader->asFragmentProcessor(SkShader::AsFPArgs(d->fContext, &viewMatrix, nullptr,
- kNone_SkFilterQuality, colorSpace.get(),
- SkSourceGammaTreatment::kRespect));
+ GrTest::TestAsFPArgs asFPArgs(d);
+ return shader->asFragmentProcessor(asFPArgs.args());
}
void GrGLImprovedPerlinNoise::emitCode(EmitArgs& args) {