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

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

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/effects/GrXfermodeFragmentProcessor.cpp ('k') | src/gpu/gl/GrGLFragmentProcessor.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/gl/GrGLFragmentProcessor.h
diff --git a/src/gpu/gl/GrGLFragmentProcessor.h b/src/gpu/gl/GrGLFragmentProcessor.h
index e11d28b26ba2b1f8440742f84fd5ce6b16fcf49a..1e4dd481b3abf351213c5eb6e2bf08fafc33d055 100644
--- a/src/gpu/gl/GrGLFragmentProcessor.h
+++ b/src/gpu/gl/GrGLFragmentProcessor.h
@@ -45,7 +45,7 @@ public:
@param samplers Contains one entry for each GrTextureAccess of the GrProcessor. These
can be passed to the builder to emit texture reads in the generated
code.
- */
+ */
struct EmitArgs {
EmitArgs(GrGLFPBuilder* builder,
@@ -81,11 +81,18 @@ public:
}
/** Will emit the code of a child proc in its own scope. Pass in the parent's EmitArgs and
- * emitChild will automatically extract the coords and samplers of that child and pass them
- * on to the child's emitCode(). Also, any uniforms or functions emitted by the child will
- * have their names mangled to prevent redefinitions.
+ * emitChild will automatically extract the coords and samplers of that child and pass them
+ * on to the child's emitCode(). Also, any uniforms or functions emitted by the child will
+ * have their names mangled to prevent redefinitions. The output color name is also mangled
+ * therefore in an in/out param. It will be declared in mangled form by emitChild(). It is
+ * legal to pass nullptr as inputColor, since all fragment processors are required to work
+ * without an input color.
*/
- void emitChild(int childIndex, const char* inputColor, const char* outputColor, EmitArgs& args);
+ void emitChild(int childIndex, const char* inputColor, SkString* outputColor,
+ EmitArgs& parentArgs);
+
+ /** Variation that uses the parent's output color variable to hold the child's output.*/
+ void emitChild(int childIndex, const char* inputColor, EmitArgs& parentArgs);
protected:
/** A GrGLFragmentProcessor instance can be reused with any GrFragmentProcessor that produces
@@ -97,6 +104,8 @@ protected:
virtual void onSetData(const GrGLProgramDataManager&, const GrProcessor&) {}
private:
+ void internalEmitChild(int, const char*, const char*, EmitArgs&);
+
SkTArray<GrGLFragmentProcessor*, true> fChildProcessors;
friend class GrFragmentProcessor;
« no previous file with comments | « src/gpu/effects/GrXfermodeFragmentProcessor.cpp ('k') | src/gpu/gl/GrGLFragmentProcessor.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698