Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(757)

Side by Side Diff: src/gpu/gl/builders/GrGLProgramBuilder.cpp

Issue 735153002: Add processor name to comment when printing out shaders. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « include/gpu/GrProcessorStage.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #include "gl/GrGLProgram.h" 9 #include "gl/GrGLProgram.h"
10 #include "gl/GrGLSLPrettyPrint.h" 10 #include "gl/GrGLSLPrettyPrint.h"
(...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after
289 if (output->isValid()) { 289 if (output->isValid()) {
290 outColorName = output->c_str(); 290 outColorName = output->c_str();
291 } else { 291 } else {
292 this->nameVariable(&outColorName, '\0', "output"); 292 this->nameVariable(&outColorName, '\0', "output");
293 } 293 }
294 fFS.codeAppendf("vec4 %s;", outColorName.c_str()); 294 fFS.codeAppendf("vec4 %s;", outColorName.c_str());
295 *output = outColorName; 295 *output = outColorName;
296 296
297 // Enclose custom code in a block to avoid namespace conflicts 297 // Enclose custom code in a block to avoid namespace conflicts
298 SkString openBrace; 298 SkString openBrace;
299 openBrace.printf("{ // Stage %d\n", fStageIndex); 299 openBrace.printf("{ // Stage %d, %s\n", fStageIndex, proc.name());
300 fFS.codeAppend(openBrace.c_str()); 300 fFS.codeAppend(openBrace.c_str());
301 301
302 this->emitAndInstallProc(proc, keyProvider.get(index), output->c_str(), 302 this->emitAndInstallProc(proc, keyProvider.get(index), output->c_str(),
303 input.isOnes() ? NULL : input.c_str()); 303 input.isOnes() ? NULL : input.c_str());
304 304
305 fFS.codeAppend("}"); 305 fFS.codeAppend("}");
306 } 306 }
307 307
308 void GrGLProgramBuilder::emitAndInstallProc(const GrFragmentStage& fs, 308 void GrGLProgramBuilder::emitAndInstallProc(const GrFragmentStage& fs,
309 const GrProcessorKey& key, 309 const GrProcessorKey& key,
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after
522 } 522 }
523 523
524 //////////////////////////////////////////////////////////////////////////////// /////////////////// 524 //////////////////////////////////////////////////////////////////////////////// ///////////////////
525 525
526 GrGLInstalledFragProcs::~GrGLInstalledFragProcs() { 526 GrGLInstalledFragProcs::~GrGLInstalledFragProcs() {
527 int numProcs = fProcs.count(); 527 int numProcs = fProcs.count();
528 for (int e = 0; e < numProcs; ++e) { 528 for (int e = 0; e < numProcs; ++e) {
529 SkDELETE(fProcs[e]); 529 SkDELETE(fProcs[e]);
530 } 530 }
531 } 531 }
OLDNEW
« no previous file with comments | « include/gpu/GrProcessorStage.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698