| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2015 Google Inc. | 2 * Copyright 2015 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 "glsl/GrGLSLProgramBuilder.h" | 8 #include "glsl/GrGLSLProgramBuilder.h" |
| 9 | 9 |
| 10 #include "GrPipeline.h" | 10 #include "GrPipeline.h" |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 49 | 49 |
| 50 bool GrGLSLProgramBuilder::emitAndInstallProcs(GrGLSLExpr4* inputColor, | 50 bool GrGLSLProgramBuilder::emitAndInstallProcs(GrGLSLExpr4* inputColor, |
| 51 GrGLSLExpr4* inputCoverage) { | 51 GrGLSLExpr4* inputCoverage) { |
| 52 // First we loop over all of the installed processors and collect coord tran
sforms. These will | 52 // First we loop over all of the installed processors and collect coord tran
sforms. These will |
| 53 // be sent to the GrGLSLPrimitiveProcessor in its emitCode function | 53 // be sent to the GrGLSLPrimitiveProcessor in its emitCode function |
| 54 const GrPrimitiveProcessor& primProc = this->primitiveProcessor(); | 54 const GrPrimitiveProcessor& primProc = this->primitiveProcessor(); |
| 55 | 55 |
| 56 for (int i = 0; i < this->pipeline().numFragmentProcessors(); i++) { | 56 for (int i = 0; i < this->pipeline().numFragmentProcessors(); i++) { |
| 57 const GrFragmentProcessor& processor = this->pipeline().getFragmentProce
ssor(i); | 57 const GrFragmentProcessor& processor = this->pipeline().getFragmentProce
ssor(i); |
| 58 | 58 |
| 59 if (!primProc.hasTransformedLocalCoords()) { | 59 SkTArray<const GrCoordTransform*, true>& procCoords = fCoordTransforms.p
ush_back(); |
| 60 SkTArray<const GrCoordTransform*, true>& procCoords = fCoordTransfor
ms.push_back(); | 60 processor.gatherCoordTransforms(&procCoords); |
| 61 processor.gatherCoordTransforms(&procCoords); | |
| 62 } | |
| 63 } | 61 } |
| 64 | 62 |
| 65 this->emitAndInstallPrimProc(primProc, inputColor, inputCoverage); | 63 this->emitAndInstallPrimProc(primProc, inputColor, inputCoverage); |
| 66 | 64 |
| 67 int numProcs = this->pipeline().numFragmentProcessors(); | 65 int numProcs = this->pipeline().numFragmentProcessors(); |
| 68 this->emitAndInstallFragProcs(0, this->pipeline().numColorFragmentProcessors
(), inputColor); | 66 this->emitAndInstallFragProcs(0, this->pipeline().numColorFragmentProcessors
(), inputColor); |
| 69 this->emitAndInstallFragProcs(this->pipeline().numColorFragmentProcessors(),
numProcs, | 67 this->emitAndInstallFragProcs(this->pipeline().numColorFragmentProcessors(),
numProcs, |
| 70 inputCoverage); | 68 inputCoverage); |
| 71 if (primProc.getPixelLocalStorageState() != | 69 if (primProc.getPixelLocalStorageState() != |
| 72 GrPixelLocalStorageState::kDraw_GrPixelLocalStorageState) { | 70 GrPixelLocalStorageState::kDraw_GrPixelLocalStorageState) { |
| (...skipping 342 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 415 delete fFragmentProcessors[i]; | 413 delete fFragmentProcessors[i]; |
| 416 } | 414 } |
| 417 } | 415 } |
| 418 | 416 |
| 419 void GrGLSLProgramBuilder::finalizeShaders() { | 417 void GrGLSLProgramBuilder::finalizeShaders() { |
| 420 this->varyingHandler()->finalize(); | 418 this->varyingHandler()->finalize(); |
| 421 fVS.finalize(kVertex_GrShaderFlag); | 419 fVS.finalize(kVertex_GrShaderFlag); |
| 422 fFS.finalize(kFragment_GrShaderFlag); | 420 fFS.finalize(kFragment_GrShaderFlag); |
| 423 | 421 |
| 424 } | 422 } |
| OLD | NEW |