| 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 |
| 11 #include "GrGLFragmentShaderBuilder.h" | 11 #include "GrGLFragmentShaderBuilder.h" |
| 12 #include "GrGLGeometryShaderBuilder.h" | 12 #include "GrGLGeometryShaderBuilder.h" |
| 13 #include "GrGLVertexShaderBuilder.h" | 13 #include "GrGLVertexShaderBuilder.h" |
| 14 #include "../GrGLProgramDataManager.h" | 14 #include "../GrGLProgramDataManager.h" |
| 15 #include "../GrGLPrimitiveProcessor.h" | 15 #include "../GrGLPrimitiveProcessor.h" |
| 16 #include "../GrGLXferProcessor.h" | 16 #include "../GrGLXferProcessor.h" |
| 17 #include "../../GrPipeline.h" | 17 #include "../../GrPipeline.h" |
| 18 | 18 |
| 19 class GrFragmentProcessor; | 19 class GrFragmentProcessor; |
| 20 class GrGLSLCaps; |
| 20 | 21 |
| 21 // Enough precision to represent 1 / 2048 accurately in printf | 22 // Enough precision to represent 1 / 2048 accurately in printf |
| 22 #define GR_SIGNIFICANT_POW2_DECIMAL_DIG 11 | 23 #define GR_SIGNIFICANT_POW2_DECIMAL_DIG 11 |
| 23 | 24 |
| 24 /* | 25 /* |
| 25 * This is the base class for a series of interfaces. This base class *MUST* re
main abstract with | 26 * This is the base class for a series of interfaces. This base class *MUST* re
main abstract with |
| 26 * NO data members because it is used in multiple interface inheritance. | 27 * NO data members because it is used in multiple interface inheritance. |
| 27 * Heirarchy: | 28 * Heirarchy: |
| 28 * GrGLUniformBuilder | 29 * GrGLUniformBuilder |
| 29 * / \ | 30 * / \ |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 68 | 69 |
| 69 virtual const GrGLShaderVar& getUniformVariable(UniformHandle u) const = 0; | 70 virtual const GrGLShaderVar& getUniformVariable(UniformHandle u) const = 0; |
| 70 | 71 |
| 71 /** | 72 /** |
| 72 * Shortcut for getUniformVariable(u).c_str() | 73 * Shortcut for getUniformVariable(u).c_str() |
| 73 */ | 74 */ |
| 74 virtual const char* getUniformCStr(UniformHandle u) const = 0; | 75 virtual const char* getUniformCStr(UniformHandle u) const = 0; |
| 75 | 76 |
| 76 virtual const GrGLContextInfo& ctxInfo() const = 0; | 77 virtual const GrGLContextInfo& ctxInfo() const = 0; |
| 77 | 78 |
| 79 virtual const GrGLSLCaps* glslCaps() const = 0; |
| 80 |
| 78 virtual GrGLGpu* gpu() const = 0; | 81 virtual GrGLGpu* gpu() const = 0; |
| 79 | 82 |
| 80 /* | 83 /* |
| 81 * *NOTE* NO MEMBERS ALLOWED, MULTIPLE INHERITANCE | 84 * *NOTE* NO MEMBERS ALLOWED, MULTIPLE INHERITANCE |
| 82 */ | 85 */ |
| 83 }; | 86 }; |
| 84 | 87 |
| 85 // TODO move this into GrGLGPBuilder and move them both out of this file | 88 // TODO move this into GrGLGPBuilder and move them both out of this file |
| 86 class GrGLVarying { | 89 class GrGLVarying { |
| 87 public: | 90 public: |
| (...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 243 const GrGLShaderVar& getUniformVariable(UniformHandle u) const override { | 246 const GrGLShaderVar& getUniformVariable(UniformHandle u) const override { |
| 244 return fUniforms[u.toIndex()].fVariable; | 247 return fUniforms[u.toIndex()].fVariable; |
| 245 } | 248 } |
| 246 | 249 |
| 247 const char* getUniformCStr(UniformHandle u) const override { | 250 const char* getUniformCStr(UniformHandle u) const override { |
| 248 return this->getUniformVariable(u).c_str(); | 251 return this->getUniformVariable(u).c_str(); |
| 249 } | 252 } |
| 250 | 253 |
| 251 const GrGLContextInfo& ctxInfo() const override; | 254 const GrGLContextInfo& ctxInfo() const override; |
| 252 | 255 |
| 256 const GrGLSLCaps* glslCaps() const override; |
| 257 |
| 253 GrGLGpu* gpu() const override { return fGpu; } | 258 GrGLGpu* gpu() const override { return fGpu; } |
| 254 | 259 |
| 255 GrGLXPFragmentBuilder* getFragmentShaderBuilder() override { return &fFS; } | 260 GrGLXPFragmentBuilder* getFragmentShaderBuilder() override { return &fFS; } |
| 256 GrGLVertexBuilder* getVertexShaderBuilder() override { return &fVS; } | 261 GrGLVertexBuilder* getVertexShaderBuilder() override { return &fVS; } |
| 257 | 262 |
| 258 void addVarying( | 263 void addVarying( |
| 259 const char* name, | 264 const char* name, |
| 260 GrGLVarying*, | 265 GrGLVarying*, |
| 261 GrSLPrecision precision = kDefault_GrSLPrecision) override; | 266 GrSLPrecision precision = kDefault_GrSLPrecision) override; |
| 262 | 267 |
| (...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 399 GrGLPrimitiveProcessor::TransformsOut fOutCoords; | 404 GrGLPrimitiveProcessor::TransformsOut fOutCoords; |
| 400 SkTArray<UniformHandle> fSamplerUniforms; | 405 SkTArray<UniformHandle> fSamplerUniforms; |
| 401 SeparableVaryingInfoArray fSeparableVaryingInfos; | 406 SeparableVaryingInfoArray fSeparableVaryingInfos; |
| 402 | 407 |
| 403 friend class GrGLShaderBuilder; | 408 friend class GrGLShaderBuilder; |
| 404 friend class GrGLVertexBuilder; | 409 friend class GrGLVertexBuilder; |
| 405 friend class GrGLFragmentShaderBuilder; | 410 friend class GrGLFragmentShaderBuilder; |
| 406 friend class GrGLGeometryBuilder; | 411 friend class GrGLGeometryBuilder; |
| 407 }; | 412 }; |
| 408 #endif | 413 #endif |
| OLD | NEW |