OLD | NEW |
(Empty) | |
| 1 /* |
| 2 * Copyright 2015 Google Inc. |
| 3 * |
| 4 * Use of this source code is governed by a BSD-style license that can be |
| 5 * found in the LICENSE file. |
| 6 */ |
| 7 |
| 8 #include "glsl/GrGLSLProgramBuilder.h" |
| 9 |
| 10 const int GrGLSLProgramBuilder::kVarsPerBlock = 8; |
| 11 |
| 12 GrGLSLProgramBuilder::GrGLSLProgramBuilder(const DrawArgs& args) |
| 13 : fVS(this) |
| 14 , fGS(this) |
| 15 , fFS(this, args.fDesc->header().fFragPosKey) |
| 16 , fStageIndex(-1) |
| 17 , fArgs(args) { |
| 18 } |
| 19 |
| 20 void GrGLSLProgramBuilder::nameVariable(SkString* out, char prefix, const char*
name, bool mangle) { |
| 21 if ('\0' == prefix) { |
| 22 *out = name; |
| 23 } else { |
| 24 out->printf("%c%s", prefix, name); |
| 25 } |
| 26 if (mangle) { |
| 27 if (out->endsWith('_')) { |
| 28 // Names containing "__" are reserved. |
| 29 out->append("x"); |
| 30 } |
| 31 out->appendf("_Stage%d%s", fStageIndex, fFS.getMangleString().c_str()); |
| 32 } |
| 33 } |
| 34 |
| 35 void GrGLSLProgramBuilder::appendUniformDecls(ShaderVisibility visibility, |
| 36 SkString* out) const { |
| 37 this->onAppendUniformDecls(visibility, out); |
| 38 } |
| 39 |
OLD | NEW |