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

Unified Diff: src/effects/gradients/SkRadialGradient.cpp

Issue 2332213007: Bundle common arguments to GrGradientEffect creation (Closed)
Patch Set: Fix non-GPU compile errors Created 4 years, 3 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/gradients/SkLinearGradient.cpp ('k') | src/effects/gradients/SkSweepGradient.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/effects/gradients/SkRadialGradient.cpp
diff --git a/src/effects/gradients/SkRadialGradient.cpp b/src/effects/gradients/SkRadialGradient.cpp
index 1fbd1716abad9917f07aaffa2946159b85c65c54..5691188db7d5522fbcff40b24b52030c2707fa1e 100644
--- a/src/effects/gradients/SkRadialGradient.cpp
+++ b/src/effects/gradients/SkRadialGradient.cpp
@@ -246,11 +246,8 @@ class GrRadialGradient : public GrGradientEffect {
public:
class GLSLRadialProcessor;
- static sk_sp<GrFragmentProcessor> Make(GrContext* ctx,
- const SkRadialGradient& shader,
- const SkMatrix& matrix,
- SkShader::TileMode tm) {
- return sk_sp<GrFragmentProcessor>(new GrRadialGradient(ctx, shader, matrix, tm));
+ static sk_sp<GrFragmentProcessor> Make(const CreateArgs& args) {
+ return sk_sp<GrFragmentProcessor>(new GrRadialGradient(args));
}
virtual ~GrRadialGradient() { }
@@ -258,11 +255,8 @@ public:
const char* name() const override { return "Radial Gradient"; }
private:
- GrRadialGradient(GrContext* ctx,
- const SkRadialGradient& shader,
- const SkMatrix& matrix,
- SkShader::TileMode tm)
- : INHERITED(ctx, shader, matrix, tm) {
+ GrRadialGradient(const CreateArgs& args)
+ : INHERITED(args) {
this->initClassID<GrRadialGradient>();
}
@@ -361,8 +355,8 @@ sk_sp<GrFragmentProcessor> SkRadialGradient::asFragmentProcessor(const AsFPArgs&
matrix.postConcat(inv);
}
matrix.postConcat(fPtsToUnit);
- sk_sp<GrFragmentProcessor> inner(
- GrRadialGradient::Make(args.fContext, *this, matrix, fTileMode));
+ sk_sp<GrFragmentProcessor> inner(GrRadialGradient::Make(
+ GrGradientEffect::CreateArgs(args.fContext, this, &matrix, fTileMode)));
return GrFragmentProcessor::MulOutputByInputAlpha(std::move(inner));
}
« no previous file with comments | « src/effects/gradients/SkLinearGradient.cpp ('k') | src/effects/gradients/SkSweepGradient.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698