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 "SkBuffer.h" | 8 #include "SkBuffer.h" |
9 #include "SkLazyPtr.h" | 9 #include "SkLazyPtr.h" |
10 #include "SkPath.h" | 10 #include "SkPath.h" |
(...skipping 434 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
445 SkASSERT(!(NULL == fPoints && 0 != fFreeSpace)); | 445 SkASSERT(!(NULL == fPoints && 0 != fFreeSpace)); |
446 SkASSERT(!(NULL == fPoints && 0 != fFreeSpace)); | 446 SkASSERT(!(NULL == fPoints && 0 != fFreeSpace)); |
447 SkASSERT(!(NULL == fPoints && fPointCnt)); | 447 SkASSERT(!(NULL == fPoints && fPointCnt)); |
448 SkASSERT(!(NULL == fVerbs && fVerbCnt)); | 448 SkASSERT(!(NULL == fVerbs && fVerbCnt)); |
449 SkASSERT(this->currSize() == | 449 SkASSERT(this->currSize() == |
450 fFreeSpace + sizeof(SkPoint) * fPointCnt + sizeof(uint8_t) * fVe
rbCnt); | 450 fFreeSpace + sizeof(SkPoint) * fPointCnt + sizeof(uint8_t) * fVe
rbCnt); |
451 | 451 |
452 if (!fBoundsIsDirty && !fBounds.isEmpty()) { | 452 if (!fBoundsIsDirty && !fBounds.isEmpty()) { |
453 bool isFinite = true; | 453 bool isFinite = true; |
454 for (int i = 0; i < fPointCnt; ++i) { | 454 for (int i = 0; i < fPointCnt; ++i) { |
| 455 #ifdef SK_DEBUG |
| 456 if (fPoints[i].isFinite() && |
| 457 (fPoints[i].fX < fBounds.fLeft || fPoints[i].fX > fBounds.fRight
|| |
| 458 fPoints[i].fY < fBounds.fTop || fPoints[i].fY > fBounds.fBottom
)) { |
| 459 SkDebugf("bounds: %f %f %f %f\n", |
| 460 fBounds.fLeft, fBounds.fTop, fBounds.fRight, fBounds.fB
ottom); |
| 461 for (int j = 0; j < fPointCnt; ++j) { |
| 462 if (i == j) { |
| 463 SkDebugf("*"); |
| 464 } |
| 465 SkDebugf("%f %f\n", fPoints[j].fX, fPoints[j].fY); |
| 466 } |
| 467 } |
| 468 #endif |
| 469 |
455 SkASSERT(!fPoints[i].isFinite() || | 470 SkASSERT(!fPoints[i].isFinite() || |
456 (fPoints[i].fX >= fBounds.fLeft && fPoints[i].fX <= fBounds
.fRight && | 471 (fPoints[i].fX >= fBounds.fLeft && fPoints[i].fX <= fBounds
.fRight && |
457 fPoints[i].fY >= fBounds.fTop && fPoints[i].fY <= fBounds.
fBottom)); | 472 fPoints[i].fY >= fBounds.fTop && fPoints[i].fY <= fBounds.
fBottom)); |
458 if (!fPoints[i].isFinite()) { | 473 if (!fPoints[i].isFinite()) { |
459 isFinite = false; | 474 isFinite = false; |
460 } | 475 } |
461 } | 476 } |
462 SkASSERT(SkToBool(fIsFinite) == isFinite); | 477 SkASSERT(SkToBool(fIsFinite) == isFinite); |
463 } | 478 } |
464 | 479 |
(...skipping 22 matching lines...) Expand all Loading... |
487 break; | 502 break; |
488 default: | 503 default: |
489 SkDEBUGFAIL("Unknown Verb"); | 504 SkDEBUGFAIL("Unknown Verb"); |
490 break; | 505 break; |
491 } | 506 } |
492 } | 507 } |
493 SkASSERT(mask == fSegmentMask); | 508 SkASSERT(mask == fSegmentMask); |
494 #endif // SK_DEBUG_PATH | 509 #endif // SK_DEBUG_PATH |
495 } | 510 } |
496 #endif | 511 #endif |
OLD | NEW |