| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2011 Google Inc. | 2 * Copyright 2011 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 | 8 |
| 9 #ifndef GrGLProgram_DEFINED | 9 #ifndef GrGLProgram_DEFINED |
| 10 #define GrGLProgram_DEFINED | 10 #define GrGLProgram_DEFINED |
| (...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 118 const GrGLProgramDesc& desc, | 118 const GrGLProgramDesc& desc, |
| 119 const GrEffectStage* stages[]); | 119 const GrEffectStage* stages[]); |
| 120 | 120 |
| 121 bool succeeded() const { return 0 != fProgramID; } | 121 bool succeeded() const { return 0 != fProgramID; } |
| 122 | 122 |
| 123 /** | 123 /** |
| 124 * This is the heavy initialization routine for building a GLProgram. | 124 * This is the heavy initialization routine for building a GLProgram. |
| 125 */ | 125 */ |
| 126 bool genProgram(const GrEffectStage* stages[]); | 126 bool genProgram(const GrEffectStage* stages[]); |
| 127 | 127 |
| 128 void genInputColor(GrGLShaderBuilder* builder, SkString* inColor); | 128 GrSLConstantVec genInputColor(GrGLShaderBuilder* builder, SkString* inColor)
; |
| 129 |
| 130 GrSLConstantVec genInputCoverage(GrGLShaderBuilder* builder, SkString* inCov
erage); |
| 129 | 131 |
| 130 void genGeometryShader(GrGLShaderBuilder* segments) const; | 132 void genGeometryShader(GrGLShaderBuilder* segments) const; |
| 131 | 133 |
| 132 typedef GrGLUniformManager::UniformHandle UniformHandle; | 134 typedef GrGLUniformManager::UniformHandle UniformHandle; |
| 133 | 135 |
| 134 void genUniformCoverage(GrGLShaderBuilder* segments, SkString* inOutCoverage
); | |
| 135 | |
| 136 // Creates a GL program ID, binds shader attributes to GL vertex attrs, and
links the program | 136 // Creates a GL program ID, binds shader attributes to GL vertex attrs, and
links the program |
| 137 bool bindOutputsAttribsAndLinkProgram(const GrGLShaderBuilder& builder, | 137 bool bindOutputsAttribsAndLinkProgram(const GrGLShaderBuilder& builder, |
| 138 bool bindColorOut, | 138 bool bindColorOut, |
| 139 bool bindDualSrcOut); | 139 bool bindDualSrcOut); |
| 140 | 140 |
| 141 // Sets the texture units for samplers | 141 // Sets the texture units for samplers |
| 142 void initSamplerUniforms(); | 142 void initSamplerUniforms(); |
| 143 | 143 |
| 144 bool compileShaders(const GrGLShaderBuilder& builder); | 144 bool compileShaders(const GrGLShaderBuilder& builder); |
| 145 | 145 |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 205 GrGLProgramDesc fDesc; | 205 GrGLProgramDesc fDesc; |
| 206 const GrGLContext& fContext; | 206 const GrGLContext& fContext; |
| 207 | 207 |
| 208 GrGLUniformManager fUniformManager; | 208 GrGLUniformManager fUniformManager; |
| 209 UniformHandles fUniformHandles; | 209 UniformHandles fUniformHandles; |
| 210 | 210 |
| 211 typedef GrRefCnt INHERITED; | 211 typedef GrRefCnt INHERITED; |
| 212 }; | 212 }; |
| 213 | 213 |
| 214 #endif | 214 #endif |
| OLD | NEW |