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

Unified Diff: src/pathops/SkPathOpsCubic.h

Issue 1096923003: working on initial winding for cubics (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 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/SkPathOpsConic.cpp ('k') | src/pathops/SkPathOpsCubic.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/pathops/SkPathOpsCubic.h
diff --git a/src/pathops/SkPathOpsCubic.h b/src/pathops/SkPathOpsCubic.h
index 1263ac80ee2be1bbe90eee0657bf2b3f653eaaa6..269073ca69510a0749685718e295aab1652471e0 100644
--- a/src/pathops/SkPathOpsCubic.h
+++ b/src/pathops/SkPathOpsCubic.h
@@ -27,6 +27,13 @@ struct SkDCubic {
kYAxis
};
+ enum CubicType {
+ kUnsplit_SkDCubicType,
+ kSplitAtLoop_SkDCubicType,
+ kSplitAtInflection_SkDCubicType,
+ kSplitAtMaxCurvature_SkDCubicType,
+ };
+
bool collapsed() const {
return fPts[0].approximatelyEqual(fPts[1]) && fPts[0].approximatelyEqual(fPts[2])
&& fPts[0].approximatelyEqual(fPts[3]);
@@ -50,9 +57,10 @@ struct SkDCubic {
double binarySearch(double min, double max, double axisIntercept, SearchAxis xAxis) const;
double calcPrecision() const;
SkDCubicPair chopAt(double t) const;
- bool clockwise() const;
+ bool clockwise(bool* swap) const;
+ static bool Clockwise(const SkPoint* pts, double startT, double endT, bool* swap);
static void Coefficients(const double* cubic, double* A, double* B, double* C, double* D);
- static bool ComplexBreak(const SkPoint pts[4], SkScalar* t);
+ static bool ComplexBreak(const SkPoint pts[4], SkScalar* t, CubicType* cubicType);
int convexHull(char order[kPointCount]) const;
void debugInit() {
@@ -113,7 +121,7 @@ struct SkDCubic {
cubic.subDivide(a, d, t1, t2, p);
}
- SkDPoint top(double startT, double endT) const;
+ SkDPoint top(double startT, double endT, double* topT) const;
SkDQuad toQuad() const;
static const int gPrecisionUnit;
« no previous file with comments | « src/pathops/SkPathOpsConic.cpp ('k') | src/pathops/SkPathOpsCubic.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698