Index: src/pathops/SkPathOpsCubic.h |
diff --git a/src/pathops/SkPathOpsCubic.h b/src/pathops/SkPathOpsCubic.h |
index 500319607dc0c29b3a78acf63a5b80fbd1baa382..1037cae4f759f94e5c01a3bd3784a44c16ceb3d5 100644 |
--- a/src/pathops/SkPathOpsCubic.h |
+++ b/src/pathops/SkPathOpsCubic.h |
@@ -19,21 +19,16 @@ struct SkDCubicPair { |
}; |
struct SkDCubic { |
- SkDPoint fPts[4]; |
- |
- void set(const SkPoint pts[4]) { |
- fPts[0] = pts[0]; |
- fPts[1] = pts[1]; |
- fPts[2] = pts[2]; |
- fPts[3] = pts[3]; |
- } |
- |
- static const int gPrecisionUnit; |
+ enum SearchAxis { |
+ kXAxis, |
+ kYAxis |
+ }; |
const SkDPoint& operator[](int n) const { SkASSERT(n >= 0 && n < 4); return fPts[n]; } |
SkDPoint& operator[](int n) { SkASSERT(n >= 0 && n < 4); return fPts[n]; } |
void align(int endIndex, int ctrlIndex, SkDPoint* dstPt) const; |
+ double binarySearch(double min, double max, double axisIntercept, SearchAxis xAxis) const; |
double calcPrecision() const; |
SkDCubicPair chopAt(double t) const; |
bool clockwise() const; |
@@ -42,9 +37,9 @@ struct SkDCubic { |
SkDVector dxdyAtT(double t) const; |
bool endsAreExtremaInXOrY() const; |
static int FindExtrema(double a, double b, double c, double d, double tValue[2]); |
- int findInflections(double tValues[]) const; |
+ int findInflections(double tValues[2]) const; |
- static int FindInflections(const SkPoint a[4], double tValues[]) { |
+ static int FindInflections(const SkPoint a[4], double tValues[2]) { |
SkDCubic cubic; |
cubic.set(a); |
return cubic.findInflections(tValues); |
@@ -56,7 +51,18 @@ struct SkDCubic { |
SkDPoint ptAtT(double t) const; |
static int RootsReal(double A, double B, double C, double D, double t[3]); |
static int RootsValidT(const double A, const double B, const double C, double D, double s[3]); |
+ |
+ int searchRoots(double extremes[6], int extrema, double axisIntercept, |
+ SearchAxis xAxis, double* validRoots) const; |
bool serpentine() const; |
+ |
+ void set(const SkPoint pts[4]) { |
+ fPts[0] = pts[0]; |
+ fPts[1] = pts[1]; |
+ fPts[2] = pts[2]; |
+ fPts[3] = pts[3]; |
+ } |
+ |
SkDCubic subDivide(double t1, double t2) const; |
static SkDCubic SubDivide(const SkPoint a[4], double t1, double t2) { |
@@ -81,6 +87,10 @@ struct SkDCubic { |
// utilities callable by the user from the debugger when the implementation code is linked in |
void dump() const; |
void dumpNumber() const; |
+ |
+ static const int gPrecisionUnit; |
+ |
+ SkDPoint fPts[4]; |
}; |
#endif |