| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2006 The Android Open Source Project | 2 * Copyright 2006 The Android Open Source Project |
| 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 "SkErrorInternals.h" | 9 #include "SkErrorInternals.h" |
| 10 #include "SkGeometry.h" | 10 #include "SkGeometry.h" |
| (...skipping 613 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 624 *lastPt = fPathRef->atPoint(count - 1); | 624 *lastPt = fPathRef->atPoint(count - 1); |
| 625 } | 625 } |
| 626 return true; | 626 return true; |
| 627 } | 627 } |
| 628 if (lastPt) { | 628 if (lastPt) { |
| 629 lastPt->set(0, 0); | 629 lastPt->set(0, 0); |
| 630 } | 630 } |
| 631 return false; | 631 return false; |
| 632 } | 632 } |
| 633 | 633 |
| 634 void SkPath::setPt(int index, SkScalar x, SkScalar y) { |
| 635 SkDEBUGCODE(this->validate();) |
| 636 |
| 637 int count = fPathRef->countPoints(); |
| 638 if (count <= index) { |
| 639 return; |
| 640 } else { |
| 641 SkPathRef::Editor ed(&fPathRef); |
| 642 ed.atPoint(index)->set(x, y); |
| 643 } |
| 644 } |
| 645 |
| 634 void SkPath::setLastPt(SkScalar x, SkScalar y) { | 646 void SkPath::setLastPt(SkScalar x, SkScalar y) { |
| 635 SkDEBUGCODE(this->validate();) | 647 SkDEBUGCODE(this->validate();) |
| 636 | 648 |
| 637 int count = fPathRef->countPoints(); | 649 int count = fPathRef->countPoints(); |
| 638 if (count == 0) { | 650 if (count == 0) { |
| 639 this->moveTo(x, y); | 651 this->moveTo(x, y); |
| 640 } else { | 652 } else { |
| 641 SkPathRef::Editor ed(&fPathRef); | 653 SkPathRef::Editor ed(&fPathRef); |
| 642 ed.atPoint(count-1)->set(x, y); | 654 ed.atPoint(count-1)->set(x, y); |
| 643 } | 655 } |
| (...skipping 2136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2780 switch (this->getFillType()) { | 2792 switch (this->getFillType()) { |
| 2781 case SkPath::kEvenOdd_FillType: | 2793 case SkPath::kEvenOdd_FillType: |
| 2782 case SkPath::kInverseEvenOdd_FillType: | 2794 case SkPath::kInverseEvenOdd_FillType: |
| 2783 w &= 1; | 2795 w &= 1; |
| 2784 break; | 2796 break; |
| 2785 default: | 2797 default: |
| 2786 break; | 2798 break; |
| 2787 } | 2799 } |
| 2788 return SkToBool(w); | 2800 return SkToBool(w); |
| 2789 } | 2801 } |
| OLD | NEW |