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 "GrGLProgramBuilder.h" | 8 #include "GrGLProgramBuilder.h" |
9 | 9 |
10 #include "gl/GrGLGeometryProcessor.h" | 10 #include "gl/GrGLGeometryProcessor.h" |
(...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
261 GrGLSLExpr4* outputCoverage) { | 261 GrGLSLExpr4* outputCoverage) { |
262 // Program builders have a bit of state we need to clear with each effect | 262 // Program builders have a bit of state we need to clear with each effect |
263 AutoStageAdvance adv(this); | 263 AutoStageAdvance adv(this); |
264 this->nameExpression(outputColor, "outputColor"); | 264 this->nameExpression(outputColor, "outputColor"); |
265 this->nameExpression(outputCoverage, "outputCoverage"); | 265 this->nameExpression(outputCoverage, "outputCoverage"); |
266 | 266 |
267 // Enclose custom code in a block to avoid namespace conflicts | 267 // Enclose custom code in a block to avoid namespace conflicts |
268 SkString openBrace; | 268 SkString openBrace; |
269 openBrace.printf("{ // Stage %d, %s\n", fStageIndex, proc.name()); | 269 openBrace.printf("{ // Stage %d, %s\n", fStageIndex, proc.name()); |
270 fFS.codeAppend(openBrace.c_str()); | 270 fFS.codeAppend(openBrace.c_str()); |
| 271 fVS.codeAppendf("// Primitive Processor %s\n", proc.name()); |
271 | 272 |
272 this->emitAndInstallProc(proc, outputColor->c_str(), outputCoverage->c_str()
); | 273 this->emitAndInstallProc(proc, outputColor->c_str(), outputCoverage->c_str()
); |
273 | 274 |
274 fFS.codeAppend("}"); | 275 fFS.codeAppend("}"); |
275 } | 276 } |
276 | 277 |
277 void GrGLProgramBuilder::emitAndInstallProc(const GrPendingFragmentStage& fs, | 278 void GrGLProgramBuilder::emitAndInstallProc(const GrPendingFragmentStage& fs, |
278 int index, | 279 int index, |
279 const char* outColor, | 280 const char* outColor, |
280 const char* inColor) { | 281 const char* inColor) { |
(...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
495 } | 496 } |
496 | 497 |
497 ////////////////////////////////////////////////////////////////////////////////
/////////////////// | 498 ////////////////////////////////////////////////////////////////////////////////
/////////////////// |
498 | 499 |
499 GrGLInstalledFragProcs::~GrGLInstalledFragProcs() { | 500 GrGLInstalledFragProcs::~GrGLInstalledFragProcs() { |
500 int numProcs = fProcs.count(); | 501 int numProcs = fProcs.count(); |
501 for (int e = 0; e < numProcs; ++e) { | 502 for (int e = 0; e < numProcs; ++e) { |
502 SkDELETE(fProcs[e]); | 503 SkDELETE(fProcs[e]); |
503 } | 504 } |
504 } | 505 } |
OLD | NEW |