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

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

Issue 1253513003: Name of primitive processor will now be printed in generated shader code (Closed) Base URL: https://skia.googlesource.com/skia@master
Patch Set: Created 5 years, 5 months 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 | « no previous file | 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 9
10 #include "gl/GrGLGeometryProcessor.h" 10 #include "gl/GrGLGeometryProcessor.h"
(...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698