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 "SkOnce.h" | 9 #include "SkOnce.h" |
10 #include "SkPath.h" | 10 #include "SkPath.h" |
(...skipping 657 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
668 return (uint8_t) verb; | 668 return (uint8_t) verb; |
669 } | 669 } |
670 | 670 |
671 uint8_t SkPathRef::Iter::peek() const { | 671 uint8_t SkPathRef::Iter::peek() const { |
672 const uint8_t* next = fVerbs - 1; | 672 const uint8_t* next = fVerbs - 1; |
673 return next <= fVerbStop ? (uint8_t) SkPath::kDone_Verb : *next; | 673 return next <= fVerbStop ? (uint8_t) SkPath::kDone_Verb : *next; |
674 } | 674 } |
675 | 675 |
676 #ifdef SK_DEBUG | 676 #ifdef SK_DEBUG |
677 void SkPathRef::validate() const { | 677 void SkPathRef::validate() const { |
678 this->INHERITED::validate(); | |
679 SkASSERT(static_cast<ptrdiff_t>(fFreeSpace) >= 0); | 678 SkASSERT(static_cast<ptrdiff_t>(fFreeSpace) >= 0); |
680 SkASSERT(reinterpret_cast<intptr_t>(fVerbs) - reinterpret_cast<intptr_t>(fPo
ints) >= 0); | 679 SkASSERT(reinterpret_cast<intptr_t>(fVerbs) - reinterpret_cast<intptr_t>(fPo
ints) >= 0); |
681 SkASSERT((nullptr == fPoints) == (nullptr == fVerbs)); | 680 SkASSERT((nullptr == fPoints) == (nullptr == fVerbs)); |
682 SkASSERT(!(nullptr == fPoints && 0 != fFreeSpace)); | 681 SkASSERT(!(nullptr == fPoints && 0 != fFreeSpace)); |
683 SkASSERT(!(nullptr == fPoints && 0 != fFreeSpace)); | 682 SkASSERT(!(nullptr == fPoints && 0 != fFreeSpace)); |
684 SkASSERT(!(nullptr == fPoints && fPointCnt)); | 683 SkASSERT(!(nullptr == fPoints && fPointCnt)); |
685 SkASSERT(!(nullptr == fVerbs && fVerbCnt)); | 684 SkASSERT(!(nullptr == fVerbs && fVerbCnt)); |
686 SkASSERT(this->currSize() == | 685 SkASSERT(this->currSize() == |
687 fFreeSpace + sizeof(SkPoint) * fPointCnt + sizeof(uint8_t) * fVe
rbCnt); | 686 fFreeSpace + sizeof(SkPoint) * fPointCnt + sizeof(uint8_t) * fVe
rbCnt); |
688 | 687 |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
749 break; | 748 break; |
750 default: | 749 default: |
751 SkDEBUGFAIL("Unknown Verb"); | 750 SkDEBUGFAIL("Unknown Verb"); |
752 break; | 751 break; |
753 } | 752 } |
754 } | 753 } |
755 SkASSERT(mask == fSegmentMask); | 754 SkASSERT(mask == fSegmentMask); |
756 #endif // SK_DEBUG_PATH | 755 #endif // SK_DEBUG_PATH |
757 } | 756 } |
758 #endif | 757 #endif |
OLD | NEW |