diff options
author | caryclark@google.com <caryclark@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2013-09-16 15:55:01 +0000 |
---|---|---|
committer | caryclark@google.com <caryclark@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2013-09-16 15:55:01 +0000 |
commit | 570863f2e22b8ea7d7c504bd15e4f766af097df2 (patch) | |
tree | aa07d18266edd483ee71d7be9491da622cf400f3 /src/pathops/SkIntersections.h | |
parent | cf7854057638dfa75e788f3f8babed75d587d444 (diff) |
path ops work in progress
path ops work in progress
BUG=
Review URL: https://codereview.chromium.org/21359002
git-svn-id: http://skia.googlecode.com/svn/trunk@11291 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src/pathops/SkIntersections.h')
-rw-r--r-- | src/pathops/SkIntersections.h | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/pathops/SkIntersections.h b/src/pathops/SkIntersections.h index 26a1d1a559..389098d84e 100644 --- a/src/pathops/SkIntersections.h +++ b/src/pathops/SkIntersections.h @@ -23,6 +23,7 @@ public: sk_bzero(fPt, sizeof(fPt)); sk_bzero(fT, sizeof(fT)); sk_bzero(fIsCoincident, sizeof(fIsCoincident)); + sk_bzero(&fIsNear, sizeof(fIsNear)); reset(); } @@ -40,6 +41,7 @@ public: memcpy(fPt, i.fPt, sizeof(fPt)); memcpy(fT, i.fT, sizeof(fT)); memcpy(fIsCoincident, i.fIsCoincident, sizeof(fIsCoincident)); + memcpy(&fIsNear, &i.fIsNear, sizeof(fIsNear)); fUsed = i.fUsed; fSwap = i.fSwap; SkDEBUGCODE(fDepth = i.fDepth); @@ -109,6 +111,10 @@ public: return (fIsCoincident[0] & 1 << index) != 0; } + bool isNear(int index) { + return (fIsNear & 1 << index) != 0; + } + int lineHorizontal(const SkPoint a[2], SkScalar left, SkScalar right, SkScalar y, bool flipped) { SkDLine line; @@ -206,6 +212,7 @@ public: int horizontal(const SkDCubic&, double left, double right, double y, double tRange[3]); // FIXME : does not respect swap int insert(double one, double two, const SkDPoint& pt); + void insertNear(double one, double two, const SkDPoint& pt); // start if index == 0 : end if index == 1 void insertCoincident(double one, double two, const SkDPoint& pt); int intersect(const SkDLine&, const SkDLine&); @@ -243,9 +250,10 @@ private: // used by addCoincident to remove ordinary intersections in range // void remove(double one, double two, const SkDPoint& startPt, const SkDPoint& endPt); - SkDPoint fPt[9]; + SkDPoint fPt[9]; // FIXME: since scans store points as SkPoint, this should also double fT[2][9]; - uint16_t fIsCoincident[2]; // bit arrays, one bit set for each coincident T + uint16_t fIsCoincident[2]; // bit set for each curve's coincident T + uint16_t fIsNear; // bit set for each T if 2nd curve's point is near but not equal to 1st unsigned char fUsed; bool fAllowNear; bool fSwap; |