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

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

Issue 2358843002: Conditionally insert gl_PointSize into shaders. (Closed)
Patch Set: minor Created 4 years, 3 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/gpu/gl/GrGLPathRendering.cpp ('k') | src/gpu/instanced/GLInstancedRendering.cpp » ('j') | 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 "GrGLSLVertexShaderBuilder.h" 8 #include "GrGLSLVertexShaderBuilder.h"
9 #include "glsl/GrGLSLProgramBuilder.h" 9 #include "glsl/GrGLSLProgramBuilder.h"
10 #include "glsl/GrGLSLUniformHandler.h" 10 #include "glsl/GrGLSLUniformHandler.h"
(...skipping 28 matching lines...) Expand all
39 posVar.c_str(), fRtAdjustName, 39 posVar.c_str(), fRtAdjustName,
40 posVar.c_str(), fRtAdjustName, 40 posVar.c_str(), fRtAdjustName,
41 posVar.c_str()); 41 posVar.c_str());
42 } else { 42 } else {
43 SkASSERT(kVec2f_GrSLType == posVar.getType()); 43 SkASSERT(kVec2f_GrSLType == posVar.getType());
44 this->codeAppendf("gl_Position = vec4(%s.x * %s.x + %s.y, %s.y * %s.z + %s.w, 0, 1);", 44 this->codeAppendf("gl_Position = vec4(%s.x * %s.x + %s.y, %s.y * %s.z + %s.w, 0, 1);",
45 posVar.c_str(), fRtAdjustName, fRtAdjustName, 45 posVar.c_str(), fRtAdjustName, fRtAdjustName,
46 posVar.c_str(), fRtAdjustName, fRtAdjustName); 46 posVar.c_str(), fRtAdjustName, fRtAdjustName);
47 } 47 }
48 // We could have the GrGeometryProcessor do this, but its just easier to hav e it performed 48 // We could have the GrGeometryProcessor do this, but its just easier to hav e it performed
49 // here. If we ever need to set variable pointsize, then we can reinvestigat e 49 // here. If we ever need to set variable pointsize, then we can reinvestigat e.
50 this->codeAppend("gl_PointSize = 1.0;"); 50 if (this->getProgramBuilder()->desc().header().fHasPointSize) {
51 this->codeAppend("gl_PointSize = 1.0;");
52 }
51 } 53 }
52 54
53 void GrGLSLVertexBuilder::onFinalize() { 55 void GrGLSLVertexBuilder::onFinalize() {
54 fProgramBuilder->varyingHandler()->getVertexDecls(&this->inputs(), &this->ou tputs()); 56 fProgramBuilder->varyingHandler()->getVertexDecls(&this->inputs(), &this->ou tputs());
55 } 57 }
OLDNEW
« no previous file with comments | « src/gpu/gl/GrGLPathRendering.cpp ('k') | src/gpu/instanced/GLInstancedRendering.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698