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 #include "SkOpContour.h" | 7 #include "SkOpContour.h" |
8 #include "SkPath.h" | 8 #include "SkPath.h" |
9 | 9 |
10 #ifdef SK_DEBUG | 10 #ifdef SK_DEBUG |
(...skipping 28 matching lines...) Expand all Loading... |
39 | 39 |
40 // Avoid collapsing t values that are close to the same since | 40 // Avoid collapsing t values that are close to the same since |
41 // we walk ts to describe consecutive intersections. Since a pair of ts can | 41 // we walk ts to describe consecutive intersections. Since a pair of ts can |
42 // be nearly equal, any problems caused by this should be taken care | 42 // be nearly equal, any problems caused by this should be taken care |
43 // of later. | 43 // of later. |
44 // On the edge or out of range values are negative; add 2 to get end | 44 // On the edge or out of range values are negative; add 2 to get end |
45 int addT(const SkIntersectionHelper& other, const SkPoint& pt, double newT)
{ | 45 int addT(const SkIntersectionHelper& other, const SkPoint& pt, double newT)
{ |
46 return fContour->addT(fIndex, other.fContour, other.fIndex, pt, newT); | 46 return fContour->addT(fIndex, other.fContour, other.fIndex, pt, newT); |
47 } | 47 } |
48 | 48 |
49 int addSelfT(const SkIntersectionHelper& other, const SkPoint& pt, double ne
wT) { | 49 int addSelfT(const SkPoint& pt, double newT) { |
50 return fContour->addSelfT(fIndex, other.fContour, other.fIndex, pt, newT
); | 50 return fContour->addSelfT(fIndex, pt, newT); |
51 } | 51 } |
52 | 52 |
53 bool advance() { | 53 bool advance() { |
54 return ++fIndex < fLast; | 54 return ++fIndex < fLast; |
55 } | 55 } |
56 | 56 |
57 SkScalar bottom() const { | 57 SkScalar bottom() const { |
58 return bounds().fBottom; | 58 return bounds().fBottom; |
59 } | 59 } |
60 | 60 |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
134 } | 134 } |
135 | 135 |
136 SkScalar y() const { | 136 SkScalar y() const { |
137 return bounds().fTop; | 137 return bounds().fTop; |
138 } | 138 } |
139 | 139 |
140 bool yFlipped() const { | 140 bool yFlipped() const { |
141 return y() != pts()[0].fY; | 141 return y() != pts()[0].fY; |
142 } | 142 } |
143 | 143 |
144 #ifdef SK_DEBUG | 144 private: |
145 void dump() { | 145 // utility callable by the user from the debugger when the implementation co
de is linked in |
146 SkDPoint::dump(pts()[0]); | 146 void dump() const; |
147 SkDPoint::dump(pts()[1]); | |
148 if (verb() >= SkPath::kQuad_Verb) { | |
149 SkDPoint::dump(pts()[2]); | |
150 } | |
151 if (verb() >= SkPath::kCubic_Verb) { | |
152 SkDPoint::dump(pts()[3]); | |
153 } | |
154 } | |
155 #endif | |
156 | 147 |
157 private: | |
158 SkOpContour* fContour; | 148 SkOpContour* fContour; |
159 int fIndex; | 149 int fIndex; |
160 int fLast; | 150 int fLast; |
161 }; | 151 }; |
OLD | NEW |