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

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

Issue 1251173002: Added GrGLFragmentProcessor::EmitArgs struct for use with emitCode() (Closed) Base URL: https://skia.googlesource.com/skia@composeshader_gpu
Patch Set: 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/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 d9f24c07fb97e206ff1826674ff8730174b8ffc3..1976382bf209820afca6bc963dd7692f5bbe4732 100644
--- a/src/effects/gradients/SkRadialGradient.cpp
+++ b/src/effects/gradients/SkRadialGradient.cpp
@@ -440,12 +440,7 @@ public:
GrGLRadialGradient(const GrProcessor&) {}
virtual ~GrGLRadialGradient() { }
- virtual void emitCode(GrGLFPBuilder*,
- const GrFragmentProcessor&,
- const char* outputColor,
- const char* inputColor,
- const TransformedCoordsArray&,
- const TextureSamplerArray&) override;
+ virtual void emitCode(EmitArgs&) override;
static void GenKey(const GrProcessor& processor, const GrGLSLCaps&, GrProcessorKeyBuilder* b) {
b->add32(GenBaseGradientKey(processor));
@@ -524,18 +519,14 @@ GrFragmentProcessor* GrRadialGradient::TestCreate(GrProcessorTestData* d) {
/////////////////////////////////////////////////////////////////////
-void GrGLRadialGradient::emitCode(GrGLFPBuilder* builder,
- const GrFragmentProcessor& fp,
- const char* outputColor,
- const char* inputColor,
- const TransformedCoordsArray& coords,
- const TextureSamplerArray& samplers) {
- const GrRadialGradient& ge = fp.cast<GrRadialGradient>();
- this->emitUniforms(builder, ge);
+void GrGLRadialGradient::emitCode(EmitArgs& args) {
+ const GrRadialGradient& ge = args.fFp.cast<GrRadialGradient>();
+ this->emitUniforms(args.fBuilder, ge);
SkString t("length(");
- t.append(builder->getFragmentShaderBuilder()->ensureFSCoords2D(coords, 0));
+ t.append(args.fBuilder->getFragmentShaderBuilder()->ensureFSCoords2D(args.fCoords, 0));
t.append(")");
- this->emitColor(builder, ge, t.c_str(), outputColor, inputColor, samplers);
+ this->emitColor(args.fBuilder, ge, t.c_str(), args.fOutputColor, args.fInputColor,
+ args.fSamplers);
}
/////////////////////////////////////////////////////////////////////
« 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