| 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 "GrGLNvprProgramBuilder.h" | 8 #include "GrGLNvprProgramBuilder.h" |
| 9 #include "../GrGpuGL.h" | 9 #include "../GrGpuGL.h" |
| 10 | 10 |
| 11 #define GL_CALL(X) GR_GL_CALL(this->gpu()->glInterface(), X) | 11 #define GL_CALL(X) GR_GL_CALL(this->gpu()->glInterface(), X) |
| 12 #define GL_CALL_RET(R, X) GR_GL_CALL_RET(this->gpu()->glInterface(), R, X) | 12 #define GL_CALL_RET(R, X) GR_GL_CALL_RET(this->gpu()->glInterface(), R, X) |
| 13 | 13 |
| 14 GrGLNvprProgramBuilder::GrGLNvprProgramBuilder(GrGpuGL* gpu, | 14 GrGLNvprProgramBuilder::GrGLNvprProgramBuilder(GrGpuGL* gpu, |
| 15 const GrOptDrawState& optState, | 15 const GrOptDrawState& optState, |
| 16 const GrGLProgramDesc& desc) | 16 const GrGLProgramDesc& desc) |
| 17 : INHERITED(gpu, optState, desc) | 17 : INHERITED(gpu, optState, desc) |
| 18 , fSeparableVaryingInfos(kVarsPerBlock) { | 18 , fSeparableVaryingInfos(kVarsPerBlock) { |
| 19 } | 19 } |
| 20 | 20 |
| 21 void GrGLNvprProgramBuilder::emitTransforms(const GrProcessorStage& processorSta
ge, | 21 void GrGLNvprProgramBuilder::emitTransforms(const GrFragmentStage& processorStag
e, |
| 22 GrGLProcessor::TransformedCoordsArra
y* outCoords, | 22 GrGLProcessor::TransformedCoordsArra
y* outCoords, |
| 23 GrGLInstalledProcessors* installedPr
ocessors) { | 23 GrGLInstalledProcessors* installedPr
ocessors) { |
| 24 const GrProcessor* effect = processorStage.getProcessor(); | 24 const GrFragmentProcessor* effect = processorStage.getProcessor(); |
| 25 int numTransforms = effect->numTransforms(); | 25 int numTransforms = effect->numTransforms(); |
| 26 | 26 |
| 27 SkTArray<GrGLInstalledProcessors::Transform, true>& transforms = | 27 SkTArray<GrGLInstalledProcessors::Transform, true>& transforms = |
| 28 installedProcessors->addTransforms(); | 28 installedProcessors->addTransforms(); |
| 29 transforms.push_back_n(numTransforms); | 29 transforms.push_back_n(numTransforms); |
| 30 | 30 |
| 31 for (int t = 0; t < numTransforms; t++) { | 31 for (int t = 0; t < numTransforms; t++) { |
| 32 GrSLType varyingType = | 32 GrSLType varyingType = |
| 33 processorStage.isPerspectiveCoordTransform(t, false) ? | 33 processorStage.isPerspectiveCoordTransform(t, false) ? |
| 34 kVec3f_GrSLType : | 34 kVec3f_GrSLType : |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 75 } | 75 } |
| 76 } | 76 } |
| 77 | 77 |
| 78 GrGLProgram* GrGLNvprProgramBuilder::createProgram(GrGLuint programID) { | 78 GrGLProgram* GrGLNvprProgramBuilder::createProgram(GrGLuint programID) { |
| 79 // this is just for nvpr es, which has separable varyings that are plugged i
n after | 79 // this is just for nvpr es, which has separable varyings that are plugged i
n after |
| 80 // building | 80 // building |
| 81 this->resolveSeparableVaryings(programID); | 81 this->resolveSeparableVaryings(programID); |
| 82 return SkNEW_ARGS(GrGLNvprProgram, (fGpu, fDesc, fUniformHandles, programID,
fUniforms, | 82 return SkNEW_ARGS(GrGLNvprProgram, (fGpu, fDesc, fUniformHandles, programID,
fUniforms, |
| 83 fColorEffects, fCoverageEffects, fSepara
bleVaryingInfos)); | 83 fColorEffects, fCoverageEffects, fSepara
bleVaryingInfos)); |
| 84 } | 84 } |
| OLD | NEW |