| 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 "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" |
| (...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 242 return true; | 242 return true; |
| 243 } | 243 } |
| 244 | 244 |
| 245 // Please keep this in sync with debugAddT() | 245 // Please keep this in sync with debugAddT() |
| 246 SkOpPtT* SkOpSegment::addT(double t) { | 246 SkOpPtT* SkOpSegment::addT(double t) { |
| 247 debugValidate(); | 247 debugValidate(); |
| 248 SkPoint pt = this->ptAtT(t); | 248 SkPoint pt = this->ptAtT(t); |
| 249 SkOpSpanBase* spanBase = &fHead; | 249 SkOpSpanBase* spanBase = &fHead; |
| 250 do { | 250 do { |
| 251 SkOpPtT* result = spanBase->ptT(); | 251 SkOpPtT* result = spanBase->ptT(); |
| 252 if (t == result->fT || this->match(result, this, t, pt)) { | 252 if (t == result->fT || (!zero_or_one(t) && this->match(result, this, t,
pt))) { |
| 253 spanBase->bumpSpanAdds(); | 253 spanBase->bumpSpanAdds(); |
| 254 return result; | 254 return result; |
| 255 } | 255 } |
| 256 if (t < result->fT) { | 256 if (t < result->fT) { |
| 257 SkOpSpan* prev = result->span()->prev(); | 257 SkOpSpan* prev = result->span()->prev(); |
| 258 FAIL_WITH_NULL_IF(!prev); | 258 FAIL_WITH_NULL_IF(!prev); |
| 259 // marks in global state that new op span has been allocated | 259 // marks in global state that new op span has been allocated |
| 260 SkOpSpan* span = this->insert(prev); | 260 SkOpSpan* span = this->insert(prev); |
| 261 span->init(this, prev, t, pt); | 261 span->init(this, prev, t, pt); |
| 262 this->debugValidate(); | 262 this->debugValidate(); |
| (...skipping 1482 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1745 int absOut = SkTAbs(outerWinding); | 1745 int absOut = SkTAbs(outerWinding); |
| 1746 int absIn = SkTAbs(innerWinding); | 1746 int absIn = SkTAbs(innerWinding); |
| 1747 bool result = absOut == absIn ? outerWinding < 0 : absOut < absIn; | 1747 bool result = absOut == absIn ? outerWinding < 0 : absOut < absIn; |
| 1748 return result; | 1748 return result; |
| 1749 } | 1749 } |
| 1750 | 1750 |
| 1751 int SkOpSegment::windSum(const SkOpAngle* angle) const { | 1751 int SkOpSegment::windSum(const SkOpAngle* angle) const { |
| 1752 const SkOpSpan* minSpan = angle->start()->starter(angle->end()); | 1752 const SkOpSpan* minSpan = angle->start()->starter(angle->end()); |
| 1753 return minSpan->windSum(); | 1753 return minSpan->windSum(); |
| 1754 } | 1754 } |
| OLD | NEW |