Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(179)

Unified Diff: src/gpu/GrAAConvexPathRenderer.cpp

Issue 1261083003: Use new API everywhere for GrDefaultGeoProcFactory (Closed) Base URL: https://skia.googlesource.com/skia.git@lccleanup2
Patch Set: feedback inc Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: src/gpu/GrAAConvexPathRenderer.cpp
diff --git a/src/gpu/GrAAConvexPathRenderer.cpp b/src/gpu/GrAAConvexPathRenderer.cpp
index 7e65fccc4502b5d314e324b711af6140723263f7..2ce0e3150a6f63f9d94b31a0c245eb95ba47adbd 100644
--- a/src/gpu/GrAAConvexPathRenderer.cpp
+++ b/src/gpu/GrAAConvexPathRenderer.cpp
@@ -721,19 +721,6 @@ static void extract_verts(const GrAAConvexTessellator& tess,
}
}
-static const GrGeometryProcessor* create_fill_gp(bool tweakAlphaForCoverage,
- const SkMatrix& localMatrix,
- bool usesLocalCoords,
- bool coverageIgnored) {
- 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 {
public:
struct Geometry {
@@ -774,19 +761,15 @@ public:
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");
+ SkAutoTUnref<const GrGeometryProcessor> gp(
+ GrDefaultGeoProcFactory::CreateForDeviceSpaceAlphaTweakIfPossible(
+ this->viewMatrix(), this->usesLocalCoords(), this->coverageIgnored(),
+ canTweakAlphaForCoverage));
+ if (!gp) {
+ SkDebugf("Could not create GrGeometryProcessor\n");
return;
}
- // Setup GrGeometryProcessor
- SkAutoTUnref<const GrGeometryProcessor> gp(
- create_fill_gp(canTweakAlphaForCoverage, invert,
- this->usesLocalCoords(),
- this->coverageIgnored()));
-
batchTarget->initDraw(gp, pipeline);
size_t vertexStride = gp->getVertexStride();

Powered by Google App Engine
This is Rietveld 408576698