diff options
author | caryclark <caryclark@google.com> | 2014-10-28 10:33:09 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2014-10-28 10:33:09 -0700 |
commit | 6f726addf3178b01949bb389ef83cf14a1d7b6b2 (patch) | |
tree | f075358dcfe429a50ba7b3c67e26c95d4dc9277d /tests/PathOpsSkpTest.cpp | |
parent | 8f0d69e48eef2b87d0149729adcfa058e8c42c81 (diff) |
These tests stress pathops by describing the union of circle-like paths that have tiny line segments embedded and double back to create near-coincident conditions.
The fixes include
- detect when finding the active top loops between two possible answers
- preflight chasing winding to ensure answer is consistent
- binary search more often when quadratic intersection fails
- add more failure paths when an intersect is missed
While this fixes the chrome bug, reenabling path ops in svg should be deferred until additional fixes are landed.
TBR=
BUG=421132
Review URL: https://codereview.chromium.org/633393002
Diffstat (limited to 'tests/PathOpsSkpTest.cpp')
-rwxr-xr-x | tests/PathOpsSkpTest.cpp | 23 |
1 files changed, 10 insertions, 13 deletions
diff --git a/tests/PathOpsSkpTest.cpp b/tests/PathOpsSkpTest.cpp index 32ddf61f43..6af790f72a 100755 --- a/tests/PathOpsSkpTest.cpp +++ b/tests/PathOpsSkpTest.cpp @@ -8,8 +8,6 @@ #define TEST(name) { name, #name } -#define TEST_NEW_FAILURES 0 - static void skpcheeseandburger_com225(skiatest::Reporter* reporter, const char* filename) { SkPath path; path.setFillType(SkPath::kEvenOdd_FillType); @@ -3590,7 +3588,6 @@ static void skpwww_googleventures_com_32(skiatest::Reporter* reporter, const cha testPathOp(reporter, path, pathB, kIntersect_PathOp, filename); } -#if TEST_NEW_FAILURES static void skpwww_devbridge_com_22(skiatest::Reporter* reporter, const char* filename) { SkPath path; path.setFillType(SkPath::kEvenOdd_FillType); @@ -3616,10 +3613,14 @@ static void skpwww_devbridge_com_22(skiatest::Reporter* reporter, const char* fi pathB.quadTo(4942.75146f, 1523, 4962.375f, 1542.6239f); pathB.quadTo(4981.99902f, 1562.24768f, 4981.99902f, 1590); pathB.close(); - testPathOp(reporter, path, pathB, kIntersect_PathOp, filename); + if (FLAGS_runFail) { + testPathOp(reporter, path, pathB, kIntersect_PathOp, filename); + } else { + // INVESTIGATE : why this normal test takes fail case (test has never worked) + testPathFailOp(reporter, path, pathB, kIntersect_PathOp, filename); + } } -// cubic/quad intersection static void skpwww_alamdi_com_3(skiatest::Reporter* reporter, const char* filename) { SkPath path; path.setFillType(SkPath::kEvenOdd_FillType); @@ -3652,7 +3653,6 @@ static void skpwww_alamdi_com_3(skiatest::Reporter* reporter, const char* filena testPathOp(reporter, path, pathB, kIntersect_PathOp, filename); } -// bumpSpan failed assertion "span->fOppValue >= 0" static void skpwww_familysurvivalprotocol_wordpress_com_61(skiatest::Reporter* reporter, const char* filename) { SkPath path; path.setFillType(SkPath::kEvenOdd_FillType); @@ -3670,7 +3670,6 @@ static void skpwww_familysurvivalprotocol_wordpress_com_61(skiatest::Reporter* r pathB.lineTo(165, 14557); testPathOp(reporter, path, pathB, kIntersect_PathOp, filename); } -#endif static void skpwww_firstunitedbank_com_19(skiatest::Reporter* reporter, const char* filename) { SkPath path; @@ -3761,8 +3760,6 @@ static void skpwww_lptemp_com_3(skiatest::Reporter* reporter, const char* filena testPathOp(reporter, path, pathB, kIntersect_PathOp, filename); } -#if TEST_NEW_FAILURES -// SkOpSegment.cpp:3915: failed assertion "otherEnd >= 0" static void skpwww_shinydemos_com_15(skiatest::Reporter* reporter, const char* filename) { SkPath path; path.setFillType(SkPath::kEvenOdd_FillType); @@ -3786,6 +3783,9 @@ static void skpwww_shinydemos_com_15(skiatest::Reporter* reporter, const char* f // SkOpSegment.cpp:4398: failed assertion "!span->fDone" static void skpwww_lptemp_com_5(skiatest::Reporter* reporter, const char* filename) { + if (/* 0 && */ !FLAGS_runFail) { // has never worked MUST BE FIXED BEFORE NEXT CHECKIN + return; + } SkPath path; path.setFillType(SkPath::kEvenOdd_FillType); path.moveTo(78.6429825f, 3150.97632f); @@ -3814,22 +3814,19 @@ static void skpwww_lptemp_com_5(skiatest::Reporter* reporter, const char* filena pathB.lineTo(77.6666718f, 3153.3335f); pathB.cubicTo(77.6666718f, 3151.49268f, 79.15905f, 3150, 81, 3150); pathB.close(); - testPathOp(reporter, path, pathB, kIntersect_PathOp, filename); + testPathOpCheck(reporter, path, pathB, kIntersect_PathOp, filename, FLAGS_runFail); } -#endif static void (*firstTest)(skiatest::Reporter* , const char* filename) = 0; static struct TestDesc tests[] = { TEST(skpwww_lptemp_com_3), TEST(skpwww_shinydemos_com_5), -#if TEST_NEW_FAILURES TEST(skpwww_lptemp_com_5), TEST(skpwww_shinydemos_com_15), TEST(skpwww_familysurvivalprotocol_wordpress_com_61), TEST(skpwww_alamdi_com_3), TEST(skpwww_devbridge_com_22), -#endif TEST(skpwww_firstunitedbank_com_19), TEST(skpwww_googleventures_com_32), TEST(skpwww_9to5mac_com_64), |