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 #include "glsl/GrGLSLProgramBuilder.h" | 8 #include "glsl/GrGLSLProgramBuilder.h" |
9 | 9 |
10 const int GrGLSLProgramBuilder::kVarsPerBlock = 8; | 10 const int GrGLSLProgramBuilder::kVarsPerBlock = 8; |
(...skipping 16 matching lines...) Expand all Loading... |
27 if (out->endsWith('_')) { | 27 if (out->endsWith('_')) { |
28 // Names containing "__" are reserved. | 28 // Names containing "__" are reserved. |
29 out->append("x"); | 29 out->append("x"); |
30 } | 30 } |
31 out->appendf("_Stage%d%s", fStageIndex, fFS.getMangleString().c_str()); | 31 out->appendf("_Stage%d%s", fStageIndex, fFS.getMangleString().c_str()); |
32 } | 32 } |
33 } | 33 } |
34 | 34 |
35 void GrGLSLProgramBuilder::appendUniformDecls(ShaderVisibility visibility, | 35 void GrGLSLProgramBuilder::appendUniformDecls(ShaderVisibility visibility, |
36 SkString* out) const { | 36 SkString* out) const { |
37 this->onAppendUniformDecls(visibility, out); | 37 this->uniformHandler()->appendUniformDecls(visibility, out); |
38 } | 38 } |
39 | 39 |
| 40 void GrGLSLProgramBuilder::addRTAdjustmentUniform(GrSLPrecision precision, |
| 41 const char* name, |
| 42 const char** outName) { |
| 43 SkASSERT(!fUniformHandles.fRTAdjustmentUni.isValid()); |
| 44 fUniformHandles.fRTAdjustmentUni = |
| 45 this->uniformHandler()->addUniform(GrGLSLUniformHandler::kVertex_Vis
ibility, |
| 46 kVec4f_GrSLType, |
| 47 precision, |
| 48 name, |
| 49 outName); |
| 50 } |
| 51 |
| 52 void GrGLSLProgramBuilder::addRTHeightUniform(const char* name, const char** out
Name) { |
| 53 SkASSERT(!fUniformHandles.fRTHeightUni.isValid()); |
| 54 GrGLSLUniformHandler* uniformHandler = this->uniformHandler(); |
| 55 fUniformHandles.fRTHeightUni = |
| 56 uniformHandler->internalAddUniformArray(GrGLSLUniformHandler::kFragm
ent_Visibility, |
| 57 kFloat_GrSLType, kDefault_Gr
SLPrecision, |
| 58 name, false, 0, outName); |
| 59 } |
| 60 |
OLD | NEW |