diff options
author | 2011-10-11 11:58:32 +0000 | |
---|---|---|
committer | 2011-10-11 11:58:32 +0000 | |
commit | 294dd7b3d7b55ba38881cd4cabb6636abda23eb9 (patch) | |
tree | 470ff13c1a59c491c004bc872fea8e30c0ca304c /src | |
parent | 5e2457ef2eba0c3f2e4c8fc89be7f36659e4f3b1 (diff) |
change getLastPt to return a bool
git-svn-id: http://skia.googlecode.com/svn/trunk@2453 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src')
-rw-r--r-- | src/core/SkPath.cpp | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/src/core/SkPath.cpp b/src/core/SkPath.cpp index 5e10f1bb13..10569fd883 100644 --- a/src/core/SkPath.cpp +++ b/src/core/SkPath.cpp @@ -327,17 +327,20 @@ SkPoint SkPath::getPoint(int index) const { return SkPoint::Make(0, 0); } -void SkPath::getLastPt(SkPoint* lastPt) const { +bool SkPath::getLastPt(SkPoint* lastPt) const { SkDEBUGCODE(this->validate();) - if (lastPt) { - int count = fPts.count(); - if (count == 0) { - lastPt->set(0, 0); - } else { + int count = fPts.count(); + if (count > 0) { + if (lastPt) { *lastPt = fPts[count - 1]; } + return true; + } + if (lastPt) { + lastPt->set(0, 0); } + return false; } void SkPath::setLastPt(SkScalar x, SkScalar y) { |