OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2014 Google Inc. | 2 * Copyright 2014 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 #ifndef GrGLProgramBuilder_DEFINED | 8 #ifndef GrGLProgramBuilder_DEFINED |
9 #define GrGLProgramBuilder_DEFINED | 9 #define GrGLProgramBuilder_DEFINED |
10 | 10 |
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
140 class GrGLGPBuilder : public virtual GrGLUniformBuilder { | 140 class GrGLGPBuilder : public virtual GrGLUniformBuilder { |
141 public: | 141 public: |
142 /* | 142 /* |
143 * addVarying allows fine grained control for setting up varyings between st
ages. If you just | 143 * addVarying allows fine grained control for setting up varyings between st
ages. If you just |
144 * need to take an attribute and pass it through to an output value in a fra
gment shader, use | 144 * need to take an attribute and pass it through to an output value in a fra
gment shader, use |
145 * addPassThroughAttribute. | 145 * addPassThroughAttribute. |
146 * TODO convert most uses of addVarying to addPassThroughAttribute | 146 * TODO convert most uses of addVarying to addPassThroughAttribute |
147 */ | 147 */ |
148 virtual void addVarying(const char* name, | 148 virtual void addVarying(const char* name, |
149 GrGLVarying*, | 149 GrGLVarying*, |
150 GrSLPrecision fsPrecision = kDefault_GrSLPrecision)
= 0; | 150 GrSLPrecision precision = kDefault_GrSLPrecision) =
0; |
151 | 151 |
152 /* | 152 /* |
153 * This call can be used by GP to pass an attribute through all shaders dire
ctly to 'output' in | 153 * This call can be used by GP to pass an attribute through all shaders dire
ctly to 'output' in |
154 * the fragment shader. Though this call effects both the vertex shader and
fragment shader, | 154 * the fragment shader. Though this call effects both the vertex shader and
fragment shader, |
155 * it expects 'output' to be defined in the fragment shader before this call
is made. | 155 * it expects 'output' to be defined in the fragment shader before this call
is made. |
156 * TODO it might be nicer behavior to have a flag to declare output inside t
his call | 156 * TODO it might be nicer behavior to have a flag to declare output inside t
his call |
157 */ | 157 */ |
158 virtual void addPassThroughAttribute(const GrGeometryProcessor::Attribute*, | 158 virtual void addPassThroughAttribute(const GrGeometryProcessor::Attribute*, |
159 const char* output) = 0; | 159 const char* output) = 0; |
160 | 160 |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
251 const GrGLContextInfo& ctxInfo() const override; | 251 const GrGLContextInfo& ctxInfo() const override; |
252 | 252 |
253 GrGLGpu* gpu() const override { return fGpu; } | 253 GrGLGpu* gpu() const override { return fGpu; } |
254 | 254 |
255 GrGLXPFragmentBuilder* getFragmentShaderBuilder() override { return &fFS; } | 255 GrGLXPFragmentBuilder* getFragmentShaderBuilder() override { return &fFS; } |
256 GrGLVertexBuilder* getVertexShaderBuilder() override { return &fVS; } | 256 GrGLVertexBuilder* getVertexShaderBuilder() override { return &fVS; } |
257 | 257 |
258 void addVarying( | 258 void addVarying( |
259 const char* name, | 259 const char* name, |
260 GrGLVarying*, | 260 GrGLVarying*, |
261 GrSLPrecision fsPrecision = kDefault_GrSLPrecision) override; | 261 GrSLPrecision precision = kDefault_GrSLPrecision) override; |
262 | 262 |
263 void addPassThroughAttribute(const GrPrimitiveProcessor::Attribute*, | 263 void addPassThroughAttribute(const GrPrimitiveProcessor::Attribute*, |
264 const char* output) override; | 264 const char* output) override; |
265 | 265 |
266 SeparableVaryingHandle addSeparableVarying( | 266 SeparableVaryingHandle addSeparableVarying( |
267 const char* name, | 267 const char* name, |
268 GrGLVertToFrag*, | 268 GrGLVertToFrag*, |
269 GrSLPrecision fsPrecision = kDefault_GrSLPrecision) override; | 269 GrSLPrecision fsPrecision = kDefault_GrSLPrecision) override; |
270 | 270 |
271 // Handles for program uniforms (other than per-effect uniforms) | 271 // Handles for program uniforms (other than per-effect uniforms) |
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
399 GrGLPrimitiveProcessor::TransformsOut fOutCoords; | 399 GrGLPrimitiveProcessor::TransformsOut fOutCoords; |
400 SkTArray<UniformHandle> fSamplerUniforms; | 400 SkTArray<UniformHandle> fSamplerUniforms; |
401 SeparableVaryingInfoArray fSeparableVaryingInfos; | 401 SeparableVaryingInfoArray fSeparableVaryingInfos; |
402 | 402 |
403 friend class GrGLShaderBuilder; | 403 friend class GrGLShaderBuilder; |
404 friend class GrGLVertexBuilder; | 404 friend class GrGLVertexBuilder; |
405 friend class GrGLFragmentShaderBuilder; | 405 friend class GrGLFragmentShaderBuilder; |
406 friend class GrGLGeometryBuilder; | 406 friend class GrGLGeometryBuilder; |
407 }; | 407 }; |
408 #endif | 408 #endif |
OLD | NEW |