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 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
122 } | 122 } |
123 } | 123 } |
124 }; | 124 }; |
125 | 125 |
126 /** | 126 /** |
127 * This function uploads uniforms and calls each GrGLProcessor's setData. It
is called before a | 127 * This function uploads uniforms and calls each GrGLProcessor's setData. It
is called before a |
128 * draw occurs using the program after the program has already been bound. I
t also uses the | 128 * draw occurs using the program after the program has already been bound. I
t also uses the |
129 * GrGpuGL object to bind the textures required by the GrGLProcessors. The c
olor and coverage | 129 * GrGpuGL object to bind the textures required by the GrGLProcessors. The c
olor and coverage |
130 * stages come from GrGLProgramDesc::Build(). | 130 * stages come from GrGLProgramDesc::Build(). |
131 */ | 131 */ |
132 void setData(const GrOptDrawState&); | 132 void setData(const GrOptDrawState&, GrGpu::DrawType); |
133 | 133 |
134 protected: | 134 protected: |
135 typedef GrGLProgramDataManager::UniformHandle UniformHandle; | 135 typedef GrGLProgramDataManager::UniformHandle UniformHandle; |
136 typedef GrGLProgramDataManager::UniformInfoArray UniformInfoArray; | 136 typedef GrGLProgramDataManager::UniformInfoArray UniformInfoArray; |
137 | 137 |
138 GrGLProgram(GrGpuGL*, | 138 GrGLProgram(GrGpuGL*, |
139 const GrProgramDesc&, | 139 const GrProgramDesc&, |
140 const BuiltinUniformHandles&, | 140 const BuiltinUniformHandles&, |
141 GrGLuint programID, | 141 GrGLuint programID, |
142 const UniformInfoArray&, | 142 const UniformInfoArray&, |
(...skipping 17 matching lines...) Expand all Loading... |
160 virtual void setTransformData(const GrPendingFragmentStage&, GrGLInstalledFr
agProc*); | 160 virtual void setTransformData(const GrPendingFragmentStage&, GrGLInstalledFr
agProc*); |
161 void bindTextures(const GrGLInstalledProc*, const GrProcessor&); | 161 void bindTextures(const GrGLInstalledProc*, const GrProcessor&); |
162 | 162 |
163 /* | 163 /* |
164 * Legacy NVPR needs a hook here to flush path tex gen settings. | 164 * Legacy NVPR needs a hook here to flush path tex gen settings. |
165 * TODO when legacy nvpr is removed, remove this call. | 165 * TODO when legacy nvpr is removed, remove this call. |
166 */ | 166 */ |
167 virtual void didSetData(GrGpu::DrawType); | 167 virtual void didSetData(GrGpu::DrawType); |
168 | 168 |
169 // Helper for setData() that sets the view matrix and loads the render targe
t height uniform | 169 // Helper for setData() that sets the view matrix and loads the render targe
t height uniform |
170 void setMatrixAndRenderTargetHeight(const GrOptDrawState&); | 170 void setMatrixAndRenderTargetHeight(GrGpu::DrawType, const GrOptDrawState&); |
171 virtual void onSetMatrixAndRenderTargetHeight(const GrOptDrawState&); | 171 virtual void onSetMatrixAndRenderTargetHeight(GrGpu::DrawType, const GrOptDr
awState&); |
172 | 172 |
173 // these reflect the current values of uniforms (GL uniform values travel wi
th program) | 173 // these reflect the current values of uniforms (GL uniform values travel wi
th program) |
174 MatrixState fMatrixState; | 174 MatrixState fMatrixState; |
175 GrColor fColor; | 175 GrColor fColor; |
176 uint8_t fCoverage; | 176 uint8_t fCoverage; |
177 int fDstCopyTexUnit; | 177 int fDstCopyTexUnit; |
178 BuiltinUniformHandles fBuiltinUniformHandles; | 178 BuiltinUniformHandles fBuiltinUniformHandles; |
179 GrGLuint fProgramID; | 179 GrGLuint fProgramID; |
180 | 180 |
181 // the installed effects | 181 // the installed effects |
(...skipping 17 matching lines...) Expand all Loading... |
199 * projection matrix through a special function call | 199 * projection matrix through a special function call |
200 */ | 200 */ |
201 class GrGLNvprProgramBase : public GrGLProgram { | 201 class GrGLNvprProgramBase : public GrGLProgram { |
202 protected: | 202 protected: |
203 GrGLNvprProgramBase(GrGpuGL*, | 203 GrGLNvprProgramBase(GrGpuGL*, |
204 const GrProgramDesc&, | 204 const GrProgramDesc&, |
205 const BuiltinUniformHandles&, | 205 const BuiltinUniformHandles&, |
206 GrGLuint programID, | 206 GrGLuint programID, |
207 const UniformInfoArray&, | 207 const UniformInfoArray&, |
208 GrGLInstalledFragProcs* fragmentProcessors); | 208 GrGLInstalledFragProcs* fragmentProcessors); |
209 virtual void onSetMatrixAndRenderTargetHeight(const GrOptDrawState&); | 209 virtual void onSetMatrixAndRenderTargetHeight(GrGpu::DrawType, const GrOptDr
awState&); |
210 | 210 |
211 typedef GrGLProgram INHERITED; | 211 typedef GrGLProgram INHERITED; |
212 }; | 212 }; |
213 | 213 |
214 class GrGLNvprProgram : public GrGLNvprProgramBase { | 214 class GrGLNvprProgram : public GrGLNvprProgramBase { |
215 public: | 215 public: |
216 virtual bool hasVertexShader() const SK_OVERRIDE { return true; } | 216 virtual bool hasVertexShader() const SK_OVERRIDE { return true; } |
217 | 217 |
218 private: | 218 private: |
219 typedef GrGLNvprProgramBuilder::SeparableVaryingInfo SeparableVaryingInfo; | 219 typedef GrGLNvprProgramBuilder::SeparableVaryingInfo SeparableVaryingInfo; |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
259 GrGLInstalledFragProc*) SK_OVERRIDE; | 259 GrGLInstalledFragProc*) SK_OVERRIDE; |
260 | 260 |
261 int fTexCoordSetCnt; | 261 int fTexCoordSetCnt; |
262 | 262 |
263 friend class GrGLLegacyNvprProgramBuilder; | 263 friend class GrGLLegacyNvprProgramBuilder; |
264 | 264 |
265 typedef GrGLNvprProgramBase INHERITED; | 265 typedef GrGLNvprProgramBase INHERITED; |
266 }; | 266 }; |
267 | 267 |
268 #endif | 268 #endif |
OLD | NEW |