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

Unified Diff: tests/PathTest.cpp

Issue 834483002: Fix bound returned by SkPath::isRect when the path contains a trailing moveTo (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years 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 2ec54d79fa0ea2b438d6a6cbdb7361d43b8295f8..960cdc3b16ab44ef43c6f70196339778ba1ed4ce 100644
--- a/tests/PathTest.cpp
+++ b/tests/PathTest.cpp
@@ -3712,6 +3712,20 @@ DEF_TEST(Paths, reporter) {
p.addRect(bounds);
REPORTER_ASSERT(reporter, !p.isRect(NULL));
+ // Test an edge case w.r.t. the bound returned by isRect (i.e., the
+ // path has a trailing moveTo. Please see crbug.com\445368)
+ {
+ SkRect r;
+ p.reset();
+ p.addRect(bounds);
+ REPORTER_ASSERT(reporter, p.isRect(&r));
+ REPORTER_ASSERT(reporter, r == bounds);
+ // add a moveTo outside of our bounds
+ p.moveTo(bounds.fLeft + 10, bounds.fBottom + 10);
+ REPORTER_ASSERT(reporter, p.isRect(&r));
+ REPORTER_ASSERT(reporter, r == bounds);
+ }
+
test_operatorEqual(reporter);
test_isLine(reporter);
test_isRect(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