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

Unified Diff: src/gpu/effects/GrCustomXfermode.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/GrConvolutionEffect.cpp ('k') | src/gpu/effects/GrDitherEffect.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/effects/GrCustomXfermode.cpp
diff --git a/src/gpu/effects/GrCustomXfermode.cpp b/src/gpu/effects/GrCustomXfermode.cpp
index 350243ebc7cbb47818dd065d3f95219bfbee579e..76c285ff483b67d0d2629aaa850f4c783225f6ae 100644
--- a/src/gpu/effects/GrCustomXfermode.cpp
+++ b/src/gpu/effects/GrCustomXfermode.cpp
@@ -447,20 +447,16 @@ public:
GLCustomXferFP(const GrFragmentProcessor&) {}
~GLCustomXferFP() override {};
- void emitCode(GrGLFPBuilder* builder,
- const GrFragmentProcessor& fp,
- const char* outputColor,
- const char* inputColor,
- const TransformedCoordsArray& coords,
- const TextureSamplerArray& samplers) override {
- SkXfermode::Mode mode = fp.cast<GrCustomXferFP>().mode();
- GrGLFragmentBuilder* fsBuilder = builder->getFragmentShaderBuilder();
+ void emitCode(EmitArgs& args) override {
+ SkXfermode::Mode mode = args.fFp.cast<GrCustomXferFP>().mode();
+ GrGLFragmentBuilder* fsBuilder = args.fBuilder->getFragmentShaderBuilder();
const char* dstColor = "bgColor";
fsBuilder->codeAppendf("vec4 %s = ", dstColor);
- fsBuilder->appendTextureLookup(samplers[0], coords[0].c_str(), coords[0].getType());
+ fsBuilder->appendTextureLookup(args.fSamplers[0], args.fCoords[0].c_str(),
+ args.fCoords[0].getType());
fsBuilder->codeAppendf(";");
- emit_custom_xfermode_code(mode, fsBuilder, outputColor, inputColor, dstColor);
+ emit_custom_xfermode_code(mode, fsBuilder, args.fOutputColor, args.fInputColor, dstColor);
}
void setData(const GrGLProgramDataManager&, const GrProcessor&) override {}
« no previous file with comments | « src/gpu/effects/GrConvolutionEffect.cpp ('k') | src/gpu/effects/GrDitherEffect.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698