| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2012 Google Inc. | 2 * Copyright 2012 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 GrGLShaderBuilder_DEFINED | 8 #ifndef GrGLShaderBuilder_DEFINED |
| 9 #define GrGLShaderBuilder_DEFINED | 9 #define GrGLShaderBuilder_DEFINED |
| 10 | 10 |
| (...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 241 // generating stage code. | 241 // generating stage code. |
| 242 void nameVariable(SkString* out, char prefix, const char* name); | 242 void nameVariable(SkString* out, char prefix, const char* name); |
| 243 | 243 |
| 244 // Helper for emitEffects(). | 244 // Helper for emitEffects(). |
| 245 void createAndEmitEffects(GrGLProgramEffectsBuilder*, | 245 void createAndEmitEffects(GrGLProgramEffectsBuilder*, |
| 246 const GrEffectStage* effectStages[], | 246 const GrEffectStage* effectStages[], |
| 247 const EffectKey effectKeys[], | 247 const EffectKey effectKeys[], |
| 248 int effectCnt, | 248 int effectCnt, |
| 249 GrGLSLExpr4* inOutFSColor); | 249 GrGLSLExpr4* inOutFSColor); |
| 250 | 250 |
| 251 virtual bool compileAndAttachShaders(GrGLuint programId) const; | 251 virtual bool compileAndAttachShaders(GrGLuint programId, SkTDArray<GrGLuint>
* shaderIds) const; |
| 252 virtual void bindProgramLocations(GrGLuint programId) const; | 252 virtual void bindProgramLocations(GrGLuint programId) const; |
| 253 | 253 |
| 254 void appendDecls(const VarArray&, SkString*) const; | 254 void appendDecls(const VarArray&, SkString*) const; |
| 255 void appendUniformDecls(ShaderVisibility, SkString*) const; | 255 void appendUniformDecls(ShaderVisibility, SkString*) const; |
| 256 | 256 |
| 257 private: | 257 private: |
| 258 class CodeStage : public SkNoncopyable { | 258 class CodeStage : public SkNoncopyable { |
| 259 public: | 259 public: |
| 260 CodeStage() : fNextIndex(0), fCurrentIndex(-1), fEffectStage(NULL) {} | 260 CodeStage() : fNextIndex(0), fCurrentIndex(-1), fEffectStage(NULL) {} |
| 261 | 261 |
| (...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 415 const GrEffectStage* effectStages[], | 415 const GrEffectStage* effectStages[], |
| 416 const EffectKey effectKeys[], | 416 const EffectKey effectKeys[], |
| 417 int effectCnt, | 417 int effectCnt, |
| 418 GrGLSLExpr4* inOutFSColor) SK_OVERRIDE; | 418 GrGLSLExpr4* inOutFSColor) SK_OVERRIDE; |
| 419 | 419 |
| 420 GrGLUniformManager::UniformHandle getViewMatrixUniform() const { | 420 GrGLUniformManager::UniformHandle getViewMatrixUniform() const { |
| 421 return fViewMatrixUniform; | 421 return fViewMatrixUniform; |
| 422 } | 422 } |
| 423 | 423 |
| 424 protected: | 424 protected: |
| 425 virtual bool compileAndAttachShaders(GrGLuint programId) const SK_OVERRIDE; | 425 virtual bool compileAndAttachShaders(GrGLuint programId, SkTDArray<GrGLuint>
* shaderIds) const SK_OVERRIDE; |
| 426 virtual void bindProgramLocations(GrGLuint programId) const SK_OVERRIDE; | 426 virtual void bindProgramLocations(GrGLuint programId) const SK_OVERRIDE; |
| 427 | 427 |
| 428 private: | 428 private: |
| 429 const GrGLProgramDesc& fDesc; | 429 const GrGLProgramDesc& fDesc; |
| 430 VarArray fVSAttrs; | 430 VarArray fVSAttrs; |
| 431 VarArray fVSOutputs; | 431 VarArray fVSOutputs; |
| 432 VarArray fGSInputs; | 432 VarArray fGSInputs; |
| 433 VarArray fGSOutputs; | 433 VarArray fGSOutputs; |
| 434 | 434 |
| 435 SkString fVSCode; | 435 SkString fVSCode; |
| (...skipping 30 matching lines...) Expand all Loading... |
| 466 int effectCnt, | 466 int effectCnt, |
| 467 GrGLSLExpr4* inOutFSColor) SK_OVERRIDE; | 467 GrGLSLExpr4* inOutFSColor) SK_OVERRIDE; |
| 468 | 468 |
| 469 private: | 469 private: |
| 470 int fNumTexCoordSets; | 470 int fNumTexCoordSets; |
| 471 | 471 |
| 472 typedef GrGLShaderBuilder INHERITED; | 472 typedef GrGLShaderBuilder INHERITED; |
| 473 }; | 473 }; |
| 474 | 474 |
| 475 #endif | 475 #endif |
| OLD | NEW |