| 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 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 148 /* | 148 /* |
| 149 * This call can be used by GP to pass an attribute through all shaders dire
ctly to 'output' in | 149 * This call can be used by GP to pass an attribute through all shaders dire
ctly to 'output' in |
| 150 * the fragment shader. Though this call effects both the vertex shader and
fragment shader, | 150 * the fragment shader. Though this call effects both the vertex shader and
fragment shader, |
| 151 * it expects 'output' to be defined in the fragment shader before this call
is made. | 151 * it expects 'output' to be defined in the fragment shader before this call
is made. |
| 152 * TODO it might be nicer behavior to have a flag to declare output inside t
his call | 152 * TODO it might be nicer behavior to have a flag to declare output inside t
his call |
| 153 */ | 153 */ |
| 154 virtual void addPassThroughAttribute(const GrGeometryProcessor::Attribute*, | 154 virtual void addPassThroughAttribute(const GrGeometryProcessor::Attribute*, |
| 155 const char* output) = 0; | 155 const char* output) = 0; |
| 156 | 156 |
| 157 // TODO rename getFragmentBuilder | 157 // TODO rename getFragmentBuilder |
| 158 virtual GrGLGPFragmentBuilder* getFragmentShaderBuilder() = 0; | 158 virtual GrGLFragmentBuilder* getFragmentShaderBuilder() = 0; |
| 159 virtual GrGLVertexBuilder* getVertexShaderBuilder() = 0; | 159 virtual GrGLVertexBuilder* getVertexShaderBuilder() = 0; |
| 160 | 160 |
| 161 /* | 161 /* |
| 162 * *NOTE* NO MEMBERS ALLOWED, MULTIPLE INHERITANCE | 162 * *NOTE* NO MEMBERS ALLOWED, MULTIPLE INHERITANCE |
| 163 */ | 163 */ |
| 164 }; | 164 }; |
| 165 | 165 |
| 166 /* a specializations for FPs. Lets the user add uniforms and FS code */ | 166 /* a specializations for FPs. Lets the user add uniforms and FS code */ |
| 167 class GrGLFPBuilder : public virtual GrGLUniformBuilder { | 167 class GrGLFPBuilder : public virtual GrGLUniformBuilder { |
| 168 public: | 168 public: |
| 169 virtual GrGLFPFragmentBuilder* getFragmentShaderBuilder() = 0; | 169 virtual GrGLFragmentBuilder* getFragmentShaderBuilder() = 0; |
| 170 | 170 |
| 171 /* | 171 /* |
| 172 * *NOTE* NO MEMBERS ALLOWED, MULTIPLE INHERITANCE | 172 * *NOTE* NO MEMBERS ALLOWED, MULTIPLE INHERITANCE |
| 173 */ | 173 */ |
| 174 }; | 174 }; |
| 175 | 175 |
| 176 /* a specializations for XPs. Lets the user add uniforms and FS code */ | 176 /* a specializations for XPs. Lets the user add uniforms and FS code */ |
| 177 class GrGLXPBuilder : public virtual GrGLUniformBuilder { | 177 class GrGLXPBuilder : public virtual GrGLUniformBuilder { |
| 178 public: | 178 public: |
| 179 virtual GrGLFPFragmentBuilder* getFragmentShaderBuilder() = 0; | 179 virtual GrGLXPFragmentBuilder* getFragmentShaderBuilder() = 0; |
| 180 | 180 |
| 181 /* | 181 /* |
| 182 * *NOTE* NO MEMBERS ALLOWED, MULTIPLE INHERITANCE | 182 * *NOTE* NO MEMBERS ALLOWED, MULTIPLE INHERITANCE |
| 183 */ | 183 */ |
| 184 }; | 184 }; |
| 185 | 185 |
| 186 /** | 186 /** |
| 187 * The below struct represent processors installed in programs. | 187 * The below struct represent processors installed in programs. |
| 188 */ | 188 */ |
| 189 template <class Proc> | 189 template <class Proc> |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 241 } | 241 } |
| 242 | 242 |
| 243 const char* getUniformCStr(UniformHandle u) const override { | 243 const char* getUniformCStr(UniformHandle u) const override { |
| 244 return this->getUniformVariable(u).c_str(); | 244 return this->getUniformVariable(u).c_str(); |
| 245 } | 245 } |
| 246 | 246 |
| 247 const GrGLContextInfo& ctxInfo() const override; | 247 const GrGLContextInfo& ctxInfo() const override; |
| 248 | 248 |
| 249 GrGLGpu* gpu() const override { return fGpu; } | 249 GrGLGpu* gpu() const override { return fGpu; } |
| 250 | 250 |
| 251 GrGLFPFragmentBuilder* getFragmentShaderBuilder() override { return &fFS; } | 251 GrGLXPFragmentBuilder* getFragmentShaderBuilder() override { return &fFS; } |
| 252 GrGLVertexBuilder* getVertexShaderBuilder() override { return &fVS; } | 252 GrGLVertexBuilder* getVertexShaderBuilder() override { return &fVS; } |
| 253 | 253 |
| 254 void addVarying( | 254 void addVarying( |
| 255 const char* name, | 255 const char* name, |
| 256 GrGLVarying*, | 256 GrGLVarying*, |
| 257 GrSLPrecision fsPrecision = kDefault_GrSLPrecision) override; | 257 GrSLPrecision fsPrecision = kDefault_GrSLPrecision) override; |
| 258 | 258 |
| 259 void addPassThroughAttribute(const GrPrimitiveProcessor::Attribute*, | 259 void addPassThroughAttribute(const GrPrimitiveProcessor::Attribute*, |
| 260 const char* output) override; | 260 const char* output) override; |
| 261 | 261 |
| (...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 391 UniformInfoArray fUniforms; | 391 UniformInfoArray fUniforms; |
| 392 GrGLPrimitiveProcessor::TransformsIn fCoordTransforms; | 392 GrGLPrimitiveProcessor::TransformsIn fCoordTransforms; |
| 393 GrGLPrimitiveProcessor::TransformsOut fOutCoords; | 393 GrGLPrimitiveProcessor::TransformsOut fOutCoords; |
| 394 | 394 |
| 395 friend class GrGLShaderBuilder; | 395 friend class GrGLShaderBuilder; |
| 396 friend class GrGLVertexBuilder; | 396 friend class GrGLVertexBuilder; |
| 397 friend class GrGLFragmentShaderBuilder; | 397 friend class GrGLFragmentShaderBuilder; |
| 398 friend class GrGLGeometryBuilder; | 398 friend class GrGLGeometryBuilder; |
| 399 }; | 399 }; |
| 400 #endif | 400 #endif |
| OLD | NEW |