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 "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 Loading... |
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 } |
OLD | NEW |