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 "GrGLProgramBuilder.h" | 8 #include "GrGLProgramBuilder.h" |
9 #include "gl/GrGLProgram.h" | 9 #include "gl/GrGLProgram.h" |
10 #include "gl/GrGLSLPrettyPrint.h" | 10 #include "gl/GrGLSLPrettyPrint.h" |
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
171 } | 171 } |
172 } | 172 } |
173 } | 173 } |
174 | 174 |
175 const GrGLContextInfo& GrGLProgramBuilder::ctxInfo() const { | 175 const GrGLContextInfo& GrGLProgramBuilder::ctxInfo() const { |
176 return fGpu->ctxInfo(); | 176 return fGpu->ctxInfo(); |
177 } | 177 } |
178 | 178 |
179 void GrGLProgramBuilder::emitAndInstallProcs(GrGLSLExpr4* inputColor, GrGLSLExpr
4* inputCoverage) { | 179 void GrGLProgramBuilder::emitAndInstallProcs(GrGLSLExpr4* inputColor, GrGLSLExpr
4* inputCoverage) { |
180 if (fOptState.hasGeometryProcessor()) { | 180 if (fOptState.hasGeometryProcessor()) { |
181 fVS.setupUniformViewMatrix(); | |
182 | |
183 fVS.codeAppend("gl_PointSize = 1.0;"); | 181 fVS.codeAppend("gl_PointSize = 1.0;"); |
184 | 182 |
185 // Setup position | 183 // Setup position |
186 // TODO it'd be possible to remove these from the vertexshader builder a
nd have them | 184 // TODO it'd be possible to remove these from the vertexshader builder a
nd have them |
187 // be outputs from the emit call. We don't do this because emitargs is
constant. It would | 185 // be outputs from the emit call. We don't do this because emitargs is
constant. It would |
188 // be easy to change this though | 186 // be easy to change this though |
189 fVS.codeAppendf("vec3 %s;", fVS.glPosition()); | 187 fVS.codeAppendf("vec3 %s;", fVS.glPosition()); |
190 fVS.codeAppendf("vec2 %s;", fVS.positionCoords()); | 188 fVS.codeAppendf("vec2 %s;", fVS.positionCoords()); |
191 fVS.codeAppendf("vec2 %s;", fVS.localCoords()); | 189 fVS.codeAppendf("vec2 %s;", fVS.localCoords()); |
192 | 190 |
(...skipping 352 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
545 } | 543 } |
546 | 544 |
547 ////////////////////////////////////////////////////////////////////////////////
/////////////////// | 545 ////////////////////////////////////////////////////////////////////////////////
/////////////////// |
548 | 546 |
549 GrGLInstalledFragProcs::~GrGLInstalledFragProcs() { | 547 GrGLInstalledFragProcs::~GrGLInstalledFragProcs() { |
550 int numProcs = fProcs.count(); | 548 int numProcs = fProcs.count(); |
551 for (int e = 0; e < numProcs; ++e) { | 549 for (int e = 0; e < numProcs; ++e) { |
552 SkDELETE(fProcs[e]); | 550 SkDELETE(fProcs[e]); |
553 } | 551 } |
554 } | 552 } |
OLD | NEW |