| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2014 Google Inc. | 2 * Copyright 2014 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 "SkOpCoincidence.h" | 7 #include "SkOpCoincidence.h" |
| 8 #include "SkOpContour.h" | 8 #include "SkOpContour.h" |
| 9 #include "SkOpSegment.h" | 9 #include "SkOpSegment.h" |
| 10 #include "SkPathWriter.h" | 10 #include "SkPathWriter.h" |
| 11 | 11 |
| 12 bool SkOpPtT::alias() const { | 12 bool SkOpPtT::alias() const { |
| 13 return this->span()->ptT() != this; | 13 return this->span()->ptT() != this; |
| 14 } | 14 } |
| 15 | 15 |
| 16 bool SkOpPtT::collapsed(const SkOpPtT* check) const { |
| 17 if (fPt != check->fPt) { |
| 18 return false; |
| 19 } |
| 20 SkASSERT(this != check); |
| 21 const SkOpSegment* segment = this->segment(); |
| 22 SkASSERT(segment == check->segment()); |
| 23 return segment->collapsed(); |
| 24 } |
| 25 |
| 16 bool SkOpPtT::contains(const SkOpPtT* check) const { | 26 bool SkOpPtT::contains(const SkOpPtT* check) const { |
| 17 SkASSERT(this != check); | 27 SkASSERT(this != check); |
| 18 const SkOpPtT* ptT = this; | 28 const SkOpPtT* ptT = this; |
| 19 const SkOpPtT* stopPtT = ptT; | 29 const SkOpPtT* stopPtT = ptT; |
| 20 while ((ptT = ptT->next()) != stopPtT) { | 30 while ((ptT = ptT->next()) != stopPtT) { |
| 21 if (ptT == check) { | 31 if (ptT == check) { |
| 22 return true; | 32 return true; |
| 23 } | 33 } |
| 24 } | 34 } |
| 25 return false; | 35 return false; |
| (...skipping 339 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 365 | 375 |
| 366 void SkOpSpan::setWindSum(int windSum) { | 376 void SkOpSpan::setWindSum(int windSum) { |
| 367 SkASSERT(!final()); | 377 SkASSERT(!final()); |
| 368 if (fWindSum != SK_MinS32 && fWindSum != windSum) { | 378 if (fWindSum != SK_MinS32 && fWindSum != windSum) { |
| 369 this->globalState()->setWindingFailed(); | 379 this->globalState()->setWindingFailed(); |
| 370 return; | 380 return; |
| 371 } | 381 } |
| 372 SkASSERT(!DEBUG_LIMIT_WIND_SUM || abs(windSum) <= DEBUG_LIMIT_WIND_SUM); | 382 SkASSERT(!DEBUG_LIMIT_WIND_SUM || abs(windSum) <= DEBUG_LIMIT_WIND_SUM); |
| 373 fWindSum = windSum; | 383 fWindSum = windSum; |
| 374 } | 384 } |
| OLD | NEW |