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

Unified Diff: src/gpu/GrAAConvexPathRenderer.cpp

Issue 1264283004: Revert of Use new API everywhere for GrDefaultGeoProcFactory (Closed) Base URL: https://skia.googlesource.com/skia.git@lccleanup2
Patch Set: Created 5 years, 4 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
« no previous file with comments | « gm/convexpolyeffect.cpp ('k') | src/gpu/GrAAHairLinePathRenderer.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
« no previous file with comments | « gm/convexpolyeffect.cpp ('k') | src/gpu/GrAAHairLinePathRenderer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698