Index: src/effects/gradients/SkRadialGradient.cpp |
diff --git a/src/effects/gradients/SkRadialGradient.cpp b/src/effects/gradients/SkRadialGradient.cpp |
index c7e665654992cec0642634143b930877b2dbc8ba..bcedb7f2e8862faa4a2a17bfa0d9bec4339e3d8e 100644 |
--- a/src/effects/gradients/SkRadialGradient.cpp |
+++ b/src/effects/gradients/SkRadialGradient.cpp |
@@ -312,9 +312,9 @@ sk_sp<GrFragmentProcessor> GrRadialGradient::TestCreate(GrProcessorTestData* d) |
SkShader::TileMode tm; |
int colorCount = RandomGradientParams(d->fRandom, colors, &stops, &tm); |
auto shader = SkGradientShader::MakeRadial(center, radius, colors, stops, colorCount, tm); |
- sk_sp<GrFragmentProcessor> fp = shader->asFragmentProcessor(d->fContext, |
- GrTest::TestMatrix(d->fRandom), NULL, kNone_SkFilterQuality, |
- SkSourceGammaTreatment::kRespect); |
+ SkMatrix viewMatrix = GrTest::TestMatrix(d->fRandom); |
+ sk_sp<GrFragmentProcessor> fp = shader->asFragmentProcessor(SkShader::AsFPArgs( |
+ d->fContext, &viewMatrix, NULL, kNone_SkFilterQuality, SkSourceGammaTreatment::kRespect)); |
GrAlwaysAssert(fp); |
return fp; |
} |
@@ -338,27 +338,23 @@ void GrGLRadialGradient::emitCode(EmitArgs& args) { |
///////////////////////////////////////////////////////////////////// |
-sk_sp<GrFragmentProcessor> SkRadialGradient::asFragmentProcessor( |
- GrContext* context, |
- const SkMatrix& viewM, |
- const SkMatrix* localMatrix, |
- SkFilterQuality, |
- SkSourceGammaTreatment) const { |
- SkASSERT(context); |
+sk_sp<GrFragmentProcessor> SkRadialGradient::asFragmentProcessor(const AsFPArgs& args) const { |
+ SkASSERT(args.fContext); |
SkMatrix matrix; |
if (!this->getLocalMatrix().invert(&matrix)) { |
return nullptr; |
} |
- if (localMatrix) { |
+ if (args.fLocalMatrix) { |
SkMatrix inv; |
- if (!localMatrix->invert(&inv)) { |
+ if (!args.fLocalMatrix->invert(&inv)) { |
return nullptr; |
} |
matrix.postConcat(inv); |
} |
matrix.postConcat(fPtsToUnit); |
- sk_sp<GrFragmentProcessor> inner(GrRadialGradient::Make(context, *this, matrix, fTileMode)); |
+ sk_sp<GrFragmentProcessor> inner( |
+ GrRadialGradient::Make(args.fContext, *this, matrix, fTileMode)); |
return GrFragmentProcessor::MulOutputByInputAlpha(std::move(inner)); |
} |