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

Unified Diff: tests/PathTest.cpp

Issue 21565002: Make SkPath::conservativelyContainsRect not assert on paths that begin with repeated moveTos (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 7 years, 5 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 6c8f83e5401feef74ed264f99907460e284498a9..e33c912062228589f95e585aaa3b64771c89206b 100644
--- a/tests/PathTest.cpp
+++ b/tests/PathTest.cpp
@@ -1161,6 +1161,18 @@ static void test_conservativelyContains(skiatest::Reporter* reporter) {
SkIntToScalar(200),
SkIntToScalar(20),
SkIntToScalar(5))));
+
+ // same as above path and first test but with an extra moveTo.
+ path.reset();
+ path.moveTo(100, 100);
+ path.moveTo(0, 0);
+ path.lineTo(SkIntToScalar(100), 0);
+ path.lineTo(0, SkIntToScalar(100));
+
+ REPORTER_ASSERT(reporter, path.conservativelyContainsRect(SkRect::MakeXYWH(SkIntToScalar(50), 0,
+ SkIntToScalar(10),
+ SkIntToScalar(10))));
+
}
// Simple isRect test is inline TestPath, below.
« 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