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 #include "GrGLShaderBuilder.h" | 8 #include "GrGLShaderBuilder.h" |
9 #include "GrGLProgramBuilder.h" | 9 #include "GrGLProgramBuilder.h" |
10 #include "GrGLShaderStringBuilder.h" | 10 #include "GrGLShaderStringBuilder.h" |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 GrGLShaderBuilder::GrGLShaderBuilder(GrGLProgramBuilder* program) | 51 GrGLShaderBuilder::GrGLShaderBuilder(GrGLProgramBuilder* program) |
52 : fProgramBuilder(program) | 52 : fProgramBuilder(program) |
53 , fInputs(GrGLProgramBuilder::kVarsPerBlock) | 53 , fInputs(GrGLProgramBuilder::kVarsPerBlock) |
54 , fOutputs(GrGLProgramBuilder::kVarsPerBlock) | 54 , fOutputs(GrGLProgramBuilder::kVarsPerBlock) |
55 , fFeaturesAddedMask(0) | 55 , fFeaturesAddedMask(0) |
56 , fCodeIndex(kCode) | 56 , fCodeIndex(kCode) |
57 , fFinalized(false) { | 57 , fFinalized(false) { |
58 // We push back some dummy pointers which will later become our header | 58 // We push back some dummy pointers which will later become our header |
59 for (int i = 0; i <= kCode; i++) { | 59 for (int i = 0; i <= kCode; i++) { |
60 fShaderStrings.push_back(); | 60 fShaderStrings.push_back(); |
61 fCompilerStrings.push_back(NULL); | 61 fCompilerStrings.push_back(nullptr); |
62 fCompilerStringLengths.push_back(0); | 62 fCompilerStringLengths.push_back(0); |
63 } | 63 } |
64 | 64 |
65 this->main() = "void main() {"; | 65 this->main() = "void main() {"; |
66 } | 66 } |
67 | 67 |
68 void GrGLShaderBuilder::declAppend(const GrGLShaderVar& var) { | 68 void GrGLShaderBuilder::declAppend(const GrGLShaderVar& var) { |
69 SkString tempDecl; | 69 SkString tempDecl; |
70 var.appendDecl(fProgramBuilder->ctxInfo(), &tempDecl); | 70 var.appendDecl(fProgramBuilder->ctxInfo(), &tempDecl); |
71 this->codeAppendf("%s;", tempDecl.c_str()); | 71 this->codeAppendf("%s;", tempDecl.c_str()); |
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
215 fFinalized = true; | 215 fFinalized = true; |
216 | 216 |
217 if (!shaderId) { | 217 if (!shaderId) { |
218 return false; | 218 return false; |
219 } | 219 } |
220 | 220 |
221 *shaderIds->append() = shaderId; | 221 *shaderIds->append() = shaderId; |
222 | 222 |
223 return true; | 223 return true; |
224 } | 224 } |
OLD | NEW |