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 "GrGLSLGeometryProcessor.h" | 8 #include "GrGLSLGeometryProcessor.h" |
9 | 9 |
10 #include "GrCoordTransform.h" | 10 #include "GrCoordTransform.h" |
11 #include "glsl/GrGLSLFragmentShaderBuilder.h" | 11 #include "glsl/GrGLSLFragmentShaderBuilder.h" |
12 #include "glsl/GrGLSLProcessorTypes.h" | |
13 #include "glsl/GrGLSLUniformHandler.h" | 12 #include "glsl/GrGLSLUniformHandler.h" |
14 #include "glsl/GrGLSLVarying.h" | 13 #include "glsl/GrGLSLVarying.h" |
15 #include "glsl/GrGLSLVertexShaderBuilder.h" | 14 #include "glsl/GrGLSLVertexShaderBuilder.h" |
16 | 15 |
17 void GrGLSLGeometryProcessor::emitCode(EmitArgs& args) { | 16 void GrGLSLGeometryProcessor::emitCode(EmitArgs& args) { |
18 GrGLSLVertexBuilder* vBuilder = args.fVertBuilder; | 17 GrGLSLVertexBuilder* vBuilder = args.fVertBuilder; |
19 GrGPArgs gpArgs; | 18 GrGPArgs gpArgs; |
20 this->onEmitCode(args, &gpArgs); | 19 this->onEmitCode(args, &gpArgs); |
21 vBuilder->transformToNormalizedDeviceSpace(gpArgs.fPositionVar); | 20 vBuilder->transformToNormalizedDeviceSpace(gpArgs.fPositionVar); |
22 if (kVec2f_GrSLType == gpArgs.fPositionVar.getType()) { | 21 if (kVec2f_GrSLType == gpArgs.fPositionVar.getType()) { |
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
150 gpArgs->fPositionVar.set(kVec2f_GrSLType, "pos2"); | 149 gpArgs->fPositionVar.set(kVec2f_GrSLType, "pos2"); |
151 vertBuilder->codeAppendf("vec2 %s = vec2(%s * vec3(%s, 1));", | 150 vertBuilder->codeAppendf("vec2 %s = vec2(%s * vec3(%s, 1));", |
152 gpArgs->fPositionVar.c_str(), viewMatrixNam
e, posName); | 151 gpArgs->fPositionVar.c_str(), viewMatrixNam
e, posName); |
153 } else { | 152 } else { |
154 gpArgs->fPositionVar.set(kVec3f_GrSLType, "pos3"); | 153 gpArgs->fPositionVar.set(kVec3f_GrSLType, "pos3"); |
155 vertBuilder->codeAppendf("vec3 %s = %s * vec3(%s, 1);", | 154 vertBuilder->codeAppendf("vec3 %s = %s * vec3(%s, 1);", |
156 gpArgs->fPositionVar.c_str(), viewMatrixNam
e, posName); | 155 gpArgs->fPositionVar.c_str(), viewMatrixNam
e, posName); |
157 } | 156 } |
158 } | 157 } |
159 } | 158 } |
OLD | NEW |