| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2015 Google Inc. | 2 * Copyright 2015 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 GrGLSLProgramBuilder_DEFINED | 8 #ifndef GrGLSLProgramBuilder_DEFINED |
| 9 #define GrGLSLProgramBuilder_DEFINED | 9 #define GrGLSLProgramBuilder_DEFINED |
| 10 | 10 |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 98 void cleanupFragmentProcessors(); | 98 void cleanupFragmentProcessors(); |
| 99 | 99 |
| 100 void finalizeShaders(); | 100 void finalizeShaders(); |
| 101 | 101 |
| 102 private: | 102 private: |
| 103 // reset is called by program creator between each processor's emit code. I
t increments the | 103 // reset is called by program creator between each processor's emit code. I
t increments the |
| 104 // stage offset for variable name mangling, and also ensures verfication var
iables in the | 104 // stage offset for variable name mangling, and also ensures verfication var
iables in the |
| 105 // fragment shader are cleared. | 105 // fragment shader are cleared. |
| 106 void reset() { | 106 void reset() { |
| 107 this->addStage(); | 107 this->addStage(); |
| 108 fFS.reset(); | 108 SkDEBUGCODE(fFS.resetVerification();) |
| 109 } | 109 } |
| 110 void addStage() { fStageIndex++; } | 110 void addStage() { fStageIndex++; } |
| 111 | 111 |
| 112 class AutoStageAdvance { | 112 class AutoStageAdvance { |
| 113 public: | 113 public: |
| 114 AutoStageAdvance(GrGLSLProgramBuilder* pb) | 114 AutoStageAdvance(GrGLSLProgramBuilder* pb) |
| 115 : fPB(pb) { | 115 : fPB(pb) { |
| 116 fPB->reset(); | 116 fPB->reset(); |
| 117 // Each output to the fragment processor gets its own code section | 117 // Each output to the fragment processor gets its own code section |
| 118 fPB->fFS.nextStage(); | 118 fPB->fFS.nextStage(); |
| (...skipping 15 matching lines...) Expand all Loading... |
| 134 int index, | 134 int index, |
| 135 const GrGLSLExpr4& input, | 135 const GrGLSLExpr4& input, |
| 136 GrGLSLExpr4* output); | 136 GrGLSLExpr4* output); |
| 137 void emitAndInstallXferProc(const GrXferProcessor&, | 137 void emitAndInstallXferProc(const GrXferProcessor&, |
| 138 const GrGLSLExpr4& colorIn, | 138 const GrGLSLExpr4& colorIn, |
| 139 const GrGLSLExpr4& coverageIn, | 139 const GrGLSLExpr4& coverageIn, |
| 140 bool ignoresCoverage, | 140 bool ignoresCoverage, |
| 141 GrPixelLocalStorageState plsState); | 141 GrPixelLocalStorageState plsState); |
| 142 void emitFSOutputSwizzle(bool hasSecondaryOutput); | 142 void emitFSOutputSwizzle(bool hasSecondaryOutput); |
| 143 | 143 |
| 144 #ifdef SK_DEBUG |
| 144 void verify(const GrPrimitiveProcessor&); | 145 void verify(const GrPrimitiveProcessor&); |
| 145 void verify(const GrXferProcessor&); | 146 void verify(const GrXferProcessor&); |
| 146 void verify(const GrFragmentProcessor&); | 147 void verify(const GrFragmentProcessor&); |
| 148 #endif |
| 147 | 149 |
| 148 virtual void emitSamplers(const GrProcessor& processor, | 150 virtual void emitSamplers(const GrProcessor& processor, |
| 149 GrGLSLTextureSampler::TextureSamplerArray* outSamp
lers) = 0; | 151 GrGLSLTextureSampler::TextureSamplerArray* outSamp
lers) = 0; |
| 150 | 152 |
| 151 GrGLSLPrimitiveProcessor::TransformsIn fCoordTransforms; | 153 GrGLSLPrimitiveProcessor::TransformsIn fCoordTransforms; |
| 152 GrGLSLPrimitiveProcessor::TransformsOut fOutCoords; | 154 GrGLSLPrimitiveProcessor::TransformsOut fOutCoords; |
| 153 }; | 155 }; |
| 154 | 156 |
| 155 #endif | 157 #endif |
| OLD | NEW |