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

Unified Diff: src/gpu/gl/GrGLFragmentProcessor.cpp

Issue 1362873002: Mangle output var in GrGLFragmentProcessor::emitChild (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 3 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/gl/GrGLFragmentProcessor.h ('k') | tests/GLProgramsTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/gl/GrGLFragmentProcessor.cpp
diff --git a/src/gpu/gl/GrGLFragmentProcessor.cpp b/src/gpu/gl/GrGLFragmentProcessor.cpp
index 6d91c72fcf683a24d756407251a465cb0853edaf..225e5bffff2701a760858b9ca07aa15d5830fe14 100644
--- a/src/gpu/gl/GrGLFragmentProcessor.cpp
+++ b/src/gpu/gl/GrGLFragmentProcessor.cpp
@@ -19,9 +19,24 @@ void GrGLFragmentProcessor::setData(const GrGLProgramDataManager& pdman,
}
}
+void GrGLFragmentProcessor::emitChild(int childIndex, const char* inputColor, EmitArgs& args) {
+ this->internalEmitChild(childIndex, inputColor, args.fOutputColor, args);
+}
+
void GrGLFragmentProcessor::emitChild(int childIndex, const char* inputColor,
- const char* outputColor, EmitArgs& args) {
+ SkString* outputColor, EmitArgs& args) {
+
+ SkASSERT(outputColor);
GrGLFragmentBuilder* fb = args.fBuilder->getFragmentShaderBuilder();
+ outputColor->append(fb->getMangleString());
+ fb->codeAppendf("vec4 %s;", outputColor->c_str());
+ this->internalEmitChild(childIndex, inputColor, outputColor->c_str(), args);
+}
+
+void GrGLFragmentProcessor::internalEmitChild(int childIndex, const char* inputColor,
+ const char* outputColor, EmitArgs& args) {
+ GrGLFragmentBuilder* fb = args.fBuilder->getFragmentShaderBuilder();
+
fb->onBeforeChildProcEmitCode(); // call first so mangleString is updated
const GrFragmentProcessor& childProc = args.fFp.childProcessor(childIndex);
« no previous file with comments | « src/gpu/gl/GrGLFragmentProcessor.h ('k') | tests/GLProgramsTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698