diff options
author | joshualitt <joshualitt@chromium.org> | 2014-12-29 15:10:07 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2014-12-29 15:10:07 -0800 |
commit | 8059eb9f6e24ed609393fbda4ad71edea03ac258 (patch) | |
tree | c9a8e1881739206f49a5319bf1077a5900b42db1 /src/gpu/effects/GrBezierEffect.cpp | |
parent | 4f662e62cd44e302ef689fabdb2c0ae8d9471b02 (diff) |
Move ViewMatrix off of drawstate
BUG=skia:
Review URL: https://codereview.chromium.org/815553003
Diffstat (limited to 'src/gpu/effects/GrBezierEffect.cpp')
-rw-r--r-- | src/gpu/effects/GrBezierEffect.cpp | 31 |
1 files changed, 20 insertions, 11 deletions
diff --git a/src/gpu/effects/GrBezierEffect.cpp b/src/gpu/effects/GrBezierEffect.cpp index c90067d4a4..4ab088c6a8 100644 --- a/src/gpu/effects/GrBezierEffect.cpp +++ b/src/gpu/effects/GrBezierEffect.cpp @@ -183,9 +183,11 @@ GrGLGeometryProcessor* GrConicEffect::createGLInstance(const GrBatchTracker& bt) return SkNEW_ARGS(GrGLConicEffect, (*this, bt)); } -GrConicEffect::GrConicEffect(GrColor color, uint8_t coverage, GrPrimitiveEdgeType edgeType, - const SkMatrix& localMatrix) - : INHERITED(color, false, localMatrix), fCoverageScale(coverage), fEdgeType(edgeType) { +GrConicEffect::GrConicEffect(GrColor color, const SkMatrix& viewMatrix, uint8_t coverage, + GrPrimitiveEdgeType edgeType, const SkMatrix& localMatrix) + : INHERITED(color, viewMatrix, localMatrix) + , fCoverageScale(coverage) + , fEdgeType(edgeType) { this->initClassID<GrConicEffect>(); fInPosition = &this->addVertexAttrib(GrAttribute("inPosition", kVec2f_GrVertexAttribType)); fInConicCoeffs = &this->addVertexAttrib(GrAttribute("inConicCoeffs", @@ -228,7 +230,8 @@ GrGeometryProcessor* GrConicEffect::TestCreate(SkRandom* random, do { GrPrimitiveEdgeType edgeType = static_cast<GrPrimitiveEdgeType>( random->nextULessThan(kGrProcessorEdgeTypeCnt)); - gp = GrConicEffect::Create(GrRandomColor(random), edgeType, caps, + gp = GrConicEffect::Create(GrRandomColor(random), GrProcessorUnitTest::TestMatrix(random), + edgeType, caps, GrProcessorUnitTest::TestMatrix(random)); } while (NULL == gp); return gp; @@ -395,9 +398,11 @@ GrGLGeometryProcessor* GrQuadEffect::createGLInstance(const GrBatchTracker& bt) return SkNEW_ARGS(GrGLQuadEffect, (*this, bt)); } -GrQuadEffect::GrQuadEffect(GrColor color, uint8_t coverage, GrPrimitiveEdgeType edgeType, - const SkMatrix& localMatrix) - : INHERITED(color, false, localMatrix), fCoverageScale(coverage), fEdgeType(edgeType) { +GrQuadEffect::GrQuadEffect(GrColor color, const SkMatrix& viewMatrix, uint8_t coverage, + GrPrimitiveEdgeType edgeType, const SkMatrix& localMatrix) + : INHERITED(color, viewMatrix, localMatrix) + , fCoverageScale(coverage) + , fEdgeType(edgeType) { this->initClassID<GrQuadEffect>(); fInPosition = &this->addVertexAttrib(GrAttribute("inPosition", kVec2f_GrVertexAttribType)); fInHairQuadEdge = &this->addVertexAttrib(GrAttribute("inHairQuadEdge", @@ -440,7 +445,9 @@ GrGeometryProcessor* GrQuadEffect::TestCreate(SkRandom* random, do { GrPrimitiveEdgeType edgeType = static_cast<GrPrimitiveEdgeType>( random->nextULessThan(kGrProcessorEdgeTypeCnt)); - gp = GrQuadEffect::Create(GrRandomColor(random), edgeType, caps, + gp = GrQuadEffect::Create(GrRandomColor(random), + GrProcessorUnitTest::TestMatrix(random), + edgeType, caps, GrProcessorUnitTest::TestMatrix(random)); } while (NULL == gp); return gp; @@ -629,8 +636,9 @@ GrGLGeometryProcessor* GrCubicEffect::createGLInstance(const GrBatchTracker& bt) return SkNEW_ARGS(GrGLCubicEffect, (*this, bt)); } -GrCubicEffect::GrCubicEffect(GrColor color, GrPrimitiveEdgeType edgeType) - : INHERITED(color), fEdgeType(edgeType) { +GrCubicEffect::GrCubicEffect(GrColor color, const SkMatrix& viewMatrix, + GrPrimitiveEdgeType edgeType) + : INHERITED(color, viewMatrix), fEdgeType(edgeType) { this->initClassID<GrCubicEffect>(); fInPosition = &this->addVertexAttrib(GrAttribute("inPosition", kVec2f_GrVertexAttribType)); fInCubicCoeffs = &this->addVertexAttrib(GrAttribute("inCubicCoeffs", @@ -671,7 +679,8 @@ GrGeometryProcessor* GrCubicEffect::TestCreate(SkRandom* random, do { GrPrimitiveEdgeType edgeType = static_cast<GrPrimitiveEdgeType>( random->nextULessThan(kGrProcessorEdgeTypeCnt)); - gp = GrCubicEffect::Create(GrRandomColor(random), edgeType, caps); + gp = GrCubicEffect::Create(GrRandomColor(random), + GrProcessorUnitTest::TestMatrix(random), edgeType, caps); } while (NULL == gp); return gp; } |