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

Unified Diff: src/gpu/effects/GrYUVtoRGBEffect.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/GrTextureDomain.cpp ('k') | src/gpu/gl/GrGLFragmentProcessor.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/effects/GrYUVtoRGBEffect.cpp
diff --git a/src/gpu/effects/GrYUVtoRGBEffect.cpp b/src/gpu/effects/GrYUVtoRGBEffect.cpp
index 7e62868c95ea0d707191831c4a8f53eafa06b92b..3bfc2164743051979b328028cf35318315b13ea8 100644
--- a/src/gpu/effects/GrYUVtoRGBEffect.cpp
+++ b/src/gpu/effects/GrYUVtoRGBEffect.cpp
@@ -61,24 +61,22 @@ public:
GLProcessor(const GrProcessor&) {}
- virtual void emitCode(GrGLFPBuilder* builder,
- const GrFragmentProcessor&,
- const char* outputColor,
- const char* inputColor,
- const TransformedCoordsArray& coords,
- const TextureSamplerArray& samplers) override {
- GrGLFragmentBuilder* fsBuilder = builder->getFragmentShaderBuilder();
+ virtual void emitCode(EmitArgs& args) override {
+ GrGLFragmentBuilder* fsBuilder = args.fBuilder->getFragmentShaderBuilder();
const char* yuvMatrix = NULL;
- fMatrixUni = builder->addUniform(GrGLProgramBuilder::kFragment_Visibility,
+ fMatrixUni = args.fBuilder->addUniform(GrGLProgramBuilder::kFragment_Visibility,
kMat44f_GrSLType, kDefault_GrSLPrecision,
"YUVMatrix", &yuvMatrix);
- fsBuilder->codeAppendf("\t%s = vec4(\n\t\t", outputColor);
- fsBuilder->appendTextureLookup(samplers[0], coords[0].c_str(), coords[0].getType());
+ fsBuilder->codeAppendf("\t%s = vec4(\n\t\t", args.fOutputColor);
+ fsBuilder->appendTextureLookup(args.fSamplers[0], args.fCoords[0].c_str(),
+ args.fCoords[0].getType());
fsBuilder->codeAppend(".r,\n\t\t");
- fsBuilder->appendTextureLookup(samplers[1], coords[1].c_str(), coords[1].getType());
+ fsBuilder->appendTextureLookup(args.fSamplers[1], args.fCoords[1].c_str(),
+ args.fCoords[1].getType());
fsBuilder->codeAppend(".r,\n\t\t");
- fsBuilder->appendTextureLookup(samplers[2], coords[2].c_str(), coords[2].getType());
+ fsBuilder->appendTextureLookup(args.fSamplers[2], args.fCoords[2].c_str(),
+ args.fCoords[2].getType());
fsBuilder->codeAppendf(".r,\n\t\t1.0) * %s;\n", yuvMatrix);
}
« no previous file with comments | « src/gpu/effects/GrTextureDomain.cpp ('k') | src/gpu/gl/GrGLFragmentProcessor.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698