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

Unified Diff: tests/PathOpsSimplifyTest.cpp

Issue 14407006: path ops -- handle non-finite numbers (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Created 7 years, 8 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
« src/pathops/SkOpEdgeBuilder.cpp ('K') | « tests/PathOpsSimplifyFailTest.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/PathOpsSimplifyTest.cpp
===================================================================
--- tests/PathOpsSimplifyTest.cpp (revision 8862)
+++ tests/PathOpsSimplifyTest.cpp (working copy)
@@ -3652,9 +3652,54 @@
testSimplify(reporter, path);
}
+// A test this for this case:
+// contourA has two segments that are coincident
+// contourB has two segments that are coincident in the same place
+// each ends up with +2/0 pairs for winding count
+// since logic in OpSegment::addTCoincident doesn't transfer count (only increments/decrements)
+// can this be resolved to +4/0 ?
+static void testAddTCoincident1(skiatest::Reporter* reporter) {
+ SkPath path;
+ path.moveTo(2, 0);
+ path.lineTo(2, 2);
+ path.lineTo(1, 1);
+ path.lineTo(2, 0);
+ path.lineTo(2, 2);
+ path.lineTo(1, 1);
+ path.close();
+ path.moveTo(2, 0);
+ path.lineTo(2, 2);
+ path.lineTo(3, 1);
+ path.lineTo(2, 0);
+ path.lineTo(2, 2);
+ path.lineTo(3, 1);
+ path.close();
+ testSimplify(reporter, path);
+}
+
+// test with implicit close
+static void testAddTCoincident2(skiatest::Reporter* reporter) {
+ SkPath path;
+ path.moveTo(2, 0);
+ path.lineTo(2, 2);
+ path.lineTo(1, 1);
+ path.lineTo(2, 0);
+ path.lineTo(2, 2);
+ path.lineTo(1, 1);
+ path.moveTo(2, 0);
+ path.lineTo(2, 2);
+ path.lineTo(3, 1);
+ path.lineTo(2, 0);
+ path.lineTo(2, 2);
+ path.lineTo(3, 1);
+ testSimplify(reporter, path);
+}
+
static void (*firstTest)(skiatest::Reporter* ) = 0;
static TestDesc tests[] = {
+ TEST(testAddTCoincident2),
+ TEST(testAddTCoincident1),
TEST(testTriangles2),
TEST(testTriangles1),
TEST(testQuadratic97),
« src/pathops/SkOpEdgeBuilder.cpp ('K') | « tests/PathOpsSimplifyFailTest.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698