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

Unified Diff: src/core/SkPath.cpp

Issue 1601103006: Add SkPath::isLastContourClosed() (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 11 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 side-by-side diff with in-line comments
Download patch
Index: src/core/SkPath.cpp
diff --git a/src/core/SkPath.cpp b/src/core/SkPath.cpp
index 4af2dad5262c97fa15e1717eabd93debfeaa718f..5733aeb58cfc5faf0e80edc145af410aa0ccd8eb 100644
--- a/src/core/SkPath.cpp
+++ b/src/core/SkPath.cpp
@@ -318,6 +318,13 @@ void SkPath::rewind() {
this->resetFields();
}
+bool SkPath::isClosed() const {
+ int verbCount = fPathRef->countVerbs();
+ if (0 == verbCount)
reed1 2016/01/20 16:41:41 nit: skia always uses { } if (0 == verbCount) {
fs 2016/01/20 17:24:43 Done.
+ return false;
+ return kClose_Verb == fPathRef->atVerb(verbCount - 1);
+}
+
bool SkPath::isLine(SkPoint line[2]) const {
int verbCount = fPathRef->countVerbs();
« include/core/SkPath.h ('K') | « include/core/SkPath.h ('k') | tests/PathTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698