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

Unified Diff: src/pathops/SkLineParameters.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/SkIntersections.cpp ('k') | src/pathops/SkOpAngle.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/pathops/SkLineParameters.h
diff --git a/src/pathops/SkLineParameters.h b/src/pathops/SkLineParameters.h
index 8824e54bb11684f90e1154b0253978d333faba68..9cbd8524aa302c5a9fed1f60f49b1b64a9288a04 100644
--- a/src/pathops/SkLineParameters.h
+++ b/src/pathops/SkLineParameters.h
@@ -39,6 +39,14 @@ public:
c = pts[s].fX * pts[e].fY - pts[e].fX * pts[s].fY;
}
+ double cubicPart(const SkDCubic& part) {
+ cubicEndPoints(part);
+ if (part[0] == part[1] || ((const SkDLine& ) part[0]).nearRay(part[2])) {
+ return pointDistance(part[3]);
+ }
+ return pointDistance(part[2]);
+ }
+
void lineEndPoints(const SkDLine& pts) {
a = pts[0].fY - pts[1].fY;
b = pts[1].fX - pts[0].fX;
@@ -58,6 +66,11 @@ public:
c = pts[s].fX * pts[e].fY - pts[e].fX * pts[s].fY;
}
+ double quadPart(const SkDQuad& part) {
+ quadEndPoints(part);
+ return pointDistance(part[2]);
+ }
+
double normalSquared() const {
return a * a + b * b;
}
« no previous file with comments | « src/pathops/SkIntersections.cpp ('k') | src/pathops/SkOpAngle.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698