Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(921)

Unified Diff: src/pathops/SkOpAngle.h

Issue 21359002: path ops work in progress (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: remove space Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/pathops/SkLineParameters.h ('k') | src/pathops/SkOpAngle.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/pathops/SkOpAngle.h
diff --git a/src/pathops/SkOpAngle.h b/src/pathops/SkOpAngle.h
index e7e5e1f597e1ddd77ba2b1f7f805188c9d87dd67..583f5ec8b39df3bbb47e8411b054d2209b796e17 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
« no previous file with comments | « src/pathops/SkLineParameters.h ('k') | src/pathops/SkOpAngle.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698