| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2013 Google Inc. | 2 * Copyright 2013 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 | 7 |
| 8 #include "SkPathOpsDebug.h" | 8 #include "SkPathOpsDebug.h" |
| 9 #include "SkPath.h" | 9 #include "SkPath.h" |
| 10 | 10 |
| 11 #if defined SK_DEBUG || !FORCE_RELEASE | 11 #if defined SK_DEBUG || !FORCE_RELEASE |
| 12 | 12 |
| 13 int SkPathOpsDebug::gMaxWindSum = SK_MaxS32; | 13 const char* SkPathOpsDebug::kLVerbStr[] = {"", "line", "quad", "cubic"}; |
| 14 int SkPathOpsDebug::gMaxWindValue = SK_MaxS32; | |
| 15 | 14 |
| 16 const char* SkPathOpsDebug::kLVerbStr[] = {"", "line", "quad", "cubic"}; | 15 #if defined(SK_DEBUG) || !FORCE_RELEASE |
| 17 int SkPathOpsDebug::gContourID; | 16 int SkPathOpsDebug::gContourID; |
| 18 int SkPathOpsDebug::gSegmentID; | 17 int SkPathOpsDebug::gSegmentID; |
| 18 #endif |
| 19 | 19 |
| 20 #if DEBUG_SORT || DEBUG_SWAP_TOP | 20 #if DEBUG_SORT || DEBUG_SWAP_TOP |
| 21 int SkPathOpsDebug::gSortCountDefault = SK_MaxS32; | 21 int SkPathOpsDebug::gSortCountDefault = SK_MaxS32; |
| 22 int SkPathOpsDebug::gSortCount; | 22 int SkPathOpsDebug::gSortCount; |
| 23 #endif | 23 #endif |
| 24 | 24 |
| 25 #if DEBUG_ACTIVE_OP | 25 #if DEBUG_ACTIVE_OP |
| 26 const char* SkPathOpsDebug::kPathOpStr[] = {"diff", "sect", "union", "xor"}; | 26 const char* SkPathOpsDebug::kPathOpStr[] = {"diff", "sect", "union", "xor"}; |
| 27 #endif | 27 #endif |
| 28 | 28 |
| (...skipping 357 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 386 } | 386 } |
| 387 for (int index = 0; index < fSingletonAngles.count(); ++index) { | 387 for (int index = 0; index < fSingletonAngles.count(); ++index) { |
| 388 if (&fSingletonAngles[index] == angle) { | 388 if (&fSingletonAngles[index] == angle) { |
| 389 return true; | 389 return true; |
| 390 } | 390 } |
| 391 } | 391 } |
| 392 return false; | 392 return false; |
| 393 } | 393 } |
| 394 #endif | 394 #endif |
| 395 | 395 |
| 396 #if DEBUG_SWAP_TOP |
| 397 int SkOpSegment::debugInflections(int tStart, int tEnd) const { |
| 398 if (fVerb != SkPath::kCubic_Verb) { |
| 399 return false; |
| 400 } |
| 401 SkDCubic dst = SkDCubic::SubDivide(fPts, fTs[tStart].fT, fTs[tEnd].fT); |
| 402 double inflections[2]; |
| 403 return dst.findInflections(inflections); |
| 404 } |
| 405 #endif |
| 406 |
| 396 void SkOpSegment::debugReset() { | 407 void SkOpSegment::debugReset() { |
| 397 fTs.reset(); | 408 fTs.reset(); |
| 398 fAngles.reset(); | 409 fAngles.reset(); |
| 399 } | 410 } |
| 400 | 411 |
| 401 #if DEBUG_CONCIDENT | 412 #if DEBUG_CONCIDENT |
| 402 void SkOpSegment::debugShowTs(const char* prefix) const { | 413 void SkOpSegment::debugShowTs(const char* prefix) const { |
| 403 SkDebugf("%s %s id=%d", __FUNCTION__, prefix, fID); | 414 SkDebugf("%s %s id=%d", __FUNCTION__, prefix, fID); |
| 404 int lastWind = -1; | 415 int lastWind = -1; |
| 405 int lastOpp = -1; | 416 int lastOpp = -1; |
| (...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 603 } | 614 } |
| 604 last = &span; | 615 last = &span; |
| 605 hasLoop |= last->fLoop; | 616 hasLoop |= last->fLoop; |
| 606 } | 617 } |
| 607 SK_DEBUGBREAK(done == fDoneSpans); | 618 SK_DEBUGBREAK(done == fDoneSpans); |
| 608 if (fAngles.count() ) { | 619 if (fAngles.count() ) { |
| 609 fAngles.begin()->debugValidateLoop(); | 620 fAngles.begin()->debugValidateLoop(); |
| 610 } | 621 } |
| 611 #endif | 622 #endif |
| 612 } | 623 } |
| OLD | NEW |