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

Unified Diff: src/pathops/SkIntersections.cpp

Issue 1037953004: add conics to path ops (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: turn off pathops specific debuggging Created 5 years, 8 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.h ('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/SkIntersections.cpp
diff --git a/src/pathops/SkIntersections.cpp b/src/pathops/SkIntersections.cpp
index 007efa7ff1110a337738dbb80d555514b2d0aefb..a1f859833add063914c9752b0edc8c8a25c637dd 100644
--- a/src/pathops/SkIntersections.cpp
+++ b/src/pathops/SkIntersections.cpp
@@ -47,10 +47,12 @@ int SkIntersections::coincidentUsed() const {
return count;
}
-int (SkIntersections::* const CurveVertical[])(const SkPoint[], SkScalar, SkScalar, SkScalar, bool) = {
+int (SkIntersections::* const CurveVertical[])(const SkPoint[], SkScalar,
+ SkScalar, SkScalar, SkScalar, bool) = {
NULL,
&SkIntersections::verticalLine,
&SkIntersections::verticalQuad,
+ &SkIntersections::verticalConic,
&SkIntersections::verticalCubic
};
@@ -193,23 +195,30 @@ void SkIntersections::removeOne(int index) {
fIsCoincident[1] -= ((fIsCoincident[1] >> 1) & ~((1 << index) - 1)) + coBit;
}
-int SkIntersections::verticalLine(const SkPoint a[2], SkScalar top, SkScalar bottom,
- SkScalar x, bool flipped) {
+int SkIntersections::verticalConic(const SkPoint a[3], SkScalar weight,
+ SkScalar top, SkScalar bottom, SkScalar x, bool flipped) {
+ SkDConic conic;
+ conic.set(a, weight);
+ return vertical(conic, top, bottom, x, flipped);
+}
+
+int SkIntersections::verticalCubic(const SkPoint a[4], SkScalar weight,
+ SkScalar top, SkScalar bottom, SkScalar x, bool flipped) {
+ SkDCubic cubic;
+ cubic.set(a);
+ return vertical(cubic, top, bottom, x, flipped);
+}
+
+int SkIntersections::verticalLine(const SkPoint a[2], SkScalar weight,
+ SkScalar top, SkScalar bottom, SkScalar x, bool flipped) {
SkDLine line;
line.set(a);
return vertical(line, top, bottom, x, flipped);
}
-int SkIntersections::verticalQuad(const SkPoint a[3], SkScalar top, SkScalar bottom,
- SkScalar x, bool flipped) {
+int SkIntersections::verticalQuad(const SkPoint a[3], SkScalar weight,
+ SkScalar top, SkScalar bottom, SkScalar x, bool flipped) {
SkDQuad quad;
quad.set(a);
return vertical(quad, top, bottom, x, flipped);
}
-
-int SkIntersections::verticalCubic(const SkPoint a[4], SkScalar top, SkScalar bottom,
- SkScalar x, bool flipped) {
- SkDCubic cubic;
- cubic.set(a);
- return vertical(cubic, top, bottom, x, flipped);
-}
« no previous file with comments | « src/pathops/SkIntersections.h ('k') | src/pathops/SkOpAngle.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698