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

Unified Diff: src/pathops/SkIntersectionHelper.h

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/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 1a4b1f044145e70054cc125033284b4c47dd56dd..f5eeaf8813db7e3649d0b0bcb647f9c703666b42 100644
--- a/src/pathops/SkIntersectionHelper.h
+++ b/src/pathops/SkIntersectionHelper.h
@@ -7,6 +7,10 @@
#include "SkOpContour.h"
#include "SkPath.h"
+#if SK_DEBUG
+#include "SkPathOpsPoint.h"
+#endif
+
class SkIntersectionHelper {
public:
enum SegmentType {
@@ -81,6 +85,14 @@ public:
return midPtByT.approximatelyEqual(midPtByAvg);
}
+ bool isPartial(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.approximatelyPEqual(midPtByAvg);
+ }
+
SkScalar left() const {
return bounds().fLeft;
}
@@ -137,6 +149,19 @@ public:
return y() != pts()[0].fY;
}
+#ifdef SK_DEBUG
+ void dump() {
+ SkDPoint::dump(pts()[0]);
+ SkDPoint::dump(pts()[1]);
+ if (verb() >= SkPath::kQuad_Verb) {
+ SkDPoint::dump(pts()[2]);
+ }
+ if (verb() >= SkPath::kCubic_Verb) {
+ SkDPoint::dump(pts()[3]);
+ }
+ }
+#endif
+
private:
SkOpContour* fContour;
int fIndex;
« 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