| 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 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |