path is rect bug number nine
This variation exploits a sequence which uses a zero
length line to note that lines have been recorded, but
no rectangle edge has been encountered.
R=robertphillips@google.com
Docs-Preview: https://skia.org/?cl=121282
Bug: 824145,skia:7792
Change-Id: I652e9482b2867c3d7da30d5f5df2aecbfd0d716d
Reviewed-on: https://skia-review.googlesource.com/121282
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Cary Clark <caryclark@skia.org>
diff --git a/tests/PathTest.cpp b/tests/PathTest.cpp
index b96b93c..8ac6e02 100644
--- a/tests/PathTest.cpp
+++ b/tests/PathTest.cpp
@@ -4930,7 +4930,7 @@
}
return path;
};
- // isolated from skbug.com/7792 bug description
+ // isolated from skbug.com/7792 (bug description)
SkRect rect;
SkPoint points[] = { {10, 10}, {75, 75}, {150, 75}, {150, 150}, {75, 150} };
SkPath path = makePath(points, SK_ARRAY_COUNT(points), false);
@@ -4938,17 +4938,17 @@
SkRect compare;
compare.set(&points[1], SK_ARRAY_COUNT(points) - 1);
REPORTER_ASSERT(reporter, rect == compare);
- // isolated from skbug.com/7792 comment 3
+ // isolated from skbug.com/7792#c3
SkPoint points3[] = { {75, 50}, {100, 75}, {150, 75}, {150, 150}, {75, 150}, {75, 50} };
path = makePath(points3, SK_ARRAY_COUNT(points3), true);
REPORTER_ASSERT(reporter, !path.isRect(&rect, nullptr, nullptr));
- // isolated from skbug.com/7792 comment 9
+ // isolated from skbug.com/7792#c9
SkPoint points9[] = { {10, 10}, {75, 75}, {150, 75}, {150, 150}, {75, 150} };
path = makePath(points9, SK_ARRAY_COUNT(points9), true);
REPORTER_ASSERT(reporter, path.isRect(&rect, nullptr, nullptr));
compare.set(&points9[1], SK_ARRAY_COUNT(points9) - 1);
REPORTER_ASSERT(reporter, rect == compare);
- // isolated from skbug.com/7792 comment 11
+ // isolated from skbug.com/7792#c11
SkPath::Verb verbs11[] = { SkPath::kMove_Verb, SkPath::kLine_Verb, SkPath::kLine_Verb,
SkPath::kLine_Verb, SkPath::kLine_Verb, SkPath::kMove_Verb };
SkPoint points11[] = { {75, 150}, {75, 75}, {150, 75}, {150, 150}, {75, 150}, {75, 150} };
@@ -4956,7 +4956,7 @@
REPORTER_ASSERT(reporter, path.isRect(&rect, nullptr, nullptr));
compare.set(&points11[0], SK_ARRAY_COUNT(points11));
REPORTER_ASSERT(reporter, rect == compare);
- // isolated from skbug.com/7792 comment 14
+ // isolated from skbug.com/7792#c14
SkPath::Verb verbs14[] = { SkPath::kMove_Verb, SkPath::kMove_Verb, SkPath::kMove_Verb,
SkPath::kMove_Verb, SkPath::kLine_Verb, SkPath::kLine_Verb,
SkPath::kLine_Verb, SkPath::kLine_Verb, SkPath::kClose_Verb,
@@ -4965,7 +4965,7 @@
{150, 75}, {150, 150}, {75, 150}, {75, 75}, {0, 0} };
path = makePath2(points14, verbs14, SK_ARRAY_COUNT(verbs14));
REPORTER_ASSERT(reporter, !path.isRect(&rect, nullptr, nullptr));
- // isolated from skbug.com/7792 comment 15
+ // isolated from skbug.com/7792#c15
SkPath::Verb verbs15[] = { SkPath::kMove_Verb, SkPath::kLine_Verb, SkPath::kLine_Verb,
SkPath::kLine_Verb, SkPath::kMove_Verb };
SkPoint points15[] = { {75, 75}, {150, 75}, {150, 150}, {75, 150}, {250, 75} };
@@ -4973,11 +4973,11 @@
REPORTER_ASSERT(reporter, path.isRect(&rect, nullptr, nullptr));
compare.set(&points15[0], SK_ARRAY_COUNT(points15) - 1);
REPORTER_ASSERT(reporter, rect == compare);
- // isolated from skbug.com/7792 comment 17
+ // isolated from skbug.com/7792#c17
SkPoint points17[] = { {75, 10}, {75, 75}, {150, 75}, {150, 150}, {75, 150}, {75, 10} };
path = makePath(points17, SK_ARRAY_COUNT(points17), true);
REPORTER_ASSERT(reporter, !path.isRect(&rect, nullptr, nullptr));
- // isolated from skbug.com/7792 comment 19
+ // isolated from skbug.com/7792#c19
SkPath::Verb verbs19[] = { SkPath::kMove_Verb, SkPath::kLine_Verb, SkPath::kLine_Verb,
SkPath::kLine_Verb, SkPath::kLine_Verb, SkPath::kLine_Verb,
SkPath::kLine_Verb, SkPath::kClose_Verb, SkPath::kMove_Verb,
@@ -4986,4 +4986,14 @@
{75, 150}, {10, 10}, {30, 10}, {10, 30} };
path = makePath2(points19, verbs19, SK_ARRAY_COUNT(verbs19));
REPORTER_ASSERT(reporter, !path.isRect(&rect, nullptr, nullptr));
+ // isolated from skbug.com/7792#c23
+ SkPath::Verb verbs23[] = { SkPath::kMove_Verb, SkPath::kLine_Verb, SkPath::kMove_Verb,
+ SkPath::kLine_Verb, SkPath::kLine_Verb, SkPath::kLine_Verb,
+ SkPath::kLine_Verb, SkPath::kClose_Verb };
+ SkPoint points23[] = { {75, 75}, {75, 75}, {75, 75}, {75, 75}, {150, 75}, {150, 150},
+ {75, 150} };
+ path = makePath2(points23, verbs23, SK_ARRAY_COUNT(verbs23));
+ REPORTER_ASSERT(reporter, path.isRect(&rect, nullptr, nullptr));
+ compare.set(&points23[0], SK_ARRAY_COUNT(points23));
+ REPORTER_ASSERT(reporter, rect == compare);
}