Index: src/core/SkPath.cpp |
diff --git a/src/core/SkPath.cpp b/src/core/SkPath.cpp |
index 06bbeef096ba9734cb0a733c7d9b983893ad658a..320448a30e27acf2c3ce381c99d72b4d5d60ce14 100644 |
--- a/src/core/SkPath.cpp |
+++ b/src/core/SkPath.cpp |
@@ -1184,6 +1184,21 @@ bool SkPath::hasOnlyMoveTos() const { |
return true; |
} |
+bool SkPath::isZeroLength() const { |
+ int count = fPathRef->countPoints(); |
+ if (count < 2) { |
+ return true; |
+ } |
+ const SkPoint* pts = fPathRef.get()->points(); |
+ const SkPoint& first = *pts; |
+ for (int index = 1; index < count; ++index) { |
+ if (first != pts[index]) { |
+ return false; |
+ } |
+ } |
+ return true; |
+} |
+ |
void SkPath::addRoundRect(const SkRect& rect, SkScalar rx, SkScalar ry, |
Direction dir) { |
assert_known_direction(dir); |