aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/pathops/SkPathOpsCubic.h
diff options
context:
space:
mode:
authorGravatar caryclark@google.com <caryclark@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-04-17 15:49:16 +0000
committerGravatar caryclark@google.com <caryclark@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-04-17 15:49:16 +0000
commitb3f0921fba9457ba7ea79f220d8c1ec9345bfd3a (patch)
tree88e4c5e6b5f7622e4949073f8de141c2685a503e /src/pathops/SkPathOpsCubic.h
parent319baf99636c39f41d93c8808b7be3d198aa27b4 (diff)
shape ops work in progress
Try to fix the 32 bit build by making some math decisions more robust. Rewrite the cubic intersection special case that detects if only end points are shared. Rewrite the angle sort setup that computes whether a cubic bends to the left or right. git-svn-id: http://skia.googlecode.com/svn/trunk@8726 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src/pathops/SkPathOpsCubic.h')
-rw-r--r--src/pathops/SkPathOpsCubic.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/pathops/SkPathOpsCubic.h b/src/pathops/SkPathOpsCubic.h
index 48280fd32f..37492ddbba 100644
--- a/src/pathops/SkPathOpsCubic.h
+++ b/src/pathops/SkPathOpsCubic.h
@@ -41,6 +41,13 @@ struct SkDCubic {
bool endsAreExtremaInXOrY() const;
static int FindExtrema(double a, double b, double c, double d, double tValue[2]);
int findInflections(double tValues[]) const;
+
+ static int FindInflections(const SkPoint a[4], double tValues[]) {
+ SkDCubic cubic;
+ cubic.set(a);
+ return cubic.findInflections(tValues);
+ }
+
int findMaxCurvature(double tValues[]) const;
bool isLinear(int startIndex, int endIndex) const;
bool monotonicInY() const;
@@ -48,11 +55,13 @@ struct SkDCubic {
static int RootsValidT(const double A, const double B, const double C, double D, double s[3]);
bool serpentine() const;
SkDCubic subDivide(double t1, double t2) const;
+
static SkDCubic SubDivide(const SkPoint a[4], double t1, double t2) {
SkDCubic cubic;
cubic.set(a);
return cubic.subDivide(t1, t2);
}
+
void subDivide(const SkDPoint& a, const SkDPoint& d, double t1, double t2, SkDPoint p[2]) const;
static void SubDivide(const SkPoint pts[4], const SkDPoint& a, const SkDPoint& d, double t1,