aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests
diff options
context:
space:
mode:
authorGravatar Cary Clark <caryclark@skia.org>2018-04-16 12:06:07 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-04-17 11:46:53 +0000
commit48c464a3c4fe12cb43b33666735cf3c26a038e66 (patch)
tree02c8e94496d6a068bc144df81b9464e29b188fcb /tests
parent93b4ddd347fd75b9ee230c0f43165bec6ee73eaf (diff)
a more involved path is rect bug
This is bug number ten in the series, and is the most interesting. It exploits that the code tracks corners 0, 2, and 3 but not corner 1. Changing the code to track all corners is the biggest so far, and while it (hopefully) simplifies things, the presence of new code may signify more bugs to come. R=robertphillips@google.com Bug: 824145,skia::7792 Change-Id: Ia18e4d80fbed06ae6d9c89dcb4c462c5610213cc Reviewed-on: https://skia-review.googlesource.com/121487 Reviewed-by: Robert Phillips <robertphillips@google.com> Commit-Queue: Cary Clark <caryclark@google.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/PathTest.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/PathTest.cpp b/tests/PathTest.cpp
index 8ac6e02e17..38b5bf7424 100644
--- a/tests/PathTest.cpp
+++ b/tests/PathTest.cpp
@@ -4996,4 +4996,11 @@ DEF_TEST(Path_isRect, reporter) {
REPORTER_ASSERT(reporter, path.isRect(&rect, nullptr, nullptr));
compare.set(&points23[0], SK_ARRAY_COUNT(points23));
REPORTER_ASSERT(reporter, rect == compare);
+ // isolated from skbug.com/7792#c29
+ SkPath::Verb verbs29[] = { SkPath::kMove_Verb, SkPath::kLine_Verb, SkPath::kLine_Verb,
+ SkPath::kLine_Verb, SkPath::kLine_Verb, SkPath::kMove_Verb,
+ SkPath::kClose_Verb };
+ SkPoint points29[] = { {75, 75}, {150, 75}, {150, 150}, {75, 150}, {75, 250}, {75, 75} };
+ path = makePath2(points29, verbs29, SK_ARRAY_COUNT(verbs29));
+ REPORTER_ASSERT(reporter, !path.isRect(&rect, nullptr, nullptr));
}