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

Unified Diff: src/gpu/gl/builders/GrGLProgramBuilder.cpp

Issue 1457543003: Add ShaderBuilders to EmitArgs and remove gettings from ProgBuilder. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 1 month 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/GrYUVtoRGBEffect.cpp ('k') | src/gpu/glsl/GrGLSLFragmentProcessor.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/gl/builders/GrGLProgramBuilder.cpp
diff --git a/src/gpu/gl/builders/GrGLProgramBuilder.cpp b/src/gpu/gl/builders/GrGLProgramBuilder.cpp
index 9f28e3fac34da9abee3a298d1571aa413d7b8162..c9706f61d6a8e0d893cc75cea1c9633ba503cdb1 100644
--- a/src/gpu/gl/builders/GrGLProgramBuilder.cpp
+++ b/src/gpu/gl/builders/GrGLProgramBuilder.cpp
@@ -95,7 +95,7 @@ GrGLProgramBuilder::SeparableVaryingHandle GrGLProgramBuilder::addSeparableVaryi
fArgs.fPrimitiveProcessor->numAttribs() == 0);
this->addVarying(name, v, fsPrecision);
SeparableVaryingInfo& varyingInfo = fSeparableVaryingInfos.push_back();
- varyingInfo.fVariable = this->getFragmentShaderBuilder()->fInputs.back();
+ varyingInfo.fVariable = fFS.fInputs.back();
varyingInfo.fLocation = fSeparableVaryingInfos.count() - 1;
return SeparableVaryingHandle(varyingInfo.fLocation);
}
@@ -260,6 +260,7 @@ void GrGLProgramBuilder::emitAndInstallProc(const GrFragmentProcessor& fp,
this->emitSamplers(fp, &samplers, ifp);
GrGLSLFragmentProcessor::EmitArgs args(this,
+ &fFS,
fp,
outColor,
inColor,
@@ -284,7 +285,7 @@ void GrGLProgramBuilder::emitAndInstallProc(const GrPrimitiveProcessor& gp,
SkSTArray<4, GrGLSLTextureSampler> samplers(gp.numTextures());
this->emitSamplers(gp, &samplers, fGeometryProcessor);
- GrGLSLGeometryProcessor::EmitArgs args(this, gp, outColor, outCoverage, samplers,
+ GrGLSLGeometryProcessor::EmitArgs args(this, &fVS, &fFS, gp, outColor, outCoverage, samplers,
fCoordTransforms, &fOutCoords);
fGeometryProcessor->fGLProc->emitCode(args);
@@ -320,9 +321,9 @@ void GrGLProgramBuilder::emitAndInstallXferProc(const GrXferProcessor& xp,
SkSTArray<4, GrGLSLTextureSampler> samplers(xp.numTextures());
this->emitSamplers(xp, &samplers, fXferProcessor);
- GrGLSLXferProcessor::EmitArgs args(this, xp, colorIn.c_str(), coverageIn.c_str(),
- fFS.getPrimaryColorOutputName(),
- fFS.getSecondaryColorOutputName(), samplers);
+ GrGLSLXferProcessor::EmitArgs args(this, &fFS, xp, colorIn.c_str(), coverageIn.c_str(),
+ fFS.getPrimaryColorOutputName(),
+ fFS.getSecondaryColorOutputName(), samplers);
fXferProcessor->fGLProc->emitCode(args);
// We have to check that effects and the code they emit are consistent, ie if an effect
« no previous file with comments | « src/gpu/effects/GrYUVtoRGBEffect.cpp ('k') | src/gpu/glsl/GrGLSLFragmentProcessor.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698