From 5559ca2a18687ef16b2fc92d8fcacbc1c3e93d54 Mon Sep 17 00:00:00 2001 From: joshualitt Date: Thu, 21 May 2015 15:50:36 -0700 Subject: [PATCH] Remove uniform view matrix from GrGLPrimitiveProcessor base class BUG=skia: Review URL: https://codereview.chromium.org/1151693005 --- src/gpu/GrDefaultGeoProcFactory.cpp | 15 ++++-- src/gpu/GrOvalRenderer.cpp | 15 ++++-- src/gpu/effects/GrBezierEffect.cpp | 43 ++++++++++++---- src/gpu/effects/GrDistanceFieldGeoProc.cpp | 59 ++++++++++++++++------ src/gpu/gl/GrGLGeometryProcessor.cpp | 37 +++++++++----- src/gpu/gl/GrGLGeometryProcessor.h | 7 ++- src/gpu/gl/GrGLPrimitiveProcessor.cpp | 19 ------- src/gpu/gl/GrGLPrimitiveProcessor.h | 18 ------- 8 files changed, 128 insertions(+), 85 deletions(-) diff --git a/src/gpu/GrDefaultGeoProcFactory.cpp b/src/gpu/GrDefaultGeoProcFactory.cpp index 6e2ea060df..a72c88052c 100644 --- a/src/gpu/GrDefaultGeoProcFactory.cpp +++ b/src/gpu/GrDefaultGeoProcFactory.cpp @@ -55,7 +55,7 @@ public: class GLProcessor : public GrGLGeometryProcessor { public: GLProcessor(const GrGeometryProcessor& gp, const GrBatchTracker&) - : fColor(GrColor_ILLEGAL), fCoverage(0xff) {} + : fViewMatrix(SkMatrix::InvalidMatrix()), fColor(GrColor_ILLEGAL), fCoverage(0xff) {} void onEmitCode(EmitArgs& args, GrGPArgs* gpArgs) override { const DefaultGeoProc& gp = args.fGP.cast(); @@ -76,7 +76,8 @@ public: } // Setup position - this->setupPosition(pb, gpArgs, gp.inPosition()->fName, gp.viewMatrix()); + this->setupPosition(pb, gpArgs, gp.inPosition()->fName, gp.viewMatrix(), + &fViewMatrixUniform); if (gp.inLocalCoords()) { // emit transforms with explicit local coords @@ -128,7 +129,13 @@ public: const GrPrimitiveProcessor& gp, const GrBatchTracker& bt) override { const DefaultGeoProc& dgp = gp.cast(); - this->setUniformViewMatrix(pdman, dgp.viewMatrix()); + + if (!dgp.viewMatrix().isIdentity() && !fViewMatrix.cheapEqualTo(dgp.viewMatrix())) { + fViewMatrix = dgp.viewMatrix(); + GrGLfloat viewMatrix[3 * 3]; + GrGLGetMatrix<3>(viewMatrix, fViewMatrix); + pdman.setMatrix3f(fViewMatrixUniform, viewMatrix); + } if (dgp.color() != fColor && !dgp.hasVertexColor()) { GrGLfloat c[4]; @@ -151,8 +158,10 @@ public: } private: + SkMatrix fViewMatrix; GrColor fColor; uint8_t fCoverage; + UniformHandle fViewMatrixUniform; UniformHandle fColorUniform; UniformHandle fCoverageUniform; diff --git a/src/gpu/GrOvalRenderer.cpp b/src/gpu/GrOvalRenderer.cpp index 5c231bdeae..112c344913 100644 --- a/src/gpu/GrOvalRenderer.cpp +++ b/src/gpu/GrOvalRenderer.cpp @@ -434,7 +434,7 @@ public: public: GLProcessor(const GrGeometryProcessor&, const GrBatchTracker&) - : fColor(GrColor_ILLEGAL) {} + : fViewMatrix(SkMatrix::InvalidMatrix()), fColor(GrColor_ILLEGAL) {} void onEmitCode(EmitArgs& args, GrGPArgs* gpArgs) override{ const DIEllipseEdgeEffect& ee = args.fGP.cast(); @@ -460,7 +460,8 @@ public: } // Setup position - this->setupPosition(pb, gpArgs, ee.inPosition()->fName, ee.viewMatrix()); + this->setupPosition(pb, gpArgs, ee.inPosition()->fName, ee.viewMatrix(), + &fViewMatrixUniform); // emit transforms this->emitTransforms(args.fPB, gpArgs->fPositionVar, ee.inPosition()->fName, @@ -522,7 +523,13 @@ public: const GrPrimitiveProcessor& gp, const GrBatchTracker& bt) override { const DIEllipseEdgeEffect& dee = gp.cast(); - this->setUniformViewMatrix(pdman, dee.viewMatrix()); + + if (!dee.viewMatrix().isIdentity() && !fViewMatrix.cheapEqualTo(dee.viewMatrix())) { + fViewMatrix = dee.viewMatrix(); + GrGLfloat viewMatrix[3 * 3]; + GrGLGetMatrix<3>(viewMatrix, fViewMatrix); + pdman.setMatrix3f(fViewMatrixUniform, viewMatrix); + } if (dee.color() != fColor) { GrGLfloat c[4]; @@ -533,8 +540,10 @@ public: } private: + SkMatrix fViewMatrix; GrColor fColor; UniformHandle fColorUniform; + UniformHandle fViewMatrixUniform; typedef GrGLGeometryProcessor INHERITED; }; diff --git a/src/gpu/effects/GrBezierEffect.cpp b/src/gpu/effects/GrBezierEffect.cpp index 840645e5c0..078bc00306 100644 --- a/src/gpu/effects/GrBezierEffect.cpp +++ b/src/gpu/effects/GrBezierEffect.cpp @@ -28,7 +28,13 @@ public: const GrPrimitiveProcessor& primProc, const GrBatchTracker& bt) override { const GrConicEffect& ce = primProc.cast(); - this->setUniformViewMatrix(pdman, ce.viewMatrix()); + + if (!ce.viewMatrix().isIdentity() && !fViewMatrix.cheapEqualTo(ce.viewMatrix())) { + fViewMatrix = ce.viewMatrix(); + GrGLfloat viewMatrix[3 * 3]; + GrGLGetMatrix<3>(viewMatrix, fViewMatrix); + pdman.setMatrix3f(fViewMatrixUniform, viewMatrix); + } if (ce.color() != fColor) { GrGLfloat c[4]; @@ -51,18 +57,20 @@ public: } private: + SkMatrix fViewMatrix; GrColor fColor; uint8_t fCoverageScale; GrPrimitiveEdgeType fEdgeType; UniformHandle fColorUniform; UniformHandle fCoverageScaleUniform; + UniformHandle fViewMatrixUniform; typedef GrGLGeometryProcessor INHERITED; }; GrGLConicEffect::GrGLConicEffect(const GrGeometryProcessor& processor, const GrBatchTracker& bt) - : fColor(GrColor_ILLEGAL), fCoverageScale(0xff) { + : fViewMatrix(SkMatrix::InvalidMatrix()), fColor(GrColor_ILLEGAL), fCoverageScale(0xff) { const GrConicEffect& ce = processor.cast(); fEdgeType = ce.getEdgeType(); } @@ -85,7 +93,7 @@ void GrGLConicEffect::onEmitCode(EmitArgs& args, GrGPArgs* gpArgs) { } // Setup position - this->setupPosition(pb, gpArgs, gp.inPosition()->fName, gp.viewMatrix()); + this->setupPosition(pb, gpArgs, gp.inPosition()->fName, gp.viewMatrix(), &fViewMatrixUniform); // emit transforms with position this->emitTransforms(pb, gpArgs->fPositionVar, gp.inPosition()->fName, gp.localMatrix(), @@ -245,7 +253,13 @@ public: const GrPrimitiveProcessor& primProc, const GrBatchTracker& bt) override { const GrQuadEffect& qe = primProc.cast(); - this->setUniformViewMatrix(pdman, qe.viewMatrix()); + + if (!qe.viewMatrix().isIdentity() && !fViewMatrix.cheapEqualTo(qe.viewMatrix())) { + fViewMatrix = qe.viewMatrix(); + GrGLfloat viewMatrix[3 * 3]; + GrGLGetMatrix<3>(viewMatrix, fViewMatrix); + pdman.setMatrix3f(fViewMatrixUniform, viewMatrix); + } if (qe.color() != fColor) { GrGLfloat c[4]; @@ -268,18 +282,20 @@ public: } private: + SkMatrix fViewMatrix; GrColor fColor; uint8_t fCoverageScale; GrPrimitiveEdgeType fEdgeType; UniformHandle fColorUniform; UniformHandle fCoverageScaleUniform; + UniformHandle fViewMatrixUniform; typedef GrGLGeometryProcessor INHERITED; }; GrGLQuadEffect::GrGLQuadEffect(const GrGeometryProcessor& processor, const GrBatchTracker& bt) - : fColor(GrColor_ILLEGAL), fCoverageScale(0xff) { + : fViewMatrix(SkMatrix::InvalidMatrix()), fColor(GrColor_ILLEGAL), fCoverageScale(0xff) { const GrQuadEffect& ce = processor.cast(); fEdgeType = ce.getEdgeType(); } @@ -302,7 +318,7 @@ void GrGLQuadEffect::onEmitCode(EmitArgs& args, GrGPArgs* gpArgs) { } // Setup position - this->setupPosition(pb, gpArgs, gp.inPosition()->fName, gp.viewMatrix()); + this->setupPosition(pb, gpArgs, gp.inPosition()->fName, gp.viewMatrix(), &fViewMatrixUniform); // emit transforms with position this->emitTransforms(pb, gpArgs->fPositionVar, gp.inPosition()->fName, gp.localMatrix(), @@ -449,7 +465,13 @@ public: const GrPrimitiveProcessor& primProc, const GrBatchTracker& bt) override { const GrCubicEffect& ce = primProc.cast(); - this->setUniformViewMatrix(pdman, ce.viewMatrix()); + + if (!ce.viewMatrix().isIdentity() && !fViewMatrix.cheapEqualTo(ce.viewMatrix())) { + fViewMatrix = ce.viewMatrix(); + GrGLfloat viewMatrix[3 * 3]; + GrGLGetMatrix<3>(viewMatrix, fViewMatrix); + pdman.setMatrix3f(fViewMatrixUniform, viewMatrix); + } if (ce.color() != fColor) { GrGLfloat c[4]; @@ -460,16 +482,18 @@ public: } private: + SkMatrix fViewMatrix; GrColor fColor; GrPrimitiveEdgeType fEdgeType; UniformHandle fColorUniform; + UniformHandle fViewMatrixUniform; typedef GrGLGeometryProcessor INHERITED; }; GrGLCubicEffect::GrGLCubicEffect(const GrGeometryProcessor& processor, const GrBatchTracker&) - : fColor(GrColor_ILLEGAL) { + : fViewMatrix(SkMatrix::InvalidMatrix()), fColor(GrColor_ILLEGAL) { const GrCubicEffect& ce = processor.cast(); fEdgeType = ce.getEdgeType(); } @@ -491,7 +515,8 @@ void GrGLCubicEffect::onEmitCode(EmitArgs& args, GrGPArgs* gpArgs) { } // Setup position - this->setupPosition(args.fPB, gpArgs, gp.inPosition()->fName, gp.viewMatrix()); + this->setupPosition(args.fPB, gpArgs, gp.inPosition()->fName, gp.viewMatrix(), + &fViewMatrixUniform); // emit transforms with position this->emitTransforms(args.fPB, gpArgs->fPositionVar, gp.inPosition()->fName, args.fTransformsIn, diff --git a/src/gpu/effects/GrDistanceFieldGeoProc.cpp b/src/gpu/effects/GrDistanceFieldGeoProc.cpp index 92fe0a4ab7..2bb929b6a1 100755 --- a/src/gpu/effects/GrDistanceFieldGeoProc.cpp +++ b/src/gpu/effects/GrDistanceFieldGeoProc.cpp @@ -25,7 +25,8 @@ class GrGLDistanceFieldA8TextGeoProc : public GrGLGeometryProcessor { public: GrGLDistanceFieldA8TextGeoProc(const GrGeometryProcessor&, const GrBatchTracker&) - : fColor(GrColor_ILLEGAL) + : fViewMatrix(SkMatrix::InvalidMatrix()) + , fColor(GrColor_ILLEGAL) #ifdef SK_GAMMA_APPLY_TO_A8 , fDistanceAdjust(-1.0f) #endif @@ -63,7 +64,8 @@ public: } // Setup position - this->setupPosition(pb, gpArgs, dfTexEffect.inPosition()->fName, dfTexEffect.viewMatrix()); + this->setupPosition(pb, gpArgs, dfTexEffect.inPosition()->fName, dfTexEffect.viewMatrix(), + &fViewMatrixUniform); // emit transforms this->emitTransforms(args.fPB, gpArgs->fPositionVar, dfTexEffect.inPosition()->fName, @@ -148,9 +150,14 @@ public: fDistanceAdjust = distanceAdjust; } #endif - const GrDistanceFieldA8TextGeoProc& dfa8gp = proc.cast(); - this->setUniformViewMatrix(pdman, dfa8gp.viewMatrix()); + + if (!dfa8gp.viewMatrix().isIdentity() && !fViewMatrix.cheapEqualTo(dfa8gp.viewMatrix())) { + fViewMatrix = dfa8gp.viewMatrix(); + GrGLfloat viewMatrix[3 * 3]; + GrGLGetMatrix<3>(viewMatrix, fViewMatrix); + pdman.setMatrix3f(fViewMatrixUniform, viewMatrix); + } if (dfa8gp.color() != fColor && !dfa8gp.hasVertexColor()) { GrGLfloat c[4]; @@ -173,8 +180,10 @@ public: } private: + SkMatrix fViewMatrix; GrColor fColor; UniformHandle fColorUniform; + UniformHandle fViewMatrixUniform; #ifdef SK_GAMMA_APPLY_TO_A8 float fDistanceAdjust; UniformHandle fDistanceAdjustUni; @@ -266,7 +275,9 @@ class GrGLDistanceFieldPathGeoProc : public GrGLGeometryProcessor { public: GrGLDistanceFieldPathGeoProc(const GrGeometryProcessor&, const GrBatchTracker&) - : fColor(GrColor_ILLEGAL), fTextureSize(SkISize::Make(-1, -1)) {} + : fViewMatrix(SkMatrix::InvalidMatrix()) + , fColor(GrColor_ILLEGAL) + , fTextureSize(SkISize::Make(-1, -1)) {} void onEmitCode(EmitArgs& args, GrGPArgs* gpArgs) override{ const GrDistanceFieldPathGeoProc& dfTexEffect = args.fGP.cast(); @@ -295,7 +306,8 @@ public: vsBuilder->codeAppendf("%s = %s;", v.vsOut(), dfTexEffect.inTextureCoords()->fName); // Setup position - this->setupPosition(pb, gpArgs, dfTexEffect.inPosition()->fName, dfTexEffect.viewMatrix()); + this->setupPosition(pb, gpArgs, dfTexEffect.inPosition()->fName, dfTexEffect.viewMatrix(), + &fViewMatrixUniform); // emit transforms this->emitTransforms(args.fPB, gpArgs->fPositionVar, dfTexEffect.inPosition()->fName, @@ -372,7 +384,13 @@ public: } const GrDistanceFieldPathGeoProc& dfpgp = proc.cast(); - this->setUniformViewMatrix(pdman, dfpgp.viewMatrix()); + + if (!dfpgp.viewMatrix().isIdentity() && !fViewMatrix.cheapEqualTo(dfpgp.viewMatrix())) { + fViewMatrix = dfpgp.viewMatrix(); + GrGLfloat viewMatrix[3 * 3]; + GrGLGetMatrix<3>(viewMatrix, fViewMatrix); + pdman.setMatrix3f(fViewMatrixUniform, viewMatrix); + } if (dfpgp.color() != fColor) { GrGLfloat c[4]; @@ -398,6 +416,8 @@ public: private: UniformHandle fColorUniform; UniformHandle fTextureSizeUni; + UniformHandle fViewMatrixUniform; + SkMatrix fViewMatrix; GrColor fColor; SkISize fTextureSize; @@ -478,7 +498,7 @@ GrGeometryProcessor* GrDistanceFieldPathGeoProc::TestCreate(SkRandom* random, class GrGLDistanceFieldLCDTextGeoProc : public GrGLGeometryProcessor { public: GrGLDistanceFieldLCDTextGeoProc(const GrGeometryProcessor&, const GrBatchTracker&) - : fColor(GrColor_ILLEGAL) { + : fViewMatrix(SkMatrix::InvalidMatrix()), fColor(GrColor_ILLEGAL) { fDistanceAdjust = GrDistanceFieldLCDTextGeoProc::DistanceAdjust::Make(1.0f, 1.0f, 1.0f); } @@ -498,7 +518,8 @@ public: } // Setup position - this->setupPosition(pb, gpArgs, dfTexEffect.inPosition()->fName, dfTexEffect.viewMatrix()); + this->setupPosition(pb, gpArgs, dfTexEffect.inPosition()->fName, dfTexEffect.viewMatrix(), + &fViewMatrixUniform); // emit transforms this->emitTransforms(args.fPB, gpArgs->fPositionVar, dfTexEffect.inPosition()->fName, @@ -619,9 +640,8 @@ public: const GrBatchTracker& bt) override { SkASSERT(fDistanceAdjustUni.isValid()); - const GrDistanceFieldLCDTextGeoProc& dfTexEffect = - processor.cast(); - GrDistanceFieldLCDTextGeoProc::DistanceAdjust wa = dfTexEffect.getDistanceAdjust(); + const GrDistanceFieldLCDTextGeoProc& dflcd = processor.cast(); + GrDistanceFieldLCDTextGeoProc::DistanceAdjust wa = dflcd.getDistanceAdjust(); if (wa != fDistanceAdjust) { pdman.set3f(fDistanceAdjustUni, wa.fR, @@ -630,13 +650,18 @@ public: fDistanceAdjust = wa; } - this->setUniformViewMatrix(pdman, dfTexEffect.viewMatrix()); + if (!dflcd.viewMatrix().isIdentity() && !fViewMatrix.cheapEqualTo(dflcd.viewMatrix())) { + fViewMatrix = dflcd.viewMatrix(); + GrGLfloat viewMatrix[3 * 3]; + GrGLGetMatrix<3>(viewMatrix, fViewMatrix); + pdman.setMatrix3f(fViewMatrixUniform, viewMatrix); + } - if (dfTexEffect.color() != fColor) { + if (dflcd.color() != fColor) { GrGLfloat c[4]; - GrColorToRGBAFloat(dfTexEffect.color(), c); + GrColorToRGBAFloat(dflcd.color(), c); pdman.set4fv(fColorUniform, 1, c); - fColor = dfTexEffect.color(); + fColor = dflcd.color(); } } @@ -653,7 +678,9 @@ public: } private: + SkMatrix fViewMatrix; GrColor fColor; + UniformHandle fViewMatrixUniform; UniformHandle fColorUniform; GrDistanceFieldLCDTextGeoProc::DistanceAdjust fDistanceAdjust; UniformHandle fDistanceAdjustUni; diff --git a/src/gpu/gl/GrGLGeometryProcessor.cpp b/src/gpu/gl/GrGLGeometryProcessor.cpp index 60c00432ce..dc4518f978 100644 --- a/src/gpu/gl/GrGLGeometryProcessor.cpp +++ b/src/gpu/gl/GrGLGeometryProcessor.cpp @@ -89,26 +89,37 @@ void GrGLGeometryProcessor::emitTransforms(GrGLGPBuilder* pb, } } +void GrGLGeometryProcessor::setupPosition(GrGLGPBuilder* pb, + GrGPArgs* gpArgs, + const char* posName) { + GrGLVertexBuilder* vsBuilder = pb->getVertexShaderBuilder(); + gpArgs->fPositionVar.set(kVec2f_GrSLType, "pos2"); + vsBuilder->codeAppendf("vec2 %s = %s;", gpArgs->fPositionVar.c_str(), posName); +} + void GrGLGeometryProcessor::setupPosition(GrGLGPBuilder* pb, GrGPArgs* gpArgs, const char* posName, - const SkMatrix& mat) { + const SkMatrix& mat, + UniformHandle* viewMatrixUniform) { GrGLVertexBuilder* vsBuilder = pb->getVertexShaderBuilder(); if (mat.isIdentity()) { gpArgs->fPositionVar.set(kVec2f_GrSLType, "pos2"); - vsBuilder->codeAppendf("vec2 %s = %s;", gpArgs->fPositionVar.c_str(), posName); - } else if (!mat.hasPerspective()) { - this->addUniformViewMatrix(pb); - gpArgs->fPositionVar.set(kVec2f_GrSLType, "pos2"); - - vsBuilder->codeAppendf("vec2 %s = vec2(%s * vec3(%s, 1));", - gpArgs->fPositionVar.c_str(), this->uViewM(), posName); } else { - this->addUniformViewMatrix(pb); - gpArgs->fPositionVar.set(kVec3f_GrSLType, "pos3"); - - vsBuilder->codeAppendf("vec3 %s = %s * vec3(%s, 1);", - gpArgs->fPositionVar.c_str(), this->uViewM(), posName); + const char* viewMatrixName; + *viewMatrixUniform = pb->addUniform(GrGLProgramBuilder::kVertex_Visibility, + kMat33f_GrSLType, kHigh_GrSLPrecision, + "uViewM", + &viewMatrixName); + if (!mat.hasPerspective()) { + gpArgs->fPositionVar.set(kVec2f_GrSLType, "pos2"); + vsBuilder->codeAppendf("vec2 %s = vec2(%s * vec3(%s, 1));", + gpArgs->fPositionVar.c_str(), viewMatrixName, posName); + } else { + gpArgs->fPositionVar.set(kVec3f_GrSLType, "pos3"); + vsBuilder->codeAppendf("vec3 %s = %s * vec3(%s, 1);", + gpArgs->fPositionVar.c_str(), viewMatrixName, posName); + } } } diff --git a/src/gpu/gl/GrGLGeometryProcessor.h b/src/gpu/gl/GrGLGeometryProcessor.h index dfb2b90ab8..747d82ab48 100644 --- a/src/gpu/gl/GrGLGeometryProcessor.h +++ b/src/gpu/gl/GrGLGeometryProcessor.h @@ -64,10 +64,9 @@ protected: }; // Create the correct type of position variable given the CTM - void setupPosition(GrGLGPBuilder* pb, - GrGPArgs* gpArgs, - const char* posName, - const SkMatrix& mat = SkMatrix::I()); + void setupPosition(GrGLGPBuilder*, GrGPArgs*, const char* posName); + void setupPosition(GrGLGPBuilder*, GrGPArgs*, const char* posName, const SkMatrix& mat, + UniformHandle* viewMatrixUniform); static uint32_t ComputePosKey(const SkMatrix& mat) { if (mat.isIdentity()) { diff --git a/src/gpu/gl/GrGLPrimitiveProcessor.cpp b/src/gpu/gl/GrGLPrimitiveProcessor.cpp index 893e55609e..6dd112cbe9 100644 --- a/src/gpu/gl/GrGLPrimitiveProcessor.cpp +++ b/src/gpu/gl/GrGLPrimitiveProcessor.cpp @@ -44,22 +44,3 @@ void GrGLPrimitiveProcessor::setupUniformColor(GrGLGPBuilder* pb, &stagedLocalVarName); fs->codeAppendf("%s = %s;", outputName, stagedLocalVarName); } - -void GrGLPrimitiveProcessor::addUniformViewMatrix(GrGLGPBuilder* pb) { - fViewMatrixUniform = pb->addUniform(GrGLProgramBuilder::kVertex_Visibility, - kMat33f_GrSLType, kHigh_GrSLPrecision, - "uViewM", - &fViewMatrixName); -} - -void GrGLPrimitiveProcessor::setUniformViewMatrix(const GrGLProgramDataManager& pdman, - const SkMatrix& viewMatrix) { - if (!viewMatrix.isIdentity() && !fViewMatrix.cheapEqualTo(viewMatrix)) { - SkASSERT(fViewMatrixUniform.isValid()); - fViewMatrix = viewMatrix; - - GrGLfloat viewMatrix[3 * 3]; - GrGLGetMatrix<3>(viewMatrix, fViewMatrix); - pdman.setMatrix3f(fViewMatrixUniform, viewMatrix); - } -} diff --git a/src/gpu/gl/GrGLPrimitiveProcessor.h b/src/gpu/gl/GrGLPrimitiveProcessor.h index 90ee2038f8..7345eae35b 100644 --- a/src/gpu/gl/GrGLPrimitiveProcessor.h +++ b/src/gpu/gl/GrGLPrimitiveProcessor.h @@ -17,7 +17,6 @@ class GrGLGPBuilder; class GrGLPrimitiveProcessor { public: - GrGLPrimitiveProcessor() : fViewMatrixName(NULL) { fViewMatrix = SkMatrix::InvalidMatrix(); } virtual ~GrGLPrimitiveProcessor() {} typedef GrGLProgramDataManager::UniformHandle UniformHandle; @@ -76,18 +75,6 @@ public: protected: void setupUniformColor(GrGLGPBuilder* pb, const char* outputName, UniformHandle* colorUniform); - const char* uViewM() const { return fViewMatrixName; } - - /** a helper function to setup the uniform handle for the uniform view matrix */ - void addUniformViewMatrix(GrGLGPBuilder*); - - - /** a helper function to upload a uniform viewmatrix. - * TODO we can remove this function when we have deferred geometry in place - */ - void setUniformViewMatrix(const GrGLProgramDataManager&, - const SkMatrix& viewMatrix); - class ShaderVarHandle { public: bool isValid() const { return fHandle > -1; } @@ -111,11 +98,6 @@ protected: }; SkSTArray<8, SkSTArray<2, Transform, true> > fInstalledTransforms; - -private: - UniformHandle fViewMatrixUniform; - SkMatrix fViewMatrix; - const char* fViewMatrixName; }; #endif -- 2.34.1