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

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

Issue 649783003: Force input coverage to be only a byte in gpu shaders. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 1 month 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/GrPaint.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 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
148 // Sets the texture units for samplers. 148 // Sets the texture units for samplers.
149 void initSamplerUniforms(); 149 void initSamplerUniforms();
150 void initSamplers(GrGLInstalledProc*, int* texUnitIdx); 150 void initSamplers(GrGLInstalledProc*, int* texUnitIdx);
151 151
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&, GrColor 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 GrFragmentStage& effectStage, GrGLInstal ledFragProc* pe);
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&);
173 virtual void onSetMatrixAndRenderTargetHeight(GrGpu::DrawType, const GrOptDr awState&); 173 virtual void onSetMatrixAndRenderTargetHeight(GrGpu::DrawType, const GrOptDr awState&);
174 174
175 // these reflect the current values of uniforms (GL uniform values travel wi th program) 175 // these reflect the current values of uniforms (GL uniform values travel wi th program)
176 MatrixState fMatrixState; 176 MatrixState fMatrixState;
177 GrColor fColor; 177 GrColor fColor;
178 GrColor fCoverage; 178 uint8_t fCoverage;
179 int fDstCopyTexUnit; 179 int fDstCopyTexUnit;
180 BuiltinUniformHandles fBuiltinUniformHandles; 180 BuiltinUniformHandles fBuiltinUniformHandles;
181 GrGLuint fProgramID; 181 GrGLuint fProgramID;
182 182
183 // the installed effects 183 // the installed effects
184 SkAutoTDelete<GrGLInstalledGeoProc> fGeometryProcessor; 184 SkAutoTDelete<GrGLInstalledGeoProc> fGeometryProcessor;
185 SkAutoTUnref<GrGLInstalledFragProcs> fFragmentProcessors; 185 SkAutoTUnref<GrGLInstalledFragProcs> fFragmentProcessors;
186 186
187 GrProgramDesc fDesc; 187 GrProgramDesc fDesc;
188 GrGpuGL* fGpu; 188 GrGpuGL* fGpu;
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
259 virtual void setTransformData(const GrFragmentStage&, GrGLInstalledFragProc* ) SK_OVERRIDE; 259 virtual void setTransformData(const GrFragmentStage&, 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/GrPaint.cpp ('k') | src/gpu/gl/GrGLProgram.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698