| 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 601 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 612 } | 612 } |
| 613 | 613 |
| 614 SkPathRef::Iter::Iter(const SkPathRef& path) { | 614 SkPathRef::Iter::Iter(const SkPathRef& path) { |
| 615 this->setPathRef(path); | 615 this->setPathRef(path); |
| 616 } | 616 } |
| 617 | 617 |
| 618 void SkPathRef::Iter::setPathRef(const SkPathRef& path) { | 618 void SkPathRef::Iter::setPathRef(const SkPathRef& path) { |
| 619 fPts = path.points(); | 619 fPts = path.points(); |
| 620 fVerbs = path.verbs(); | 620 fVerbs = path.verbs(); |
| 621 fVerbStop = path.verbsMemBegin(); | 621 fVerbStop = path.verbsMemBegin(); |
| 622 fConicWeights = path.conicWeights() - 1; // begin one behind | 622 fConicWeights = path.conicWeights(); |
| 623 if (fConicWeights) { |
| 624 fConicWeights -= 1; // begin one behind |
| 625 } |
| 623 } | 626 } |
| 624 | 627 |
| 625 uint8_t SkPathRef::Iter::next(SkPoint pts[4]) { | 628 uint8_t SkPathRef::Iter::next(SkPoint pts[4]) { |
| 626 SkASSERT(pts); | 629 SkASSERT(pts); |
| 627 if (fVerbs == fVerbStop) { | 630 if (fVerbs == fVerbStop) { |
| 628 return (uint8_t) SkPath::kDone_Verb; | 631 return (uint8_t) SkPath::kDone_Verb; |
| 629 } | 632 } |
| 630 | 633 |
| 631 // fVerbs points one beyond next verb so decrement first. | 634 // fVerbs points one beyond next verb so decrement first. |
| 632 unsigned verb = *(--fVerbs); | 635 unsigned verb = *(--fVerbs); |
| (...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 749 break; | 752 break; |
| 750 default: | 753 default: |
| 751 SkDEBUGFAIL("Unknown Verb"); | 754 SkDEBUGFAIL("Unknown Verb"); |
| 752 break; | 755 break; |
| 753 } | 756 } |
| 754 } | 757 } |
| 755 SkASSERT(mask == fSegmentMask); | 758 SkASSERT(mask == fSegmentMask); |
| 756 #endif // SK_DEBUG_PATH | 759 #endif // SK_DEBUG_PATH |
| 757 } | 760 } |
| 758 #endif | 761 #endif |
| OLD | NEW |