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 | 9 |
10 #include "gl/GrGLGeometryProcessor.h" | 10 #include "gl/GrGLGeometryProcessor.h" |
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
196 for (int t = 0; t < processor->numTransforms(); t++) { | 196 for (int t = 0; t < processor->numTransforms(); t++) { |
197 procCoords.push_back(&processor->coordTransform(t)); | 197 procCoords.push_back(&processor->coordTransform(t)); |
198 } | 198 } |
199 } | 199 } |
200 | 200 |
201 const GrPrimitiveProcessor& primProc = this->primitiveProcessor(); | 201 const GrPrimitiveProcessor& primProc = this->primitiveProcessor(); |
202 this->emitAndInstallProc(primProc, inputColor, inputCoverage); | 202 this->emitAndInstallProc(primProc, inputColor, inputCoverage); |
203 | 203 |
204 fFragmentProcessors.reset(SkNEW(GrGLInstalledFragProcs)); | 204 fFragmentProcessors.reset(SkNEW(GrGLInstalledFragProcs)); |
205 int numProcs = this->pipeline().numFragmentStages(); | 205 int numProcs = this->pipeline().numFragmentStages(); |
206 this->emitAndInstallFragProcs(0, this->pipeline().numColorStages(), inputCol
or); | 206 this->emitAndInstallFragProcs(0, this->pipeline().numColorFragmentStages(),
inputColor); |
207 this->emitAndInstallFragProcs(this->pipeline().numColorStages(), numProcs,
inputCoverage); | 207 this->emitAndInstallFragProcs(this->pipeline().numColorFragmentStages(), num
Procs, |
| 208 inputCoverage); |
208 this->emitAndInstallXferProc(*this->pipeline().getXferProcessor(), *inputCol
or, *inputCoverage); | 209 this->emitAndInstallXferProc(*this->pipeline().getXferProcessor(), *inputCol
or, *inputCoverage); |
209 } | 210 } |
210 | 211 |
211 void GrGLProgramBuilder::emitAndInstallFragProcs(int procOffset, | 212 void GrGLProgramBuilder::emitAndInstallFragProcs(int procOffset, |
212 int numProcs, | 213 int numProcs, |
213 GrGLSLExpr4* inOut) { | 214 GrGLSLExpr4* inOut) { |
214 for (int e = procOffset; e < numProcs; ++e) { | 215 for (int e = procOffset; e < numProcs; ++e) { |
215 GrGLSLExpr4 output; | 216 GrGLSLExpr4 output; |
216 const GrPendingFragmentStage& stage = this->pipeline().getFragmentStage(
e); | 217 const GrPendingFragmentStage& stage = this->pipeline().getFragmentStage(
e); |
217 this->emitAndInstallProc(stage, e, *inOut, &output); | 218 this->emitAndInstallProc(stage, e, *inOut, &output); |
(...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
492 } | 493 } |
493 | 494 |
494 ////////////////////////////////////////////////////////////////////////////////
/////////////////// | 495 ////////////////////////////////////////////////////////////////////////////////
/////////////////// |
495 | 496 |
496 GrGLInstalledFragProcs::~GrGLInstalledFragProcs() { | 497 GrGLInstalledFragProcs::~GrGLInstalledFragProcs() { |
497 int numProcs = fProcs.count(); | 498 int numProcs = fProcs.count(); |
498 for (int e = 0; e < numProcs; ++e) { | 499 for (int e = 0; e < numProcs; ++e) { |
499 SkDELETE(fProcs[e]); | 500 SkDELETE(fProcs[e]); |
500 } | 501 } |
501 } | 502 } |
OLD | NEW |