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

Unified Diff: src/pathops/SkIntersectionHelper.h

Issue 21359002: path ops work in progress (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: remove space Created 7 years, 3 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 | « src/pathops/SkDQuadLineIntersection.cpp ('k') | src/pathops/SkIntersections.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/pathops/SkIntersectionHelper.h
diff --git a/src/pathops/SkIntersectionHelper.h b/src/pathops/SkIntersectionHelper.h
index 5d8ebcd5903292f568d0e0f17d6f03ced924b505..af246b760ebfa2cd22b7462efd70cfe02bb3e902 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;
}
« no previous file with comments | « src/pathops/SkDQuadLineIntersection.cpp ('k') | src/pathops/SkIntersections.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698