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 344 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
355 this->debugValidate(); | 355 this->debugValidate(); |
356 #if DEBUG_ADD_T | 356 #if DEBUG_ADD_T |
357 SkDebugf("%s alias t=%1.9g segID=%d spanID=%d\n", __FUNCTION__, t, | 357 SkDebugf("%s alias t=%1.9g segID=%d spanID=%d\n", __FUNCTION__, t, |
358 alias->segment()->debugID(), alias->span()->debugID()); | 358 alias->segment()->debugID(), alias->span()->debugID()); |
359 #endif | 359 #endif |
360 span->bumpSpanAdds(); | 360 span->bumpSpanAdds(); |
361 return alias; | 361 return alias; |
362 } | 362 } |
363 if (t < result->fT) { | 363 if (t < result->fT) { |
364 SkOpSpan* prev = result->span()->prev(); | 364 SkOpSpan* prev = result->span()->prev(); |
| 365 if (!prev) { |
| 366 return nullptr; |
| 367 } |
365 SkOpSpan* span = insert(prev, allocator); | 368 SkOpSpan* span = insert(prev, allocator); |
366 span->init(this, prev, t, pt); | 369 span->init(this, prev, t, pt); |
367 this->debugValidate(); | 370 this->debugValidate(); |
368 #if DEBUG_ADD_T | 371 #if DEBUG_ADD_T |
369 SkDebugf("%s insert t=%1.9g segID=%d spanID=%d\n", __FUNCTION__, t, | 372 SkDebugf("%s insert t=%1.9g segID=%d spanID=%d\n", __FUNCTION__, t, |
370 span->segment()->debugID(), span->debugID()); | 373 span->segment()->debugID(), span->debugID()); |
371 #endif | 374 #endif |
372 span->bumpSpanAdds(); | 375 span->bumpSpanAdds(); |
373 return span->ptT(); | 376 return span->ptT(); |
374 } | 377 } |
(...skipping 1396 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1771 int absOut = SkTAbs(outerWinding); | 1774 int absOut = SkTAbs(outerWinding); |
1772 int absIn = SkTAbs(innerWinding); | 1775 int absIn = SkTAbs(innerWinding); |
1773 bool result = absOut == absIn ? outerWinding < 0 : absOut < absIn; | 1776 bool result = absOut == absIn ? outerWinding < 0 : absOut < absIn; |
1774 return result; | 1777 return result; |
1775 } | 1778 } |
1776 | 1779 |
1777 int SkOpSegment::windSum(const SkOpAngle* angle) const { | 1780 int SkOpSegment::windSum(const SkOpAngle* angle) const { |
1778 const SkOpSpan* minSpan = angle->start()->starter(angle->end()); | 1781 const SkOpSpan* minSpan = angle->start()->starter(angle->end()); |
1779 return minSpan->windSum(); | 1782 return minSpan->windSum(); |
1780 } | 1783 } |
OLD | NEW |