aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/effects/gradients
diff options
context:
space:
mode:
Diffstat (limited to 'src/effects/gradients')
-rw-r--r--src/effects/gradients/SkLinearGradient.cpp7
-rw-r--r--src/effects/gradients/SkRadialGradient.cpp7
-rw-r--r--src/effects/gradients/SkSweepGradient.cpp7
-rw-r--r--src/effects/gradients/SkTwoPointConicalGradient_gpu.cpp35
4 files changed, 16 insertions, 40 deletions
diff --git a/src/effects/gradients/SkLinearGradient.cpp b/src/effects/gradients/SkLinearGradient.cpp
index a34515cfef..ea20595d3d 100644
--- a/src/effects/gradients/SkLinearGradient.cpp
+++ b/src/effects/gradients/SkLinearGradient.cpp
@@ -420,11 +420,8 @@ sk_sp<GrFragmentProcessor> GrLinearGradient::TestCreate(GrProcessorTestData* d)
params.fColorCount, params.fTileMode) :
SkGradientShader::MakeLinear(points, params.fColors, params.fStops,
params.fColorCount, params.fTileMode);
- SkMatrix viewMatrix = GrTest::TestMatrix(d->fRandom);
- auto dstColorSpace = GrTest::TestColorSpace(d->fRandom);
- sk_sp<GrFragmentProcessor> fp = shader->asFragmentProcessor(SkShader::AsFPArgs(
- d->fContext, &viewMatrix, NULL, kNone_SkFilterQuality, dstColorSpace.get(),
- SkSourceGammaTreatment::kRespect));
+ GrTest::TestAsFPArgs asFPArgs(d);
+ sk_sp<GrFragmentProcessor> fp = shader->asFragmentProcessor(asFPArgs.args());
GrAlwaysAssert(fp);
return fp;
}
diff --git a/src/effects/gradients/SkRadialGradient.cpp b/src/effects/gradients/SkRadialGradient.cpp
index 5cf524537e..8ad588013b 100644
--- a/src/effects/gradients/SkRadialGradient.cpp
+++ b/src/effects/gradients/SkRadialGradient.cpp
@@ -314,11 +314,8 @@ sk_sp<GrFragmentProcessor> GrRadialGradient::TestCreate(GrProcessorTestData* d)
params.fStops, params.fColorCount, params.fTileMode) :
SkGradientShader::MakeRadial(center, radius, params.fColors,
params.fStops, params.fColorCount, params.fTileMode);
- SkMatrix viewMatrix = GrTest::TestMatrix(d->fRandom);
- auto dstColorSpace = GrTest::TestColorSpace(d->fRandom);
- sk_sp<GrFragmentProcessor> fp = shader->asFragmentProcessor(SkShader::AsFPArgs(
- d->fContext, &viewMatrix, NULL, kNone_SkFilterQuality, dstColorSpace.get(),
- SkSourceGammaTreatment::kRespect));
+ GrTest::TestAsFPArgs asFPArgs(d);
+ sk_sp<GrFragmentProcessor> fp = shader->asFragmentProcessor(asFPArgs.args());
GrAlwaysAssert(fp);
return fp;
}
diff --git a/src/effects/gradients/SkSweepGradient.cpp b/src/effects/gradients/SkSweepGradient.cpp
index 04fc2c7436..b791f988f3 100644
--- a/src/effects/gradients/SkSweepGradient.cpp
+++ b/src/effects/gradients/SkSweepGradient.cpp
@@ -196,11 +196,8 @@ sk_sp<GrFragmentProcessor> GrSweepGradient::TestCreate(GrProcessorTestData* d) {
params.fStops, params.fColorCount) :
SkGradientShader::MakeSweep(center.fX, center.fY, params.fColors,
params.fStops, params.fColorCount);
- SkMatrix viewMatrix = GrTest::TestMatrix(d->fRandom);
- auto dstColorSpace = GrTest::TestColorSpace(d->fRandom);
- sk_sp<GrFragmentProcessor> fp = shader->asFragmentProcessor(SkShader::AsFPArgs(
- d->fContext, &viewMatrix, NULL, kNone_SkFilterQuality, dstColorSpace.get(),
- SkSourceGammaTreatment::kRespect));
+ GrTest::TestAsFPArgs asFPArgs(d);
+ sk_sp<GrFragmentProcessor> fp = shader->asFragmentProcessor(asFPArgs.args());
GrAlwaysAssert(fp);
return fp;
}
diff --git a/src/effects/gradients/SkTwoPointConicalGradient_gpu.cpp b/src/effects/gradients/SkTwoPointConicalGradient_gpu.cpp
index 8eb8b638f5..1275be7315 100644
--- a/src/effects/gradients/SkTwoPointConicalGradient_gpu.cpp
+++ b/src/effects/gradients/SkTwoPointConicalGradient_gpu.cpp
@@ -207,11 +207,8 @@ sk_sp<GrFragmentProcessor> Edge2PtConicalEffect::TestCreate(GrProcessorTestData*
SkGradientShader::MakeTwoPointConical(center1, radius1, center2, radius2,
params.fColors, params.fStops,
params.fColorCount, params.fTileMode);
- SkMatrix viewMatrix = GrTest::TestMatrix(d->fRandom);
- auto dstColorSpace = GrTest::TestColorSpace(d->fRandom);
- sk_sp<GrFragmentProcessor> fp = shader->asFragmentProcessor(SkShader::AsFPArgs(
- d->fContext, &viewMatrix, NULL, kNone_SkFilterQuality, dstColorSpace.get(),
- SkSourceGammaTreatment::kRespect));
+ GrTest::TestAsFPArgs asFPArgs(d);
+ sk_sp<GrFragmentProcessor> fp = shader->asFragmentProcessor(asFPArgs.args());
GrAlwaysAssert(fp);
return fp;
}
@@ -485,11 +482,8 @@ sk_sp<GrFragmentProcessor> FocalOutside2PtConicalEffect::TestCreate(GrProcessorT
SkGradientShader::MakeTwoPointConical(center1, radius1, center2, radius2,
params.fColors, params.fStops,
params.fColorCount, params.fTileMode);
- SkMatrix viewMatrix = GrTest::TestMatrix(d->fRandom);
- auto dstColorSpace = GrTest::TestColorSpace(d->fRandom);
- sk_sp<GrFragmentProcessor> fp = shader->asFragmentProcessor(SkShader::AsFPArgs(
- d->fContext, &viewMatrix, NULL, kNone_SkFilterQuality, dstColorSpace.get(),
- SkSourceGammaTreatment::kRespect));
+ GrTest::TestAsFPArgs asFPArgs(d);
+ sk_sp<GrFragmentProcessor> fp = shader->asFragmentProcessor(asFPArgs.args());
GrAlwaysAssert(fp);
return fp;
}
@@ -691,11 +685,8 @@ sk_sp<GrFragmentProcessor> FocalInside2PtConicalEffect::TestCreate(GrProcessorTe
SkGradientShader::MakeTwoPointConical(center1, radius1, center2, radius2,
params.fColors, params.fStops,
params.fColorCount, params.fTileMode);
- SkMatrix viewMatrix = GrTest::TestMatrix(d->fRandom);
- auto dstColorSpace = GrTest::TestColorSpace(d->fRandom);
- sk_sp<GrFragmentProcessor> fp = shader->asFragmentProcessor(SkShader::AsFPArgs(
- d->fContext, &viewMatrix, NULL, kNone_SkFilterQuality, dstColorSpace.get(),
- SkSourceGammaTreatment::kRespect));
+ GrTest::TestAsFPArgs asFPArgs(d);
+ sk_sp<GrFragmentProcessor> fp = shader->asFragmentProcessor(asFPArgs.args());
GrAlwaysAssert(fp);
return fp;
}
@@ -939,11 +930,8 @@ sk_sp<GrFragmentProcessor> CircleInside2PtConicalEffect::TestCreate(GrProcessorT
SkGradientShader::MakeTwoPointConical(center1, radius1, center2, radius2,
params.fColors, params.fStops,
params.fColorCount, params.fTileMode);
- SkMatrix viewMatrix = GrTest::TestMatrix(d->fRandom);
- auto dstColorSpace = GrTest::TestColorSpace(d->fRandom);
- sk_sp<GrFragmentProcessor> fp = shader->asFragmentProcessor(SkShader::AsFPArgs(
- d->fContext, &viewMatrix, NULL, kNone_SkFilterQuality, dstColorSpace.get(),
- SkSourceGammaTreatment::kRespect));
+ GrTest::TestAsFPArgs asFPArgs(d);
+ sk_sp<GrFragmentProcessor> fp = shader->asFragmentProcessor(asFPArgs.args());
GrAlwaysAssert(fp);
return fp;
}
@@ -1174,11 +1162,8 @@ sk_sp<GrFragmentProcessor> CircleOutside2PtConicalEffect::TestCreate(GrProcessor
SkGradientShader::MakeTwoPointConical(center1, radius1, center2, radius2,
params.fColors, params.fStops,
params.fColorCount, params.fTileMode);
- SkMatrix viewMatrix = GrTest::TestMatrix(d->fRandom);
- auto dstColorSpace = GrTest::TestColorSpace(d->fRandom);
- sk_sp<GrFragmentProcessor> fp = shader->asFragmentProcessor(SkShader::AsFPArgs(
- d->fContext, &viewMatrix, NULL, kNone_SkFilterQuality, dstColorSpace.get(),
- SkSourceGammaTreatment::kRespect));
+ GrTest::TestAsFPArgs asFPArgs(d);
+ sk_sp<GrFragmentProcessor> fp = shader->asFragmentProcessor(asFPArgs.args());
GrAlwaysAssert(fp);
return fp;
}