diff options
author | joshualitt <joshualitt@chromium.org> | 2014-12-29 09:04:40 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2014-12-29 09:04:40 -0800 |
commit | 40d4bd8dafe9ed844f29a3de3d8965672248ee73 (patch) | |
tree | 44045b2daa070790e500d956fa00510370e7464a /src/gpu/gl/builders | |
parent | d27f73ef27ff65a6a0a5d00aa8e5b784b1a0b47e (diff) |
removing coord change matrices
BUG=skia:
Review URL: https://codereview.chromium.org/821243003
Diffstat (limited to 'src/gpu/gl/builders')
-rw-r--r-- | src/gpu/gl/builders/GrGLLegacyNvprProgramBuilder.cpp | 2 | ||||
-rw-r--r-- | src/gpu/gl/builders/GrGLNvprProgramBuilder.cpp | 2 | ||||
-rw-r--r-- | src/gpu/gl/builders/GrGLProgramBuilder.cpp | 20 |
3 files changed, 9 insertions, 15 deletions
diff --git a/src/gpu/gl/builders/GrGLLegacyNvprProgramBuilder.cpp b/src/gpu/gl/builders/GrGLLegacyNvprProgramBuilder.cpp index f7600f50cc..e8b4075b03 100644 --- a/src/gpu/gl/builders/GrGLLegacyNvprProgramBuilder.cpp +++ b/src/gpu/gl/builders/GrGLLegacyNvprProgramBuilder.cpp @@ -24,7 +24,7 @@ int GrGLLegacyNvprProgramBuilder::addTexCoordSets(int count) { void GrGLLegacyNvprProgramBuilder::emitTransforms(const GrPendingFragmentStage& processorStage, GrGLProcessor::TransformedCoordsArray* outCoords, GrGLInstalledFragProc* ifp) { - int numTransforms = processorStage.getProcessor()->numTransforms(); + int numTransforms = processorStage.processor()->numTransforms(); int texCoordIndex = this->addTexCoordSets(numTransforms); // Use the first uniform location as the texcoord index. This may seem a bit hacky but it diff --git a/src/gpu/gl/builders/GrGLNvprProgramBuilder.cpp b/src/gpu/gl/builders/GrGLNvprProgramBuilder.cpp index c45a911a06..e50037d098 100644 --- a/src/gpu/gl/builders/GrGLNvprProgramBuilder.cpp +++ b/src/gpu/gl/builders/GrGLNvprProgramBuilder.cpp @@ -20,7 +20,7 @@ GrGLNvprProgramBuilder::GrGLNvprProgramBuilder(GrGLGpu* gpu, void GrGLNvprProgramBuilder::emitTransforms(const GrPendingFragmentStage& processorStage, GrGLProcessor::TransformedCoordsArray* outCoords, GrGLInstalledFragProc* ifp) { - const GrFragmentProcessor* effect = processorStage.getProcessor(); + const GrFragmentProcessor* effect = processorStage.processor(); int numTransforms = effect->numTransforms(); ifp->fTransforms.push_back_n(numTransforms); diff --git a/src/gpu/gl/builders/GrGLProgramBuilder.cpp b/src/gpu/gl/builders/GrGLProgramBuilder.cpp index 13a14534cf..c414aba9ff 100644 --- a/src/gpu/gl/builders/GrGLProgramBuilder.cpp +++ b/src/gpu/gl/builders/GrGLProgramBuilder.cpp @@ -277,7 +277,7 @@ void GrGLProgramBuilder::emitAndInstallProc(const GrPendingFragmentStage& fs, const char* inColor) { GrGLInstalledFragProc* ifp = SkNEW(GrGLInstalledFragProc); - const GrFragmentProcessor& fp = *fs.getProcessor(); + const GrFragmentProcessor& fp = *fs.processor(); ifp->fGLProc.reset(fp.createGLInstance()); SkSTArray<4, GrGLProcessor::TextureSampler> samplers(fp.numTextures()); @@ -372,7 +372,7 @@ void GrGLProgramBuilder::verify(const GrFragmentProcessor& fp) { void GrGLProgramBuilder::emitTransforms(const GrPendingFragmentStage& stage, GrGLProcessor::TransformedCoordsArray* outCoords, GrGLInstalledFragProc* ifp) { - const GrFragmentProcessor* processor = stage.getProcessor(); + const GrFragmentProcessor* processor = stage.processor(); int numTransforms = processor->numTransforms(); ifp->fTransforms.push_back_n(numTransforms); @@ -380,20 +380,14 @@ void GrGLProgramBuilder::emitTransforms(const GrPendingFragmentStage& stage, const char* uniName = "StageMatrix"; GrSLType varyingType; - // TODO when we have deleted the coord change matrices we can get rid of the below check GrCoordSet coordType = processor->coordTransform(t).sourceCoords(); const SkMatrix& localMatrix = fOptState.getPrimitiveProcessor()->localMatrix(); - if (localMatrix.isIdentity()) { - varyingType = stage.isPerspectiveCoordTransform(t) ? kVec3f_GrSLType : - kVec2f_GrSLType; - } else { - uint32_t type = processor->coordTransform(t).getMatrix().getType(); - if (kLocal_GrCoordSet == coordType) { - type |= localMatrix.getType(); - } - varyingType = SkToBool(SkMatrix::kPerspective_Mask & type) ? kVec3f_GrSLType : - kVec2f_GrSLType; + uint32_t type = processor->coordTransform(t).getMatrix().getType(); + if (kLocal_GrCoordSet == coordType) { + type |= localMatrix.getType(); } + varyingType = SkToBool(SkMatrix::kPerspective_Mask & type) ? kVec3f_GrSLType : + kVec2f_GrSLType; GrSLPrecision precision = processor->coordTransform(t).precision(); SkString suffixedUniName; |