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

Unified Diff: tests/PathTest.cpp

Issue 517023003: Add dirty_after_edit to SkPath::moveTo. Add commented out test case that triggers assert. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: update Created 6 years, 4 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 0de64b06febf5a145245bfa0a9f64eec0229a00e..57587c4a35f9258a74abbb67e24794667c3539cd 100644
--- a/tests/PathTest.cpp
+++ b/tests/PathTest.cpp
@@ -1504,7 +1504,19 @@ static void test_conservativelyContains(skiatest::Reporter* reporter) {
SkIntToScalar(20),
SkIntToScalar(5))));
- // same as above path and first test but with an extra moveTo.
+
+ // Test that multiple move commands do not cause asserts.
+
+ // At the time of writing, this would not modify cached convexity. This caused an assert while
+ // checking conservative containment again. http://skbug.com/1460
+ path.moveTo(SkIntToScalar(100), SkIntToScalar(100));
+#if 0
+ REPORTER_ASSERT(reporter, path.conservativelyContainsRect(SkRect::MakeXYWH(SkIntToScalar(50), 0,
+ SkIntToScalar(10),
+ SkIntToScalar(10))));
+#endif
+
+ // Same as above path and first test but with an extra moveTo.
path.reset();
path.moveTo(100, 100);
path.moveTo(0, 0);
@@ -1515,6 +1527,21 @@ static void test_conservativelyContains(skiatest::Reporter* reporter) {
SkIntToScalar(10),
SkIntToScalar(10))));
+ // Test that multiple move commands do not cause asserts and that the function
+ // is not confused by the multiple moves.
+ path.reset();
+ path.moveTo(0, 0);
+ path.lineTo(SkIntToScalar(100), 0);
+ path.lineTo(0, SkIntToScalar(100));
+ path.moveTo(0, SkIntToScalar(200));
+ path.lineTo(SkIntToScalar(100), SkIntToScalar(200));
+ path.lineTo(0, SkIntToScalar(300));
+
+ REPORTER_ASSERT(reporter, !path.conservativelyContainsRect(
+ SkRect::MakeXYWH(SkIntToScalar(50), 0,
+ SkIntToScalar(10),
+ SkIntToScalar(10))));
+
path.reset();
path.lineTo(100, 100);
REPORTER_ASSERT(reporter, !path.conservativelyContainsRect(SkRect::MakeXYWH(0, 0, 1, 1)));
« 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