OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2014 Google Inc. | 2 * Copyright 2014 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 GrGLProgramBuilder_DEFINED | 8 #ifndef GrGLProgramBuilder_DEFINED |
9 #define GrGLProgramBuilder_DEFINED | 9 #define GrGLProgramBuilder_DEFINED |
10 | 10 |
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
138 return this->getUniformVariable(u).c_str(); | 138 return this->getUniformVariable(u).c_str(); |
139 } | 139 } |
140 | 140 |
141 const GrGLContextInfo& ctxInfo() const; | 141 const GrGLContextInfo& ctxInfo() const; |
142 | 142 |
143 GrGLFragmentShaderBuilder* getFragmentShaderBuilder() { return &fFS; } | 143 GrGLFragmentShaderBuilder* getFragmentShaderBuilder() { return &fFS; } |
144 GrGpuGL* gpu() const { return fGpu; } | 144 GrGpuGL* gpu() const { return fGpu; } |
145 | 145 |
146 protected: | 146 protected: |
147 typedef GrTAllocator<GrGLShaderVar> VarArray; | 147 typedef GrTAllocator<GrGLShaderVar> VarArray; |
148 GrGLProgramBuilder(GrGpuGL*, const GrGLProgramDesc&); | 148 GrGLProgramBuilder(GrGpuGL*, const GrOptDrawState&, const GrGLProgramDesc&); |
149 | 149 |
| 150 const GrOptDrawState& optState() const { return fOptState; } |
150 const GrGLProgramDesc& desc() const { return fDesc; } | 151 const GrGLProgramDesc& desc() const { return fDesc; } |
151 | 152 |
152 // Helper for emitEffects(). | 153 // Helper for emitEffects(). |
153 void createAndEmitEffects(const GrFragmentStage* effectStages[], | 154 void createAndEmitEffects(const GrFragmentStage* effectStages[], |
154 int effectCnt, | 155 int effectCnt, |
155 const GrGLProgramDesc::EffectKeyProvider&, | 156 const GrGLProgramDesc::EffectKeyProvider&, |
156 GrGLSLExpr4* inOutFSColor); | 157 GrGLSLExpr4* inOutFSColor); |
157 | 158 |
158 /* | 159 /* |
159 * A helper function called to emit the geometry processor as well as indivi
dual coverage | 160 * A helper function called to emit the geometry processor as well as indivi
dual coverage |
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
319 virtual GrGLProgramEffects* getProgramEffects() = 0; | 320 virtual GrGLProgramEffects* getProgramEffects() = 0; |
320 | 321 |
321 /** | 322 /** |
322 * Compiles all the shaders, links them into a program, and writes the progr
am id to the output | 323 * Compiles all the shaders, links them into a program, and writes the progr
am id to the output |
323 * struct. | 324 * struct. |
324 **/ | 325 **/ |
325 bool finish(); | 326 bool finish(); |
326 | 327 |
327 GrGLFragmentProcessorEmitter fGrProcessorEmitter; | 328 GrGLFragmentProcessorEmitter fGrProcessorEmitter; |
328 | 329 |
| 330 const GrOptDrawState& fOptState; |
329 const GrGLProgramDesc& fDesc; | 331 const GrGLProgramDesc& fDesc; |
330 GrGpuGL* fGpu; | 332 GrGpuGL* fGpu; |
331 UniformInfoArray fUniforms; | 333 UniformInfoArray fUniforms; |
332 | 334 |
333 friend class GrGLShaderBuilder; | 335 friend class GrGLShaderBuilder; |
334 friend class GrGLVertexShaderBuilder; | 336 friend class GrGLVertexShaderBuilder; |
335 friend class GrGLFragmentShaderBuilder; | 337 friend class GrGLFragmentShaderBuilder; |
336 friend class GrGLGeometryShaderBuilder; | 338 friend class GrGLGeometryShaderBuilder; |
337 }; | 339 }; |
338 | 340 |
339 #endif | 341 #endif |
OLD | NEW |