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 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
152 // Helper for setData(). Makes GL calls to specify the initial color when th
ere is not | 152 // Helper for setData(). Makes GL calls to specify the initial color when th
ere is not |
153 // per-vertex colors. | 153 // per-vertex colors. |
154 void setColor(const GrOptDrawState&, GrColor color); | 154 void setColor(const GrOptDrawState&, GrColor color); |
155 | 155 |
156 // Helper for setData(). Makes GL calls to specify the initial coverage when
there is not | 156 // Helper for setData(). Makes GL calls to specify the initial coverage when
there is not |
157 // per-vertex coverages. | 157 // per-vertex coverages. |
158 void setCoverage(const GrOptDrawState&, uint8_t coverage); | 158 void setCoverage(const GrOptDrawState&, uint8_t coverage); |
159 | 159 |
160 // A templated helper to loop over effects, set the transforms(via subclass)
and bind textures | 160 // A templated helper to loop over effects, set the transforms(via subclass)
and bind textures |
161 void setFragmentData(const GrOptDrawState&); | 161 void setFragmentData(const GrOptDrawState&); |
162 virtual void setTransformData(const GrFragmentStage& effectStage, GrGLInstal
ledFragProc* pe); | 162 virtual void setTransformData(const GrPendingFragmentStage&, GrGLInstalledFr
agProc*); |
163 void bindTextures(const GrGLInstalledProc*, const GrProcessor&); | 163 void bindTextures(const GrGLInstalledProc*, const GrProcessor&); |
164 | 164 |
165 /* | 165 /* |
166 * Legacy NVPR needs a hook here to flush path tex gen settings. | 166 * Legacy NVPR needs a hook here to flush path tex gen settings. |
167 * TODO when legacy nvpr is removed, remove this call. | 167 * TODO when legacy nvpr is removed, remove this call. |
168 */ | 168 */ |
169 virtual void didSetData(GrGpu::DrawType); | 169 virtual void didSetData(GrGpu::DrawType); |
170 | 170 |
171 // Helper for setData() that sets the view matrix and loads the render targe
t height uniform | 171 // Helper for setData() that sets the view matrix and loads the render targe
t height uniform |
172 void setMatrixAndRenderTargetHeight(GrGpu::DrawType, const GrOptDrawState&); | 172 void setMatrixAndRenderTargetHeight(GrGpu::DrawType, const GrOptDrawState&); |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
208 GrGLuint programID, | 208 GrGLuint programID, |
209 const UniformInfoArray&, | 209 const UniformInfoArray&, |
210 GrGLInstalledFragProcs* fragmentProcessors); | 210 GrGLInstalledFragProcs* fragmentProcessors); |
211 virtual void onSetMatrixAndRenderTargetHeight(GrGpu::DrawType, const GrOptDr
awState&); | 211 virtual void onSetMatrixAndRenderTargetHeight(GrGpu::DrawType, const GrOptDr
awState&); |
212 | 212 |
213 typedef GrGLProgram INHERITED; | 213 typedef GrGLProgram INHERITED; |
214 }; | 214 }; |
215 | 215 |
216 class GrGLNvprProgram : public GrGLNvprProgramBase { | 216 class GrGLNvprProgram : public GrGLNvprProgramBase { |
217 public: | 217 public: |
218 virtual bool hasVertexShader() const SK_OVERRIDE { return true; } | 218 virtual bool hasVertexShader() const SK_OVERRIDE { return true; } |
219 | 219 |
220 private: | 220 private: |
221 typedef GrGLNvprProgramBuilder::SeparableVaryingInfo SeparableVaryingInfo; | 221 typedef GrGLNvprProgramBuilder::SeparableVaryingInfo SeparableVaryingInfo; |
222 typedef GrGLNvprProgramBuilder::SeparableVaryingInfoArray SeparableVaryingIn
foArray; | 222 typedef GrGLNvprProgramBuilder::SeparableVaryingInfoArray SeparableVaryingIn
foArray; |
223 GrGLNvprProgram(GrGpuGL*, | 223 GrGLNvprProgram(GrGpuGL*, |
224 const GrProgramDesc&, | 224 const GrProgramDesc&, |
225 const BuiltinUniformHandles&, | 225 const BuiltinUniformHandles&, |
226 GrGLuint programID, | 226 GrGLuint programID, |
227 const UniformInfoArray&, | 227 const UniformInfoArray&, |
228 GrGLInstalledFragProcs* fragmentProcessors, | 228 GrGLInstalledFragProcs* fragmentProcessors, |
229 const SeparableVaryingInfoArray& separableVaryings); | 229 const SeparableVaryingInfoArray& separableVaryings); |
230 virtual void didSetData(GrGpu::DrawType) SK_OVERRIDE; | 230 virtual void didSetData(GrGpu::DrawType) SK_OVERRIDE; |
231 virtual void setTransformData(const GrFragmentStage&, GrGLInstalledFragProc*
) SK_OVERRIDE; | 231 virtual void setTransformData(const GrPendingFragmentStage&, |
| 232 GrGLInstalledFragProc*) SK_OVERRIDE; |
232 | 233 |
233 struct Varying { | 234 struct Varying { |
234 GrGLint fLocation; | 235 GrGLint fLocation; |
235 SkDEBUGCODE( | 236 SkDEBUGCODE( |
236 GrSLType fType; | 237 GrSLType fType; |
237 ); | 238 ); |
238 }; | 239 }; |
239 SkTArray<Varying, true> fVaryings; | 240 SkTArray<Varying, true> fVaryings; |
240 | 241 |
241 friend class GrGLNvprProgramBuilder; | 242 friend class GrGLNvprProgramBuilder; |
242 | 243 |
243 typedef GrGLNvprProgramBase INHERITED; | 244 typedef GrGLNvprProgramBase INHERITED; |
244 }; | 245 }; |
245 | 246 |
246 class GrGLLegacyNvprProgram : public GrGLNvprProgramBase { | 247 class GrGLLegacyNvprProgram : public GrGLNvprProgramBase { |
247 public: | 248 public: |
248 virtual bool hasVertexShader() const SK_OVERRIDE { return false; } | 249 virtual bool hasVertexShader() const SK_OVERRIDE { return false; } |
249 | 250 |
250 private: | 251 private: |
251 GrGLLegacyNvprProgram(GrGpuGL* gpu, | 252 GrGLLegacyNvprProgram(GrGpuGL* gpu, |
252 const GrProgramDesc& desc, | 253 const GrProgramDesc& desc, |
253 const BuiltinUniformHandles&, | 254 const BuiltinUniformHandles&, |
254 GrGLuint programID, | 255 GrGLuint programID, |
255 const UniformInfoArray&, | 256 const UniformInfoArray&, |
256 GrGLInstalledFragProcs* fragmentProcessors, | 257 GrGLInstalledFragProcs* fragmentProcessors, |
257 int texCoordSetCnt); | 258 int texCoordSetCnt); |
258 virtual void didSetData(GrGpu::DrawType) SK_OVERRIDE; | 259 virtual void didSetData(GrGpu::DrawType) SK_OVERRIDE; |
259 virtual void setTransformData(const GrFragmentStage&, GrGLInstalledFragProc*
) SK_OVERRIDE; | 260 virtual void setTransformData(const GrPendingFragmentStage&, |
| 261 GrGLInstalledFragProc*) SK_OVERRIDE; |
260 | 262 |
261 int fTexCoordSetCnt; | 263 int fTexCoordSetCnt; |
262 | 264 |
263 friend class GrGLLegacyNvprProgramBuilder; | 265 friend class GrGLLegacyNvprProgramBuilder; |
264 | 266 |
265 typedef GrGLNvprProgramBase INHERITED; | 267 typedef GrGLNvprProgramBase INHERITED; |
266 }; | 268 }; |
267 | 269 |
268 #endif | 270 #endif |
OLD | NEW |