OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2015 Google Inc. | 2 * Copyright 2015 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 GrGLSLProgramBuilder_DEFINED | 8 #ifndef GrGLSLProgramBuilder_DEFINED |
9 #define GrGLSLProgramBuilder_DEFINED | 9 #define GrGLSLProgramBuilder_DEFINED |
10 | 10 |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
91 GrGLSLXferProcessor* fXferProcessor; | 91 GrGLSLXferProcessor* fXferProcessor; |
92 GrGLSLFragProcs fFragmentProcessors; | 92 GrGLSLFragProcs fFragmentProcessors; |
93 | 93 |
94 protected: | 94 protected: |
95 explicit GrGLSLProgramBuilder(const DrawArgs& args); | 95 explicit GrGLSLProgramBuilder(const DrawArgs& args); |
96 | 96 |
97 bool emitAndInstallProcs(GrGLSLExpr4* inputColor, GrGLSLExpr4* inputCoverage
, int maxTextures); | 97 bool emitAndInstallProcs(GrGLSLExpr4* inputColor, GrGLSLExpr4* inputCoverage
, int maxTextures); |
98 | 98 |
99 void cleanupFragmentProcessors(); | 99 void cleanupFragmentProcessors(); |
100 | 100 |
| 101 void finalizeShaders(); |
| 102 |
101 private: | 103 private: |
102 // reset is called by program creator between each processor's emit code. I
t increments the | 104 // reset is called by program creator between each processor's emit code. I
t increments the |
103 // stage offset for variable name mangling, and also ensures verfication var
iables in the | 105 // stage offset for variable name mangling, and also ensures verfication var
iables in the |
104 // fragment shader are cleared. | 106 // fragment shader are cleared. |
105 void reset() { | 107 void reset() { |
106 this->addStage(); | 108 this->addStage(); |
107 fFS.reset(); | 109 fFS.reset(); |
108 } | 110 } |
109 void addStage() { fStageIndex++; } | 111 void addStage() { fStageIndex++; } |
110 | 112 |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
145 void verify(const GrFragmentProcessor&); | 147 void verify(const GrFragmentProcessor&); |
146 | 148 |
147 virtual void emitSamplers(const GrProcessor& processor, | 149 virtual void emitSamplers(const GrProcessor& processor, |
148 GrGLSLTextureSampler::TextureSamplerArray* outSamp
lers) = 0; | 150 GrGLSLTextureSampler::TextureSamplerArray* outSamp
lers) = 0; |
149 | 151 |
150 GrGLSLPrimitiveProcessor::TransformsIn fCoordTransforms; | 152 GrGLSLPrimitiveProcessor::TransformsIn fCoordTransforms; |
151 GrGLSLPrimitiveProcessor::TransformsOut fOutCoords; | 153 GrGLSLPrimitiveProcessor::TransformsOut fOutCoords; |
152 }; | 154 }; |
153 | 155 |
154 #endif | 156 #endif |
OLD | NEW |