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/SkOpAngle.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/SkOpAngle.h')
-rw-r--r-- | src/pathops/SkOpAngle.h | 35 |
1 files changed, 27 insertions, 8 deletions
diff --git a/src/pathops/SkOpAngle.h b/src/pathops/SkOpAngle.h index e7e5e1f597..583f5ec8b3 100644 --- a/src/pathops/SkOpAngle.h +++ b/src/pathops/SkOpAngle.h @@ -12,23 +12,30 @@ #include "SkPathOpsCubic.h" class SkOpSegment; +struct SkOpSpan; // sorting angles // given angles of {dx dy ddx ddy dddx dddy} sort them class SkOpAngle { public: enum { kStackBasedCount = 8 }; // FIXME: determine what this should be + enum IncludeType { + kUnaryWinding, + kUnaryXor, + kBinarySingle, + kBinaryOpp, + }; bool operator<(const SkOpAngle& rh) const; bool calcSlop(double x, double y, double rx, double ry, bool* result) const; double dx() const { - return fTangent1.dx(); + return fTangentPart.dx(); } double dy() const { - return fTangent1.dy(); + return fTangentPart.dy(); } int end() const { @@ -37,8 +44,16 @@ public: bool isHorizontal() const; + SkOpSpan* lastMarked() const { + return fLastMarked; + } + void set(const SkOpSegment* segment, int start, int end); + void setLastMarked(SkOpSpan* marked) { + fLastMarked = marked; + } + SkOpSegment* segment() const { return const_cast<SkOpSegment*>(fSegment); } @@ -59,11 +74,11 @@ public: return fUnsortable; } -#if DEBUG_ANGLE - void debugShow(const SkPoint& a) const { - SkDebugf(" d=(%1.9g,%1.9g) side=%1.9g\n", dx(), dy(), fSide); - } +#ifdef SK_DEBUG + void dump() const; +#endif +#if DEBUG_ANGLE void setID(int id) { fID = id; } @@ -73,10 +88,14 @@ private: bool lengthen(const SkOpAngle& ); void setSpans(); - SkDCubic fCurvePart; + SkDCubic fCurvePart; // the curve from start to end + SkDCubic fCurveHalf; // the curve from start to 1 or 0 double fSide; - SkLineParameters fTangent1; + double fSide2; + SkLineParameters fTangentPart; + SkLineParameters fTangentHalf; const SkOpSegment* fSegment; + SkOpSpan* fLastMarked; int fStart; int fEnd; bool fComputed; // tangent is computed, may contain some error |