| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2012 Google Inc. | 2 * Copyright 2012 Google Inc. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
| 5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
| 6 */ | 6 */ |
| 7 #ifndef SkOpAngle_DEFINED | 7 #ifndef SkOpAngle_DEFINED |
| 8 #define SkOpAngle_DEFINED | 8 #define SkOpAngle_DEFINED |
| 9 | 9 |
| 10 #include "SkLineParameters.h" | 10 #include "SkLineParameters.h" |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 void dumpCurves() const; | 57 void dumpCurves() const; |
| 58 void dumpLoop() const; | 58 void dumpLoop() const; |
| 59 void dumpOne(bool functionHeader) const; | 59 void dumpOne(bool functionHeader) const; |
| 60 void dumpTo(const SkOpSegment* fromSeg, const SkOpAngle* ) const; | 60 void dumpTo(const SkOpSegment* fromSeg, const SkOpAngle* ) const; |
| 61 void dumpTest() const; | 61 void dumpTest() const; |
| 62 | 62 |
| 63 SkOpSpanBase* end() const { | 63 SkOpSpanBase* end() const { |
| 64 return fEnd; | 64 return fEnd; |
| 65 } | 65 } |
| 66 | 66 |
| 67 void insert(SkOpAngle* ); | 67 bool insert(SkOpAngle* ); |
| 68 SkOpSpanBase* lastMarked() const; | 68 SkOpSpanBase* lastMarked() const; |
| 69 bool loopContains(const SkOpAngle* ) const; | 69 bool loopContains(const SkOpAngle* ) const; |
| 70 int loopCount() const; | 70 int loopCount() const; |
| 71 | 71 |
| 72 SkOpAngle* next() const { | 72 SkOpAngle* next() const { |
| 73 return fNext; | 73 return fNext; |
| 74 } | 74 } |
| 75 | 75 |
| 76 SkOpAngle* previous() const; | 76 SkOpAngle* previous() const; |
| 77 SkOpSegment* segment() const; | 77 SkOpSegment* segment() const; |
| 78 void set(SkOpSpanBase* start, SkOpSpanBase* end); | 78 void set(SkOpSpanBase* start, SkOpSpanBase* end); |
| 79 | 79 |
| 80 void setLastMarked(SkOpSpanBase* marked) { | 80 void setLastMarked(SkOpSpanBase* marked) { |
| 81 fLastMarked = marked; | 81 fLastMarked = marked; |
| 82 } | 82 } |
| 83 | 83 |
| 84 SkOpSpanBase* start() const { | 84 SkOpSpanBase* start() const { |
| 85 return fStart; | 85 return fStart; |
| 86 } | 86 } |
| 87 | 87 |
| 88 SkOpSpan* starter(); | 88 SkOpSpan* starter(); |
| 89 | 89 |
| 90 bool tangentsAmbiguous() const { |
| 91 return fTangentsAmbiguous; |
| 92 } |
| 93 |
| 90 bool unorderable() const { | 94 bool unorderable() const { |
| 91 return fUnorderable; | 95 return fUnorderable; |
| 92 } | 96 } |
| 93 | 97 |
| 94 private: | 98 private: |
| 95 bool after(SkOpAngle* test); | 99 bool after(SkOpAngle* test); |
| 96 int allOnOneSide(const SkOpAngle* test); | 100 int allOnOneSide(const SkOpAngle* test); |
| 97 bool checkCrossesZero() const; | 101 bool checkCrossesZero() const; |
| 98 bool checkParallel(SkOpAngle* ); | 102 bool checkParallel(SkOpAngle* ); |
| 99 bool computeSector(); | 103 bool computeSector(); |
| 100 int convexHullOverlaps(const SkOpAngle* ) const; | 104 int convexHullOverlaps(const SkOpAngle* ); |
| 101 bool endToSide(const SkOpAngle* rh, bool* inside) const; | 105 bool endToSide(const SkOpAngle* rh, bool* inside) const; |
| 102 bool endsIntersect(SkOpAngle* ); | 106 bool endsIntersect(SkOpAngle* ); |
| 103 int findSector(SkPath::Verb verb, double x, double y) const; | 107 int findSector(SkPath::Verb verb, double x, double y) const; |
| 104 SkOpGlobalState* globalState() const; | 108 SkOpGlobalState* globalState() const; |
| 105 bool merge(SkOpAngle* ); | 109 bool merge(SkOpAngle* ); |
| 106 double midT() const; | 110 double midT() const; |
| 107 bool midToSide(const SkOpAngle* rh, bool* inside) const; | 111 bool midToSide(const SkOpAngle* rh, bool* inside) const; |
| 108 bool oppositePlanes(const SkOpAngle* rh) const; | 112 bool oppositePlanes(const SkOpAngle* rh) const; |
| 109 bool orderable(SkOpAngle* rh); // false == this < rh ; true == this > rh | 113 bool orderable(SkOpAngle* rh); // false == this < rh ; true == this > rh |
| 110 void setSector(); | 114 void setSector(); |
| 111 void setSpans(); | 115 void setSpans(); |
| 112 bool tangentsDiverge(const SkOpAngle* rh, double s0xt0) const; | 116 bool tangentsDiverge(const SkOpAngle* rh, double s0xt0); |
| 113 | 117 |
| 114 SkDCurve fOriginalCurvePart; // the curve from start to end | 118 SkDCurve fOriginalCurvePart; // the curve from start to end |
| 115 SkDCurveSweep fPart; // the curve from start to end offset as needed | 119 SkDCurveSweep fPart; // the curve from start to end offset as needed |
| 116 double fSide; | 120 double fSide; |
| 117 SkLineParameters fTangentHalf; // used only to sort a pair of lines or line
-like sections | 121 SkLineParameters fTangentHalf; // used only to sort a pair of lines or line
-like sections |
| 118 SkOpAngle* fNext; | 122 SkOpAngle* fNext; |
| 119 SkOpSpanBase* fLastMarked; | 123 SkOpSpanBase* fLastMarked; |
| 120 SkOpSpanBase* fStart; | 124 SkOpSpanBase* fStart; |
| 121 SkOpSpanBase* fEnd; | 125 SkOpSpanBase* fEnd; |
| 122 SkOpSpanBase* fComputedEnd; | 126 SkOpSpanBase* fComputedEnd; |
| 123 int fSectorMask; | 127 int fSectorMask; |
| 124 int8_t fSectorStart; // in 32nds of a circle | 128 int8_t fSectorStart; // in 32nds of a circle |
| 125 int8_t fSectorEnd; | 129 int8_t fSectorEnd; |
| 126 bool fUnorderable; | 130 bool fUnorderable; |
| 127 bool fComputeSector; | 131 bool fComputeSector; |
| 128 bool fComputedSector; | 132 bool fComputedSector; |
| 129 bool fCheckCoincidence; | 133 bool fCheckCoincidence; |
| 134 bool fTangentsAmbiguous; |
| 130 SkDEBUGCODE(int fID); | 135 SkDEBUGCODE(int fID); |
| 131 | 136 |
| 132 friend class PathOpsAngleTester; | 137 friend class PathOpsAngleTester; |
| 133 }; | 138 }; |
| 134 | 139 |
| 135 | 140 |
| 136 | 141 |
| 137 #endif | 142 #endif |
| OLD | NEW |