Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(208)

Side by Side Diff: src/gpu/gl/GrGLProgram.h

Issue 746423007: Draft change to start pulling uniform color into GP (Closed) Base URL: https://skia.googlesource.com/skia.git@no_factories
Patch Set: rebase Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/gpu/gl/GrGLGeometryProcessor.h ('k') | src/gpu/gl/GrGLProgram.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
141 GrGLuint programID, 141 GrGLuint programID,
142 const UniformInfoArray&, 142 const UniformInfoArray&,
143 GrGLInstalledGeoProc* geometryProcessor, 143 GrGLInstalledGeoProc* geometryProcessor,
144 GrGLInstalledXferProc* xferProcessor, 144 GrGLInstalledXferProc* xferProcessor,
145 GrGLInstalledFragProcs* fragmentProcessors); 145 GrGLInstalledFragProcs* fragmentProcessors);
146 146
147 // Sets the texture units for samplers. 147 // Sets the texture units for samplers.
148 void initSamplerUniforms(); 148 void initSamplerUniforms();
149 void initSamplers(GrGLInstalledProc*, int* texUnitIdx); 149 void initSamplers(GrGLInstalledProc*, int* texUnitIdx);
150 150
151 // Helper for setData(). Makes GL calls to specify the initial color when th ere is not
152 // per-vertex colors.
153 void setColor(const GrOptDrawState&, GrColor color);
154
155 // Helper for setData(). Makes GL calls to specify the initial coverage when there is not
156 // per-vertex coverages.
157 void setCoverage(const GrOptDrawState&, uint8_t coverage);
158
159 // A templated helper to loop over effects, set the transforms(via subclass) and bind textures 151 // A templated helper to loop over effects, set the transforms(via subclass) and bind textures
160 void setFragmentData(const GrOptDrawState&); 152 void setFragmentData(const GrOptDrawState&);
161 virtual void setTransformData(const GrPendingFragmentStage&, GrGLInstalledFr agProc*); 153 virtual void setTransformData(const GrPendingFragmentStage&, GrGLInstalledFr agProc*);
162 void bindTextures(const GrGLInstalledProc*, const GrProcessor&); 154 void bindTextures(const GrGLInstalledProc*, const GrProcessor&);
163 155
164 /* 156 /*
165 * Legacy NVPR needs a hook here to flush path tex gen settings. 157 * Legacy NVPR needs a hook here to flush path tex gen settings.
166 * TODO when legacy nvpr is removed, remove this call. 158 * TODO when legacy nvpr is removed, remove this call.
167 */ 159 */
168 virtual void didSetData(GrGpu::DrawType); 160 virtual void didSetData(GrGpu::DrawType);
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
200 * specialized methods for setting transform data. Both types of NVPR also requi re setting the 192 * specialized methods for setting transform data. Both types of NVPR also requi re setting the
201 * projection matrix through a special function call 193 * projection matrix through a special function call
202 */ 194 */
203 class GrGLNvprProgramBase : public GrGLProgram { 195 class GrGLNvprProgramBase : public GrGLProgram {
204 protected: 196 protected:
205 GrGLNvprProgramBase(GrGpuGL*, 197 GrGLNvprProgramBase(GrGpuGL*,
206 const GrProgramDesc&, 198 const GrProgramDesc&,
207 const BuiltinUniformHandles&, 199 const BuiltinUniformHandles&,
208 GrGLuint programID, 200 GrGLuint programID,
209 const UniformInfoArray&, 201 const UniformInfoArray&,
202 GrGLInstalledGeoProc*,
210 GrGLInstalledXferProc* xferProcessor, 203 GrGLInstalledXferProc* xferProcessor,
211 GrGLInstalledFragProcs* fragmentProcessors); 204 GrGLInstalledFragProcs* fragmentProcessors);
212 virtual void onSetMatrixAndRenderTargetHeight(const GrOptDrawState&); 205 virtual void onSetMatrixAndRenderTargetHeight(const GrOptDrawState&);
213 206
214 typedef GrGLProgram INHERITED; 207 typedef GrGLProgram INHERITED;
215 }; 208 };
216 209
217 class GrGLNvprProgram : public GrGLNvprProgramBase { 210 class GrGLNvprProgram : public GrGLNvprProgramBase {
218 public: 211 public:
219 virtual bool hasVertexShader() const SK_OVERRIDE { return true; } 212 virtual bool hasVertexShader() const SK_OVERRIDE { return true; }
220 213
221 private: 214 private:
222 typedef GrGLNvprProgramBuilder::SeparableVaryingInfo SeparableVaryingInfo; 215 typedef GrGLNvprProgramBuilder::SeparableVaryingInfo SeparableVaryingInfo;
223 typedef GrGLNvprProgramBuilder::SeparableVaryingInfoArray SeparableVaryingIn foArray; 216 typedef GrGLNvprProgramBuilder::SeparableVaryingInfoArray SeparableVaryingIn foArray;
224 GrGLNvprProgram(GrGpuGL*, 217 GrGLNvprProgram(GrGpuGL*,
225 const GrProgramDesc&, 218 const GrProgramDesc&,
226 const BuiltinUniformHandles&, 219 const BuiltinUniformHandles&,
227 GrGLuint programID, 220 GrGLuint programID,
228 const UniformInfoArray&, 221 const UniformInfoArray&,
222 GrGLInstalledGeoProc*,
229 GrGLInstalledXferProc* xferProcessor, 223 GrGLInstalledXferProc* xferProcessor,
230 GrGLInstalledFragProcs* fragmentProcessors, 224 GrGLInstalledFragProcs* fragmentProcessors,
231 const SeparableVaryingInfoArray& separableVaryings); 225 const SeparableVaryingInfoArray& separableVaryings);
232 virtual void didSetData(GrGpu::DrawType) SK_OVERRIDE; 226 virtual void didSetData(GrGpu::DrawType) SK_OVERRIDE;
233 virtual void setTransformData(const GrPendingFragmentStage&, 227 virtual void setTransformData(const GrPendingFragmentStage&,
234 GrGLInstalledFragProc*) SK_OVERRIDE; 228 GrGLInstalledFragProc*) SK_OVERRIDE;
235 229
236 struct Varying { 230 struct Varying {
237 GrGLint fLocation; 231 GrGLint fLocation;
238 SkDEBUGCODE( 232 SkDEBUGCODE(
(...skipping 10 matching lines...) Expand all
249 class GrGLLegacyNvprProgram : public GrGLNvprProgramBase { 243 class GrGLLegacyNvprProgram : public GrGLNvprProgramBase {
250 public: 244 public:
251 virtual bool hasVertexShader() const SK_OVERRIDE { return false; } 245 virtual bool hasVertexShader() const SK_OVERRIDE { return false; }
252 246
253 private: 247 private:
254 GrGLLegacyNvprProgram(GrGpuGL* gpu, 248 GrGLLegacyNvprProgram(GrGpuGL* gpu,
255 const GrProgramDesc& desc, 249 const GrProgramDesc& desc,
256 const BuiltinUniformHandles&, 250 const BuiltinUniformHandles&,
257 GrGLuint programID, 251 GrGLuint programID,
258 const UniformInfoArray&, 252 const UniformInfoArray&,
253 GrGLInstalledGeoProc*,
259 GrGLInstalledXferProc* xp, 254 GrGLInstalledXferProc* xp,
260 GrGLInstalledFragProcs* fps, 255 GrGLInstalledFragProcs* fps,
261 int texCoordSetCnt); 256 int texCoordSetCnt);
262 virtual void didSetData(GrGpu::DrawType) SK_OVERRIDE; 257 virtual void didSetData(GrGpu::DrawType) SK_OVERRIDE;
263 virtual void setTransformData(const GrPendingFragmentStage&, 258 virtual void setTransformData(const GrPendingFragmentStage&,
264 GrGLInstalledFragProc*) SK_OVERRIDE; 259 GrGLInstalledFragProc*) SK_OVERRIDE;
265 260
266 int fTexCoordSetCnt; 261 int fTexCoordSetCnt;
267 262
268 friend class GrGLLegacyNvprProgramBuilder; 263 friend class GrGLLegacyNvprProgramBuilder;
269 264
270 typedef GrGLNvprProgramBase INHERITED; 265 typedef GrGLNvprProgramBase INHERITED;
271 }; 266 };
272 267
273 #endif 268 #endif
OLDNEW
« no previous file with comments | « src/gpu/gl/GrGLGeometryProcessor.h ('k') | src/gpu/gl/GrGLProgram.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698