Index: src/gpu/GrAAConvexPathRenderer.cpp |
diff --git a/src/gpu/GrAAConvexPathRenderer.cpp b/src/gpu/GrAAConvexPathRenderer.cpp |
index 0024d3b83d9ccbb31b532e0df8c2c4a98074abd8..344b11921cd161023ba30cd896db00be9ff9a8c7 100644 |
--- a/src/gpu/GrAAConvexPathRenderer.cpp |
+++ b/src/gpu/GrAAConvexPathRenderer.cpp |
@@ -718,24 +718,16 @@ |
} |
static const GrGeometryProcessor* create_fill_gp(bool tweakAlphaForCoverage, |
- const SkMatrix& viewMatrix, |
+ const SkMatrix& localMatrix, |
bool usesLocalCoords, |
bool coverageIgnored) { |
- using namespace GrDefaultGeoProcFactory; |
- |
- Color color(Color::kAttribute_Type); |
- Coverage::Type coverageType; |
- if (coverageIgnored) { |
- coverageType = Coverage::kNone_Type; |
- } else if (tweakAlphaForCoverage) { |
- coverageType = Coverage::kSolid_Type; |
- } else { |
- coverageType = Coverage::kAttribute_Type; |
- } |
- Coverage coverage(coverageType); |
- LocalCoords localCoords(usesLocalCoords ? LocalCoords::kUsePosition_Type : |
- LocalCoords::kUnused_Type); |
- return CreateForDeviceSpace(color, coverage, localCoords, viewMatrix); |
+ uint32_t flags = GrDefaultGeoProcFactory::kColor_GPType; |
+ if (!tweakAlphaForCoverage) { |
+ flags |= GrDefaultGeoProcFactory::kCoverage_GPType; |
+ } |
+ |
+ return GrDefaultGeoProcFactory::Create(flags, GrColor_WHITE, usesLocalCoords, coverageIgnored, |
+ SkMatrix::I(), localMatrix); |
} |
class AAConvexPathBatch : public GrBatch { |
@@ -779,15 +771,17 @@ |
void generateGeometryLinesOnly(GrBatchTarget* batchTarget, const GrPipeline* pipeline) { |
bool canTweakAlphaForCoverage = this->canTweakAlphaForCoverage(); |
+ SkMatrix invert; |
+ if (this->usesLocalCoords() && !this->viewMatrix().invert(&invert)) { |
+ SkDebugf("Could not invert viewmatrix\n"); |
+ return; |
+ } |
+ |
// Setup GrGeometryProcessor |
- SkAutoTUnref<const GrGeometryProcessor> gp(create_fill_gp(canTweakAlphaForCoverage, |
- this->viewMatrix(), |
- this->usesLocalCoords(), |
- this->coverageIgnored())); |
- if (!gp) { |
- SkDebugf("Could not create GrGeometryProcessor\n"); |
- return; |
- } |
+ SkAutoTUnref<const GrGeometryProcessor> gp( |
+ create_fill_gp(canTweakAlphaForCoverage, invert, |
+ this->usesLocalCoords(), |
+ this->coverageIgnored())); |
batchTarget->initDraw(gp, pipeline); |