| 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 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 157 */ | 157 */ |
| 158 void setData(GrDrawState::BlendOptFlags, | 158 void setData(GrDrawState::BlendOptFlags, |
| 159 const GrEffectStage* colorStages[], | 159 const GrEffectStage* colorStages[], |
| 160 const GrEffectStage* coverageStages[], | 160 const GrEffectStage* coverageStages[], |
| 161 const GrDeviceCoordTexture* dstCopy, // can be NULL | 161 const GrDeviceCoordTexture* dstCopy, // can be NULL |
| 162 SharedGLState*); | 162 SharedGLState*); |
| 163 | 163 |
| 164 private: | 164 private: |
| 165 typedef GrGLUniformManager::UniformHandle UniformHandle; | 165 typedef GrGLUniformManager::UniformHandle UniformHandle; |
| 166 | 166 |
| 167 // handles for uniforms (aside from per-effect samplers) | |
| 168 struct UniformHandles { | |
| 169 UniformHandle fViewMatrixUni; | |
| 170 UniformHandle fRTAdjustmentUni; | |
| 171 UniformHandle fColorUni; | |
| 172 UniformHandle fCoverageUni; | |
| 173 | |
| 174 // We use the render target height to provide a y-down frag coord when s
pecifying | |
| 175 // origin_upper_left is not supported. | |
| 176 UniformHandle fRTHeightUni; | |
| 177 | |
| 178 // Uniforms for computing texture coords to do the dst-copy lookup | |
| 179 UniformHandle fDstCopyTopLeftUni; | |
| 180 UniformHandle fDstCopyScaleUni; | |
| 181 UniformHandle fDstCopySamplerUni; | |
| 182 }; | |
| 183 | |
| 184 GrGLProgram(GrGpuGL* gpu, | 167 GrGLProgram(GrGpuGL* gpu, |
| 185 const GrGLProgramDesc& desc, | 168 const GrGLProgramDesc& desc, |
| 186 const GrEffectStage* colorStages[], | 169 const GrEffectStage* colorStages[], |
| 187 const GrEffectStage* coverageStages[]); | 170 const GrEffectStage* coverageStages[]); |
| 188 | 171 |
| 189 bool succeeded() const { return 0 != fProgramID; } | 172 bool succeeded() const { return 0 != fProgramID; } |
| 190 | 173 |
| 191 /** | 174 /** |
| 192 * This is the heavy initialization routine for building a GLProgram. colorS
tages and | 175 * This is the heavy initialization routine for building a GLProgram. colorS
tages and |
| 193 * coverageStages correspond to the output of GrGLProgramDesc::Build(). | 176 * coverageStages correspond to the output of GrGLProgramDesc::Build(). |
| (...skipping 25 matching lines...) Expand all Loading... |
| 219 GrColor fCoverage; | 202 GrColor fCoverage; |
| 220 int fDstCopyTexUnit; | 203 int fDstCopyTexUnit; |
| 221 | 204 |
| 222 SkAutoTDelete<GrGLProgramEffects> fColorEffects; | 205 SkAutoTDelete<GrGLProgramEffects> fColorEffects; |
| 223 SkAutoTDelete<GrGLProgramEffects> fCoverageEffects; | 206 SkAutoTDelete<GrGLProgramEffects> fCoverageEffects; |
| 224 | 207 |
| 225 GrGLProgramDesc fDesc; | 208 GrGLProgramDesc fDesc; |
| 226 GrGpuGL* fGpu; | 209 GrGpuGL* fGpu; |
| 227 | 210 |
| 228 GrGLUniformManager fUniformManager; | 211 GrGLUniformManager fUniformManager; |
| 229 UniformHandles fUniformHandles; | 212 GrGLShaderBuilder::UniformHandles fUniformHandles; |
| 230 | 213 |
| 231 bool fHasVertexShader; | 214 bool fHasVertexShader; |
| 232 int fNumTexCoordSets; | 215 int fNumTexCoordSets; |
| 233 | 216 |
| 234 typedef SkRefCnt INHERITED; | 217 typedef SkRefCnt INHERITED; |
| 235 }; | 218 }; |
| 236 | 219 |
| 237 #endif | 220 #endif |
| OLD | NEW |