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

Side by Side Diff: src/pathops/SkOpSegment.h

Issue 16195004: add asserts to point<-->verb helpers (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 7 years, 6 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/pathops/SkOpEdgeBuilder.cpp ('k') | src/pathops/SkOpSegment.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 SkOpSegment_DEFINE 7 #ifndef SkOpSegment_DEFINE
8 #define SkOpSegment_DEFINE 8 #define SkOpSegment_DEFINE
9 9
10 #include "SkOpAngle.h" 10 #include "SkOpAngle.h"
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 47
48 bool done(int min) const { 48 bool done(int min) const {
49 return fTs[min].fDone; 49 return fTs[min].fDone;
50 } 50 }
51 51
52 bool done(const SkOpAngle* angle) const { 52 bool done(const SkOpAngle* angle) const {
53 return done(SkMin32(angle->start(), angle->end())); 53 return done(SkMin32(angle->start(), angle->end()));
54 } 54 }
55 55
56 SkVector dxdy(int index) const { 56 SkVector dxdy(int index) const {
57 return (*CurveSlopeAtT[fVerb])(fPts, fTs[index].fT); 57 return (*CurveSlopeAtT[SkPathOpsVerbToPoints(fVerb)])(fPts, fTs[index].f T);
58 } 58 }
59 59
60 SkScalar dy(int index) const { 60 SkScalar dy(int index) const {
61 return dxdy(index).fY; 61 return dxdy(index).fY;
62 } 62 }
63 63
64 bool intersected() const { 64 bool intersected() const {
65 return fTs.count() > 0; 65 return fTs.count() > 0;
66 } 66 }
67 67
68 bool isCanceled(int tIndex) const { 68 bool isCanceled(int tIndex) const {
69 return fTs[tIndex].fWindValue == 0 && fTs[tIndex].fOppValue == 0; 69 return fTs[tIndex].fWindValue == 0 && fTs[tIndex].fOppValue == 0;
70 } 70 }
71 71
72 bool isConnected(int startIndex, int endIndex) const { 72 bool isConnected(int startIndex, int endIndex) const {
73 return fTs[startIndex].fWindSum != SK_MinS32 || fTs[endIndex].fWindSum ! = SK_MinS32; 73 return fTs[startIndex].fWindSum != SK_MinS32 || fTs[endIndex].fWindSum ! = SK_MinS32;
74 } 74 }
75 75
76 bool isHorizontal() const { 76 bool isHorizontal() const {
77 return fBounds.fTop == fBounds.fBottom; 77 return fBounds.fTop == fBounds.fBottom;
78 } 78 }
79 79
80 bool isVertical() const { 80 bool isVertical() const {
81 return fBounds.fLeft == fBounds.fRight; 81 return fBounds.fLeft == fBounds.fRight;
82 } 82 }
83 83
84 bool isVertical(int start, int end) const { 84 bool isVertical(int start, int end) const {
85 return (*CurveIsVertical[fVerb])(fPts, start, end); 85 return (*CurveIsVertical[SkPathOpsVerbToPoints(fVerb)])(fPts, start, end );
86 } 86 }
87 87
88 bool operand() const { 88 bool operand() const {
89 return fOperand; 89 return fOperand;
90 } 90 }
91 91
92 int oppSign(const SkOpAngle* angle) const { 92 int oppSign(const SkOpAngle* angle) const {
93 SkASSERT(angle->segment() == this); 93 SkASSERT(angle->segment() == this);
94 return oppSign(angle->start(), angle->end()); 94 return oppSign(angle->start(), angle->end());
95 } 95 }
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
199 SkScalar xAtT(const SkOpSpan* span) const { 199 SkScalar xAtT(const SkOpSpan* span) const {
200 return xyAtT(span).fX; 200 return xyAtT(span).fX;
201 } 201 }
202 202
203 const SkPoint& xyAtT(const SkOpSpan* span) const { 203 const SkPoint& xyAtT(const SkOpSpan* span) const {
204 return span->fPt; 204 return span->fPt;
205 } 205 }
206 206
207 // used only by right angle winding finding 207 // used only by right angle winding finding
208 SkPoint xyAtT(double mid) const { 208 SkPoint xyAtT(double mid) const {
209 return (*CurvePointAtT[fVerb])(fPts, mid); 209 return (*CurvePointAtT[SkPathOpsVerbToPoints(fVerb)])(fPts, mid);
210 } 210 }
211 211
212 const SkPoint& xyAtT(int index) const { 212 const SkPoint& xyAtT(int index) const {
213 return xyAtT(&fTs[index]); 213 return xyAtT(&fTs[index]);
214 } 214 }
215 215
216 SkScalar yAtT(int index) const { 216 SkScalar yAtT(int index) const {
217 return yAtT(&fTs[index]); 217 return yAtT(&fTs[index]);
218 } 218 }
219 219
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after
384 SkPath::Verb fVerb; 384 SkPath::Verb fVerb;
385 bool fOperand; 385 bool fOperand;
386 bool fXor; // set if original contour had even-odd fill 386 bool fXor; // set if original contour had even-odd fill
387 bool fOppXor; // set if opposite operand had even-odd fill 387 bool fOppXor; // set if opposite operand had even-odd fill
388 #if DEBUG_DUMP 388 #if DEBUG_DUMP
389 int fID; 389 int fID;
390 #endif 390 #endif
391 }; 391 };
392 392
393 #endif 393 #endif
OLDNEW
« no previous file with comments | « src/pathops/SkOpEdgeBuilder.cpp ('k') | src/pathops/SkOpSegment.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698