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

Unified Diff: src/pathops/SkIntersections.cpp

Issue 52653002: pathops work in progress (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: add raster vs gpu test Created 7 years, 1 month 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 | « src/pathops/SkIntersections.h ('k') | src/pathops/SkOpAngle.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/pathops/SkIntersections.cpp
diff --git a/src/pathops/SkIntersections.cpp b/src/pathops/SkIntersections.cpp
index 608ffe3b6d49722bbe7cbed022465a305ef1d61c..35846f6cc9f54c3cf2759b45664261e71f2ca4cf 100644
--- a/src/pathops/SkIntersections.cpp
+++ b/src/pathops/SkIntersections.cpp
@@ -7,6 +7,12 @@
#include "SkIntersections.h"
+void SkIntersections::append(const SkIntersections& i) {
+ for (int index = 0; index < i.fUsed; ++index) {
+ insert(i[0][index], i[1][index], i.pt(index));
+ }
+}
+
int (SkIntersections::*CurveVertical[])(const SkPoint[], SkScalar, SkScalar, SkScalar, bool) = {
NULL,
&SkIntersections::verticalLine,
@@ -16,7 +22,7 @@ int (SkIntersections::*CurveVertical[])(const SkPoint[], SkScalar, SkScalar, SkS
int (SkIntersections::*CurveRay[])(const SkPoint[], const SkDLine&) = {
NULL,
- NULL,
+ &SkIntersections::lineRay,
&SkIntersections::quadRay,
&SkIntersections::cubicRay
};
@@ -126,6 +132,13 @@ void SkIntersections::insertCoincident(double one, double two, const SkDPoint& p
fIsCoincident[1] |= bit;
}
+int SkIntersections::lineRay(const SkPoint pts[2], const SkDLine& line) {
+ SkDLine l;
+ l.set(pts);
+ fMax = 2;
+ return intersectRay(l, line);
+}
+
void SkIntersections::offset(int base, double start, double end) {
for (int index = base; index < fUsed; ++index) {
double val = fT[fSwap][index];
« no previous file with comments | « src/pathops/SkIntersections.h ('k') | src/pathops/SkOpAngle.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698