Correctly stroke zero length segments in multi-contour paths
Bug: skia:
Change-Id: I959287780ef94a258a6746132f3acb9f90e6c6cc
Reviewed-on: https://skia-review.googlesource.com/21863
Reviewed-by: Cary Clark <caryclark@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
diff --git a/src/core/SkPath.cpp b/src/core/SkPath.cpp
index f4c8e8b..2be3251 100644
--- a/src/core/SkPath.cpp
+++ b/src/core/SkPath.cpp
@@ -1192,12 +1192,12 @@
return true;
}
-bool SkPath::isZeroLength() const {
- int count = fPathRef->countPoints();
+bool SkPath::isZeroLengthSincePoint(int startPtIndex) const {
+ int count = fPathRef->countPoints() - startPtIndex;
if (count < 2) {
return true;
}
- const SkPoint* pts = fPathRef.get()->points();
+ const SkPoint* pts = fPathRef.get()->points() + startPtIndex;
const SkPoint& first = *pts;
for (int index = 1; index < count; ++index) {
if (first != pts[index]) {