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

Side by Side Diff: src/gpu/glsl/GrGLSLProgramBuilder.cpp

Issue 2237963002: LightingShader and NormalSource comment and style fixes (Closed) Base URL: https://skia.googlesource.com/skia@master
Patch Set: Addressed patch 1 comment Created 4 years, 4 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 | « src/core/SkNormalSource.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 2015 Google Inc. 2 * Copyright 2015 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 "glsl/GrGLSLProgramBuilder.h" 8 #include "glsl/GrGLSLProgramBuilder.h"
9 9
10 #include "GrPipeline.h" 10 #include "GrPipeline.h"
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 GrGLSLExpr4* outputColor, 83 GrGLSLExpr4* outputColor,
84 GrGLSLExpr4* outputCoverage) { 84 GrGLSLExpr4* outputCoverage) {
85 // Program builders have a bit of state we need to clear with each effect 85 // Program builders have a bit of state we need to clear with each effect
86 AutoStageAdvance adv(this); 86 AutoStageAdvance adv(this);
87 this->nameExpression(outputColor, "outputColor"); 87 this->nameExpression(outputColor, "outputColor");
88 this->nameExpression(outputCoverage, "outputCoverage"); 88 this->nameExpression(outputCoverage, "outputCoverage");
89 89
90 const char* distanceVectorName = nullptr; 90 const char* distanceVectorName = nullptr;
91 if (this->fPipeline.usesDistanceVectorField() && proc.implementsDistanceVect or()) { 91 if (this->fPipeline.usesDistanceVectorField() && proc.implementsDistanceVect or()) {
92 distanceVectorName = fFS.distanceVectorName(); 92 distanceVectorName = fFS.distanceVectorName();
93 fFS.codeAppend( "// Normalized vector to the closest geometric edge (in source space)\n"); 93 fFS.codeAppend( "// Normalized vector to the closest geometric edge (in device space)\n");
94 fFS.codeAppend( "// Distance to the edge encoded in the z-component\n"); 94 fFS.codeAppend( "// Distance to the edge encoded in the z-component\n");
95 fFS.codeAppendf("vec3 %s;", distanceVectorName); 95 fFS.codeAppendf("vec3 %s;", distanceVectorName);
96 } 96 }
97 97
98 // Enclose custom code in a block to avoid namespace conflicts 98 // Enclose custom code in a block to avoid namespace conflicts
99 SkString openBrace; 99 SkString openBrace;
100 openBrace.printf("{ // Stage %d, %s\n", fStageIndex, proc.name()); 100 openBrace.printf("{ // Stage %d, %s\n", fStageIndex, proc.name());
101 fFS.codeAppend(openBrace.c_str()); 101 fFS.codeAppend(openBrace.c_str());
102 fVS.codeAppendf("// Primitive Processor %s\n", proc.name()); 102 fVS.codeAppendf("// Primitive Processor %s\n", proc.name());
103 103
(...skipping 308 matching lines...) Expand 10 before | Expand all | Expand 10 after
412 delete fFragmentProcessors[i]; 412 delete fFragmentProcessors[i];
413 } 413 }
414 } 414 }
415 415
416 void GrGLSLProgramBuilder::finalizeShaders() { 416 void GrGLSLProgramBuilder::finalizeShaders() {
417 this->varyingHandler()->finalize(); 417 this->varyingHandler()->finalize();
418 fVS.finalize(kVertex_GrShaderFlag); 418 fVS.finalize(kVertex_GrShaderFlag);
419 fFS.finalize(kFragment_GrShaderFlag); 419 fFS.finalize(kFragment_GrShaderFlag);
420 420
421 } 421 }
OLDNEW
« no previous file with comments | « src/core/SkNormalSource.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698