Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1)

Side by Side Diff: src/core/SkPath.cpp

Issue 1107353004: align top and bounds computations (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: clean up code Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « include/core/SkPath.h ('k') | src/pathops/SkDCubicLineIntersection.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « include/core/SkPath.h ('k') | src/pathops/SkDCubicLineIntersection.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698