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

Unified Diff: tests/PathTest.cpp

Issue 1601103006: Add SkPath::isLastContourClosed() (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: isClosed -> isLastContourClosed; add braces 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
« no previous file with comments | « src/core/SkPath.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/PathTest.cpp
diff --git a/tests/PathTest.cpp b/tests/PathTest.cpp
index 3c4638d7415facd6e0da7f62aabb3ff128918b80..1048fcd97920242d667ac10df1e4050b87aee478 100644
--- a/tests/PathTest.cpp
+++ b/tests/PathTest.cpp
@@ -818,6 +818,23 @@ static void test_isfinite(skiatest::Reporter* reporter) {
test_path_isfinite(reporter);
}
+static void test_islastcontourclosed(skiatest::Reporter* reporter) {
+ SkPath path;
+ REPORTER_ASSERT(reporter, !path.isLastContourClosed());
+ path.moveTo(0, 0);
+ REPORTER_ASSERT(reporter, !path.isLastContourClosed());
+ path.close();
+ REPORTER_ASSERT(reporter, path.isLastContourClosed());
+ path.lineTo(100, 100);
+ REPORTER_ASSERT(reporter, !path.isLastContourClosed());
+ path.moveTo(200, 200);
+ REPORTER_ASSERT(reporter, !path.isLastContourClosed());
+ path.close();
+ REPORTER_ASSERT(reporter, path.isLastContourClosed());
+ path.moveTo(0, 0);
+ REPORTER_ASSERT(reporter, !path.isLastContourClosed());
+}
+
// assert that we always
// start with a moveTo
// only have 1 moveTo
@@ -4005,6 +4022,7 @@ DEF_TEST(Paths, reporter) {
test_addPoly(reporter);
test_isfinite(reporter);
test_isfinite_after_transform(reporter);
+ test_islastcontourclosed(reporter);
test_arb_round_rect_is_convex(reporter);
test_arb_zero_rad_round_rect_is_rect(reporter);
test_addrect(reporter);
« no previous file with comments | « src/core/SkPath.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698