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

Unified Diff: src/gpu/effects/GrConstColorProcessor.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/gpu/effects/GrConfigConversionEffect.cpp ('k') | src/gpu/effects/GrConvexPolyEffect.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/effects/GrConstColorProcessor.cpp
diff --git a/src/gpu/effects/GrConstColorProcessor.cpp b/src/gpu/effects/GrConstColorProcessor.cpp
index bc09156a711027b30d0ce3d84c4321822df95647..e98a1ff33e8be4533e6ecb98b214fd9b4e218d54 100644
--- a/src/gpu/effects/GrConstColorProcessor.cpp
+++ b/src/gpu/effects/GrConstColorProcessor.cpp
@@ -13,26 +13,23 @@ class GLConstColorProcessor : public GrGLFragmentProcessor {
public:
GLConstColorProcessor() : fPrevColor(GrColor_ILLEGAL) {}
- void emitCode(GrGLFPBuilder* builder,
- const GrFragmentProcessor& fp,
- const char* outputColor,
- const char* inputColor,
- const TransformedCoordsArray& coords,
- const TextureSamplerArray& samplers) override {
- GrGLFragmentBuilder* fsBuilder = builder->getFragmentShaderBuilder();
+ void emitCode(EmitArgs& args) override {
+ GrGLFragmentBuilder* fsBuilder = args.fBuilder->getFragmentShaderBuilder();
const char* colorUni;
- fColorUniform = builder->addUniform(GrGLProgramBuilder::kFragment_Visibility,
+ fColorUniform = args.fBuilder->addUniform(GrGLProgramBuilder::kFragment_Visibility,
kVec4f_GrSLType, kMedium_GrSLPrecision, "constantColor",
&colorUni);
- switch (fp.cast<GrConstColorProcessor>().inputMode()) {
+ switch (args.fFp.cast<GrConstColorProcessor>().inputMode()) {
case GrConstColorProcessor::kIgnore_InputMode:
- fsBuilder->codeAppendf("%s = %s;", outputColor, colorUni);
+ fsBuilder->codeAppendf("%s = %s;", args.fOutputColor, colorUni);
break;
case GrConstColorProcessor::kModulateRGBA_InputMode:
- fsBuilder->codeAppendf("%s = %s * %s;", outputColor, inputColor, colorUni);
+ fsBuilder->codeAppendf("%s = %s * %s;", args.fOutputColor, args.fInputColor,
+ colorUni);
break;
case GrConstColorProcessor::kModulateA_InputMode:
- fsBuilder->codeAppendf("%s = %s.a * %s;", outputColor, inputColor, colorUni);
+ fsBuilder->codeAppendf("%s = %s.a * %s;", args.fOutputColor, args.fInputColor,
+ colorUni);
break;
}
}
« no previous file with comments | « src/gpu/effects/GrConfigConversionEffect.cpp ('k') | src/gpu/effects/GrConvexPolyEffect.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698