aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/pathops/SkPathOpsQuad.h
diff options
context:
space:
mode:
authorGravatar caryclark@google.com <caryclark@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-06-04 17:59:42 +0000
committerGravatar caryclark@google.com <caryclark@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-06-04 17:59:42 +0000
commitcffbcc3b9665f2c928544b6fc6b8a0e22a4210fb (patch)
treeed16b540c395c4e1c91733d9198575c2352efc06 /src/pathops/SkPathOpsQuad.h
parent4075fd485101eea80cc67c396e6839e555ab948a (diff)
path ops -- rewrite angle sort
This is a major change resulting from a minor tweak. In the old code, the intersection point of two curves was shared between them, but the intersection points and end points of sorted edges was computed directly from the intersection T value. In this CL, both intersection points and sorted points are the same, and intermediate control points are computed to preserve their slope. The sort itself has been completely rewritten to be more robust and remove 'magic' checks, conditions that empirically worked but couldn't be rationalized. This CL was triggered by errors generated computing the clips of SKP files. At this point, all 73M standard tests work and at least the first troublesome SKPs work. Review URL: https://codereview.chromium.org/15338003 git-svn-id: http://skia.googlecode.com/svn/trunk@9432 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src/pathops/SkPathOpsQuad.h')
-rw-r--r--src/pathops/SkPathOpsQuad.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/pathops/SkPathOpsQuad.h b/src/pathops/SkPathOpsQuad.h
index d5ca0c7443..d06f3449bf 100644
--- a/src/pathops/SkPathOpsQuad.h
+++ b/src/pathops/SkPathOpsQuad.h
@@ -19,6 +19,11 @@ struct SkDQuadPair {
struct SkDQuad {
SkDPoint fPts[3];
+ SkDQuad flip() const {
+ SkDQuad result = {{fPts[2], fPts[1], fPts[0]}};
+ return result;
+ }
+
void set(const SkPoint pts[3]) {
fPts[0] = pts[0];
fPts[1] = pts[1];
@@ -29,6 +34,7 @@ struct SkDQuad {
SkDPoint& operator[](int n) { SkASSERT(n >= 0 && n < 3); return fPts[n]; }
static int AddValidTs(double s[], int realRoots, double* t);
+ void align(int endIndex, SkDPoint* dstPt) const;
SkDQuadPair chopAt(double t) const;
SkDVector dxdyAtT(double t) const;
static int FindExtrema(double a, double b, double c, double tValue[1]);