From 48c464a3c4fe12cb43b33666735cf3c26a038e66 Mon Sep 17 00:00:00 2001 From: Cary Clark Date: Mon, 16 Apr 2018 12:06:07 -0400 Subject: 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 Commit-Queue: Cary Clark --- tests/PathTest.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'tests/PathTest.cpp') 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)); } -- cgit v1.2.3