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

Unified Diff: src/gpu/glsl/GrGLSLFragmentProcessor.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/glsl/GrGLSLFragmentProcessor.h ('k') | src/gpu/glsl/GrGLSLGeometryProcessor.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/glsl/GrGLSLFragmentProcessor.cpp
diff --git a/src/gpu/glsl/GrGLSLFragmentProcessor.cpp b/src/gpu/glsl/GrGLSLFragmentProcessor.cpp
index 5868043cbc67849f67abb7b73e2bb8c930efc323..f32dd090df1428433e0a61357c9d9913cbf501e3 100644
--- a/src/gpu/glsl/GrGLSLFragmentProcessor.cpp
+++ b/src/gpu/glsl/GrGLSLFragmentProcessor.cpp
@@ -25,20 +25,20 @@ void GrGLSLFragmentProcessor::emitChild(int childIndex, const char* inputColor,
}
void GrGLSLFragmentProcessor::emitChild(int childIndex, const char* inputColor,
- SkString* outputColor, EmitArgs& args) {
+ SkString* outputColor, EmitArgs& args) {
SkASSERT(outputColor);
- GrGLSLFragmentBuilder* fb = args.fBuilder->getFragmentShaderBuilder();
- outputColor->append(fb->getMangleString());
- fb->codeAppendf("vec4 %s;", outputColor->c_str());
+ GrGLSLFragmentBuilder* fragBuilder = args.fFragBuilder;
+ outputColor->append(fragBuilder->getMangleString());
+ fragBuilder->codeAppendf("vec4 %s;", outputColor->c_str());
this->internalEmitChild(childIndex, inputColor, outputColor->c_str(), args);
}
void GrGLSLFragmentProcessor::internalEmitChild(int childIndex, const char* inputColor,
const char* outputColor, EmitArgs& args) {
- GrGLSLFragmentBuilder* fb = args.fBuilder->getFragmentShaderBuilder();
+ GrGLSLFragmentBuilder* fragBuilder = args.fFragBuilder;
- fb->onBeforeChildProcEmitCode(); // call first so mangleString is updated
+ fragBuilder->onBeforeChildProcEmitCode(); // call first so mangleString is updated
const GrFragmentProcessor& childProc = args.fFp.childProcessor(childIndex);
@@ -90,17 +90,18 @@ void GrGLSLFragmentProcessor::internalEmitChild(int childIndex, const char* inpu
}
// emit the code for the child in its own scope
- fb->codeAppend("{\n");
- fb->codeAppendf("// Child Index %d (mangle: %s): %s\n", childIndex,
- fb->getMangleString().c_str(), childProc.name());
+ fragBuilder->codeAppend("{\n");
+ fragBuilder->codeAppendf("// Child Index %d (mangle: %s): %s\n", childIndex,
+ fragBuilder->getMangleString().c_str(), childProc.name());
EmitArgs childArgs(args.fBuilder,
+ fragBuilder,
childProc,
outputColor,
inputColor,
childCoords,
childSamplers);
this->childProcessor(childIndex)->emitCode(childArgs);
- fb->codeAppend("}\n");
+ fragBuilder->codeAppend("}\n");
- fb->onAfterChildProcEmitCode();
+ fragBuilder->onAfterChildProcEmitCode();
}
« no previous file with comments | « src/gpu/glsl/GrGLSLFragmentProcessor.h ('k') | src/gpu/glsl/GrGLSLGeometryProcessor.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698