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

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

Issue 808593003: Rename GrGpuGL to GrGLGpu for consistency (Closed) Base URL: https://skia.googlesource.com/skia.git@master
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/GrGLPathRendering.cpp ('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 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
119 } else { 119 } else {
120 destVec[2] = 2.f / fRenderTargetSize.fHeight; 120 destVec[2] = 2.f / fRenderTargetSize.fHeight;
121 destVec[3] = -1.f; 121 destVec[3] = -1.f;
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 * GrGLGpu 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&);
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(GrGLGpu*,
139 const GrProgramDesc&, 139 const GrProgramDesc&,
140 const BuiltinUniformHandles&, 140 const BuiltinUniformHandles&,
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();
(...skipping 21 matching lines...) Expand all
170 int fDstCopyTexUnit; 170 int fDstCopyTexUnit;
171 BuiltinUniformHandles fBuiltinUniformHandles; 171 BuiltinUniformHandles fBuiltinUniformHandles;
172 GrGLuint fProgramID; 172 GrGLuint fProgramID;
173 173
174 // the installed effects 174 // the installed effects
175 SkAutoTDelete<GrGLInstalledGeoProc> fGeometryProcessor; 175 SkAutoTDelete<GrGLInstalledGeoProc> fGeometryProcessor;
176 SkAutoTDelete<GrGLInstalledXferProc> fXferProcessor; 176 SkAutoTDelete<GrGLInstalledXferProc> fXferProcessor;
177 SkAutoTUnref<GrGLInstalledFragProcs> fFragmentProcessors; 177 SkAutoTUnref<GrGLInstalledFragProcs> fFragmentProcessors;
178 178
179 GrProgramDesc fDesc; 179 GrProgramDesc fDesc;
180 GrGpuGL* fGpu; 180 GrGLGpu* fGpu;
181 GrGLProgramDataManager fProgramDataManager; 181 GrGLProgramDataManager fProgramDataManager;
182 182
183 friend class GrGLProgramBuilder; 183 friend class GrGLProgramBuilder;
184 184
185 typedef SkRefCnt INHERITED; 185 typedef SkRefCnt INHERITED;
186 }; 186 };
187 187
188 /* 188 /*
189 * Below are slight specializations of the program object for the different type s of programs 189 * Below are slight specializations of the program object for the different type s of programs
190 * The default GrGL programs consist of at the very least a vertex and fragment shader. 190 * The default GrGL programs consist of at the very least a vertex and fragment shader.
191 * Legacy Nvpr only has a fragment shader, 1.3+ Nvpr ignores the vertex shader, but both require 191 * Legacy Nvpr only has a fragment shader, 1.3+ Nvpr ignores the vertex shader, but both require
192 * 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
193 * projection matrix through a special function call 193 * projection matrix through a special function call
194 */ 194 */
195 class GrGLNvprProgramBase : public GrGLProgram { 195 class GrGLNvprProgramBase : public GrGLProgram {
196 protected: 196 protected:
197 GrGLNvprProgramBase(GrGpuGL*, 197 GrGLNvprProgramBase(GrGLGpu*,
198 const GrProgramDesc&, 198 const GrProgramDesc&,
199 const BuiltinUniformHandles&, 199 const BuiltinUniformHandles&,
200 GrGLuint programID, 200 GrGLuint programID,
201 const UniformInfoArray&, 201 const UniformInfoArray&,
202 GrGLInstalledGeoProc*, 202 GrGLInstalledGeoProc*,
203 GrGLInstalledXferProc* xferProcessor, 203 GrGLInstalledXferProc* xferProcessor,
204 GrGLInstalledFragProcs* fragmentProcessors); 204 GrGLInstalledFragProcs* fragmentProcessors);
205 virtual void onSetMatrixAndRenderTargetHeight(const GrOptDrawState&); 205 virtual void onSetMatrixAndRenderTargetHeight(const GrOptDrawState&);
206 206
207 typedef GrGLProgram INHERITED; 207 typedef GrGLProgram INHERITED;
208 }; 208 };
209 209
210 class GrGLNvprProgram : public GrGLNvprProgramBase { 210 class GrGLNvprProgram : public GrGLNvprProgramBase {
211 public: 211 public:
212 virtual bool hasVertexShader() const SK_OVERRIDE { return true; } 212 virtual bool hasVertexShader() const SK_OVERRIDE { return true; }
213 213
214 private: 214 private:
215 typedef GrGLNvprProgramBuilder::SeparableVaryingInfo SeparableVaryingInfo; 215 typedef GrGLNvprProgramBuilder::SeparableVaryingInfo SeparableVaryingInfo;
216 typedef GrGLNvprProgramBuilder::SeparableVaryingInfoArray SeparableVaryingIn foArray; 216 typedef GrGLNvprProgramBuilder::SeparableVaryingInfoArray SeparableVaryingIn foArray;
217 GrGLNvprProgram(GrGpuGL*, 217 GrGLNvprProgram(GrGLGpu*,
218 const GrProgramDesc&, 218 const GrProgramDesc&,
219 const BuiltinUniformHandles&, 219 const BuiltinUniformHandles&,
220 GrGLuint programID, 220 GrGLuint programID,
221 const UniformInfoArray&, 221 const UniformInfoArray&,
222 GrGLInstalledGeoProc*, 222 GrGLInstalledGeoProc*,
223 GrGLInstalledXferProc* xferProcessor, 223 GrGLInstalledXferProc* xferProcessor,
224 GrGLInstalledFragProcs* fragmentProcessors, 224 GrGLInstalledFragProcs* fragmentProcessors,
225 const SeparableVaryingInfoArray& separableVaryings); 225 const SeparableVaryingInfoArray& separableVaryings);
226 virtual void didSetData(GrGpu::DrawType) SK_OVERRIDE; 226 virtual void didSetData(GrGpu::DrawType) SK_OVERRIDE;
227 virtual void setTransformData(const GrPendingFragmentStage&, 227 virtual void setTransformData(const GrPendingFragmentStage&,
(...skipping 10 matching lines...) Expand all
238 friend class GrGLNvprProgramBuilder; 238 friend class GrGLNvprProgramBuilder;
239 239
240 typedef GrGLNvprProgramBase INHERITED; 240 typedef GrGLNvprProgramBase INHERITED;
241 }; 241 };
242 242
243 class GrGLLegacyNvprProgram : public GrGLNvprProgramBase { 243 class GrGLLegacyNvprProgram : public GrGLNvprProgramBase {
244 public: 244 public:
245 virtual bool hasVertexShader() const SK_OVERRIDE { return false; } 245 virtual bool hasVertexShader() const SK_OVERRIDE { return false; }
246 246
247 private: 247 private:
248 GrGLLegacyNvprProgram(GrGpuGL* gpu, 248 GrGLLegacyNvprProgram(GrGLGpu* gpu,
249 const GrProgramDesc& desc, 249 const GrProgramDesc& desc,
250 const BuiltinUniformHandles&, 250 const BuiltinUniformHandles&,
251 GrGLuint programID, 251 GrGLuint programID,
252 const UniformInfoArray&, 252 const UniformInfoArray&,
253 GrGLInstalledGeoProc*, 253 GrGLInstalledGeoProc*,
254 GrGLInstalledXferProc* xp, 254 GrGLInstalledXferProc* xp,
255 GrGLInstalledFragProcs* fps, 255 GrGLInstalledFragProcs* fps,
256 int texCoordSetCnt); 256 int texCoordSetCnt);
257 virtual void didSetData(GrGpu::DrawType) SK_OVERRIDE; 257 virtual void didSetData(GrGpu::DrawType) SK_OVERRIDE;
258 virtual void setTransformData(const GrPendingFragmentStage&, 258 virtual void setTransformData(const GrPendingFragmentStage&,
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
OLDNEW
« no previous file with comments | « src/gpu/gl/GrGLPathRendering.cpp ('k') | src/gpu/gl/GrGLProgram.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698