OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2013 Google Inc. | 2 * Copyright 2013 Google Inc. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 | 7 |
8 #ifndef GrGLFragmentProcessor_DEFINED | 8 #ifndef GrGLFragmentProcessor_DEFINED |
9 #define GrGLFragmentProcessor_DEFINED | 9 #define GrGLFragmentProcessor_DEFINED |
10 | 10 |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
73 void setData(const GrGLProgramDataManager& pdman, const GrFragmentProcessor&
processor); | 73 void setData(const GrGLProgramDataManager& pdman, const GrFragmentProcessor&
processor); |
74 | 74 |
75 static void GenKey(const GrProcessor&, const GrGLSLCaps&, GrProcessorKeyBuil
der*) {} | 75 static void GenKey(const GrProcessor&, const GrGLSLCaps&, GrProcessorKeyBuil
der*) {} |
76 | 76 |
77 int numChildProcessors() const { return fChildProcessors.count(); } | 77 int numChildProcessors() const { return fChildProcessors.count(); } |
78 | 78 |
79 GrGLFragmentProcessor* childProcessor(int index) const { | 79 GrGLFragmentProcessor* childProcessor(int index) const { |
80 return fChildProcessors[index]; | 80 return fChildProcessors[index]; |
81 } | 81 } |
82 | 82 |
83 void emitChild(int childIndex, const char* inputColor, SkString* outputColor
, EmitArgs& args); | 83 /** Will emit the code of a child proc in its own scope. Pass in the parent'
s EmitArgs and |
| 84 * emitChild will automatically extract the coords and samplers of that chil
d and pass them |
| 85 * on to the child's emitCode(). Also, any uniforms or functions emitted by
the child will |
| 86 * have their names mangled to prevent redefinitions. |
| 87 */ |
| 88 void emitChild(int childIndex, const char* inputColor, const char* outputCol
or, EmitArgs& args); |
84 | 89 |
85 protected: | 90 protected: |
86 /** A GrGLFragmentProcessor instance can be reused with any GrFragmentProces
sor that produces | 91 /** A GrGLFragmentProcessor instance can be reused with any GrFragmentProces
sor that produces |
87 the same stage key; this function reads data from a GrFragmentProcessor and
uploads any | 92 the same stage key; this function reads data from a GrFragmentProcessor and
uploads any |
88 uniform variables required by the shaders created in emitCode(). The GrFragm
entProcessor | 93 uniform variables required by the shaders created in emitCode(). The GrFragm
entProcessor |
89 parameter is guaranteed to be of the same type that created this GrGLFragmen
tProcessor and | 94 parameter is guaranteed to be of the same type that created this GrGLFragmen
tProcessor and |
90 to have an identical processor key as the one that created this GrGLFragment
Processor. */ | 95 to have an identical processor key as the one that created this GrGLFragment
Processor. */ |
91 // TODO update this to pass in GrFragmentProcessor | 96 // TODO update this to pass in GrFragmentProcessor |
92 virtual void onSetData(const GrGLProgramDataManager&, const GrProcessor&) {} | 97 virtual void onSetData(const GrGLProgramDataManager&, const GrProcessor&) {} |
93 | 98 |
94 private: | 99 private: |
95 SkTArray<GrGLFragmentProcessor*, true> fChildProcessors; | 100 SkTArray<GrGLFragmentProcessor*, true> fChildProcessors; |
96 | 101 |
97 friend class GrFragmentProcessor; | 102 friend class GrFragmentProcessor; |
98 typedef GrGLProcessor INHERITED; | 103 typedef GrGLProcessor INHERITED; |
99 }; | 104 }; |
100 | 105 |
101 #endif | 106 #endif |
OLD | NEW |