aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/pathops/SkIntersectionHelper.h
diff options
context:
space:
mode:
authorGravatar caryclark@google.com <caryclark@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-09-16 15:55:01 +0000
committerGravatar caryclark@google.com <caryclark@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-09-16 15:55:01 +0000
commit570863f2e22b8ea7d7c504bd15e4f766af097df2 (patch)
treeaa07d18266edd483ee71d7be9491da622cf400f3 /src/pathops/SkIntersectionHelper.h
parentcf7854057638dfa75e788f3f8babed75d587d444 (diff)
path ops work in progress
path ops work in progress BUG= Review URL: https://codereview.chromium.org/21359002 git-svn-id: http://skia.googlecode.com/svn/trunk@11291 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src/pathops/SkIntersectionHelper.h')
-rw-r--r--src/pathops/SkIntersectionHelper.h22
1 files changed, 15 insertions, 7 deletions
diff --git a/src/pathops/SkIntersectionHelper.h b/src/pathops/SkIntersectionHelper.h
index 5d8ebcd590..af246b760e 100644
--- a/src/pathops/SkIntersectionHelper.h
+++ b/src/pathops/SkIntersectionHelper.h
@@ -27,24 +27,24 @@ public:
fContour->addOtherT(fIndex, index, otherT, otherIndex);
}
+ void addPartialCoincident(SkIntersectionHelper& other, const SkIntersections& ts, int index,
+ bool swap) {
+ fContour->addPartialCoincident(fIndex, other.fContour, other.fIndex, ts, index, swap);
+ }
+
// Avoid collapsing t values that are close to the same since
// we walk ts to describe consecutive intersections. Since a pair of ts can
// be nearly equal, any problems caused by this should be taken care
// of later.
// On the edge or out of range values are negative; add 2 to get end
- int addT(const SkIntersectionHelper& other, const SkPoint& pt, double newT) {
- return fContour->addT(fIndex, other.fContour, other.fIndex, pt, newT);
+ int addT(const SkIntersectionHelper& other, const SkPoint& pt, double newT, bool isNear) {
+ return fContour->addT(fIndex, other.fContour, other.fIndex, pt, newT, isNear);
}
int addSelfT(const SkIntersectionHelper& other, const SkPoint& pt, double newT) {
return fContour->addSelfT(fIndex, other.fContour, other.fIndex, pt, newT);
}
- int addUnsortableT(const SkIntersectionHelper& other, bool start, const SkPoint& pt,
- double newT) {
- return fContour->addUnsortableT(fIndex, other.fContour, other.fIndex, start, pt, newT);
- }
-
bool advance() {
return ++fIndex < fLast;
}
@@ -72,6 +72,14 @@ public:
&& next.fIndex == fLast - 1;
}
+ bool isNear(double t1, double t2, const SkDPoint& pt1, const SkDPoint& pt2) const {
+ const SkOpSegment& segment = fContour->segments()[fIndex];
+ double mid = (t1 + t2) / 2;
+ SkDPoint midPtByT = segment.dPtAtT(mid);
+ SkDPoint midPtByAvg = SkDPoint::Mid(pt1, pt2);
+ return midPtByT.approximatelyEqualHalf(midPtByAvg);
+ }
+
SkScalar left() const {
return bounds().fLeft;
}