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

Unified Diff: src/gpu/GrAAConvexPathRenderer.cpp

Issue 825443002: Add conic support to Default and AAConvex path redender. (Closed) Base URL: https://skia.googlesource.com/skia.git@conics
Patch Set: Rebase Created 5 years, 11 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 | « no previous file | src/gpu/GrDefaultPathRenderer.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 ed6bc6365b2eb7caefc7c7486272797fcd71f53e..fcf38ef7e795252ad94a5b23fb136a52973dc1e1 100644
--- a/src/gpu/GrAAConvexPathRenderer.cpp
+++ b/src/gpu/GrAAConvexPathRenderer.cpp
@@ -15,6 +15,7 @@
#include "GrInvariantOutput.h"
#include "GrProcessor.h"
#include "GrPathUtils.h"
+#include "SkGeometry.h"
#include "SkString.h"
#include "SkStrokeRec.h"
#include "SkTraceEvent.h"
@@ -307,6 +308,18 @@ static bool get_segments(const SkPath& path,
update_degenerate_test(&degenerateData, pts[2]);
add_quad_segment(pts, segments, devBounds);
break;
+ case SkPath::kConic_Verb: {
+ m.mapPoints(pts, 3);
+ SkScalar weight = iter.conicWeight();
+ SkAutoConicToQuads converter;
+ const SkPoint* quadPts = converter.computeQuads(pts, weight, 0.5f);
+ for (int i = 0; i < converter.countQuads(); ++i) {
+ update_degenerate_test(&degenerateData, quadPts[2*i + 1]);
+ update_degenerate_test(&degenerateData, quadPts[2*i + 2]);
+ add_quad_segment(quadPts + 2*i, segments, devBounds);
+ }
+ break;
+ }
case SkPath::kCubic_Verb: {
m.mapPoints(pts, 4);
update_degenerate_test(&degenerateData, pts[1]);
« no previous file with comments | « no previous file | src/gpu/GrDefaultPathRenderer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698