aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/pathops/SkIntersections.cpp
diff options
context:
space:
mode:
authorGravatar caryclark@google.com <caryclark@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-11-01 17:36:03 +0000
committerGravatar caryclark@google.com <caryclark@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-11-01 17:36:03 +0000
commita2bbc6e19d5332e81784e582c290cc060f40c4c7 (patch)
tree507a82e41b5a59f261295718091f0f1491b3d894 /src/pathops/SkIntersections.cpp
parent045c3d330c6c14f090c2222ece08d82cb84fb3ea (diff)
pathops work in progress
BUG= Review URL: https://codereview.chromium.org/52653002 git-svn-id: http://skia.googlecode.com/svn/trunk@12089 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src/pathops/SkIntersections.cpp')
-rw-r--r--src/pathops/SkIntersections.cpp15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/pathops/SkIntersections.cpp b/src/pathops/SkIntersections.cpp
index 608ffe3b6d..35846f6cc9 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];