From ccec0f958ffc71a9986d236bc2eb335cb2111119 Mon Sep 17 00:00:00 2001 From: caryclark Date: Tue, 24 Mar 2015 07:28:17 -0700 Subject: pathops version two R=reed@google.com marked 'no commit' to attempt to get trybots to run TBR=reed@google.com Review URL: https://codereview.chromium.org/1002693002 --- tests/PathOpsSkpTest.cpp | 109 ++++++++++++++--------------------------------- 1 file changed, 31 insertions(+), 78 deletions(-) (limited to 'tests/PathOpsSkpTest.cpp') diff --git a/tests/PathOpsSkpTest.cpp b/tests/PathOpsSkpTest.cpp index 6af790f72a..58a69ad1ea 100755 --- a/tests/PathOpsSkpTest.cpp +++ b/tests/PathOpsSkpTest.cpp @@ -896,19 +896,6 @@ static void skpsd_graphic_net104(skiatest::Reporter* reporter, const char* filen testPathOp(reporter, path, pathB, kIntersect_PathOp, filename); } -/* this cubic/quad pair - c = 430,280 430,278.895416 473.876068,278 528,278 - q = 430,280 430.009796,277.101196 458.703552,275.050262 - only intersect at the shared point (430,280) - they sort backwards because the tangent from pt[0] to control pt[1] - c' = (0.00000000000000000, -1.1045837402343750) - q' = (0.0097961425781250000, -2.8988037109375000) - suggests that the quad is counterclockwise of the cubic, when the reverse is true - the angle code is fooled because the control pt[1] of both the quad and cubic - is far away from cubic cntl [2] and quad pt [2]. - Maybe in angle setup, this instability can be detected to suppress sorting on the initial tangent - Or the error term can be passed to NearRay that is magnified by the distance from the next ctrl? - */ static void skpnaoxrane_ru23(skiatest::Reporter* reporter, const char* filename) { SkPath path; path.setFillType(SkPath::kEvenOdd_FillType); @@ -941,11 +928,6 @@ static void skpnaoxrane_ru23(skiatest::Reporter* reporter, const char* filename) testPathOp(reporter, path, pathB, kIntersect_PathOp, filename); } -/* didn't investigate thoroughly, but looks to be missorting quad and cubic - {{468.507751,560.724426}, {467.275146,552.856262}, {465.84668,547.288391}} - {{463.779907,542.671143}, {464.829529,542.672974}, {466.946289,550.755676}, {468.507751,560.724426}} - decision maker is case 14 leftLessThanRight - */ static void skptcmevents_org23(skiatest::Reporter* reporter, const char* filename) { SkPath path; path.setFillType(SkPath::kEvenOdd_FillType); @@ -1079,7 +1061,7 @@ static void skpmlk_com326(skiatest::Reporter* reporter, const char* filename) { pathB.lineTo(149, 675); pathB.cubicTo(149, 672.790833f, 151.238571f, 671, 154, 671); pathB.close(); - testPathOp(reporter, path, pathB, kIntersect_PathOp, filename); + testPathOpCheck(reporter, path, pathB, kIntersect_PathOp, filename, FLAGS_runFail); } static void skpcyclist_friends_gr52(skiatest::Reporter* reporter, const char* filename) { @@ -1105,10 +1087,12 @@ static void skpcyclist_friends_gr52(skiatest::Reporter* reporter, const char* fi pathB.cubicTo(52.238575f, 207, 50, 204.761429f, 50, 202); pathB.lineTo(50, 183); pathB.close(); + // FIXME: this generates quads and cubics that are (correctly) not coincident unlike the old code + // however, somewhere the angles are sorted incorrectly and the winding is computed to be -1/-2 + // but I can't find the error testPathOp(reporter, path, pathB, kIntersect_PathOp, filename); } -/* cubic ends just above opp line */ static void skpwww_fj_p_com_22(skiatest::Reporter* reporter, const char* filename) { SkPath path; path.setFillType(SkPath::kEvenOdd_FillType); @@ -1128,7 +1112,6 @@ static void skpwww_fj_p_com_22(skiatest::Reporter* reporter, const char* filenam testPathOp(reporter, path, pathB, kIntersect_PathOp, filename); } -// pair of lines are not quite coincident, so sorting line/cubic fails (i think) static void skpwww_lavoixdunord_fr_11(skiatest::Reporter* reporter, const char* filename) { SkPath path; path.setFillType(SkPath::kEvenOdd_FillType); @@ -1161,9 +1144,6 @@ static void skpwww_lavoixdunord_fr_11(skiatest::Reporter* reporter, const char* testPathOp(reporter, path, pathB, kIntersect_PathOp, filename); } -// pair of curves have nearly the same initial tangent but are sorting by -// that alone sorts them incorrectly. Need to detect that tangents are nearly -// identical and not reliable by themselves static void skppptv_com_62(skiatest::Reporter* reporter, const char* filename) { SkPath path; path.setFillType(SkPath::kEvenOdd_FillType); @@ -1190,7 +1170,6 @@ static void skppptv_com_62(skiatest::Reporter* reporter, const char* filename) { testPathOp(reporter, path, pathB, kIntersect_PathOp, filename); } -// nearly identical to lavoixdunord -- to not-quite-coincident lines static void skpwww_booking_com_68(skiatest::Reporter* reporter, const char* filename) { SkPath path; path.setFillType(SkPath::kEvenOdd_FillType); @@ -1223,7 +1202,6 @@ static void skpwww_booking_com_68(skiatest::Reporter* reporter, const char* file testPathOp(reporter, path, pathB, kIntersect_PathOp, filename); } -// visually looks like lavoixdunord and www_booking_com static void skpwww_despegar_com_mx_272(skiatest::Reporter* reporter, const char* filename) { SkPath path; path.setFillType(SkPath::kEvenOdd_FillType); @@ -1583,11 +1561,6 @@ static void skpskpicture15(skiatest::Reporter* reporter, const char* filename) { testPathOp(reporter, path, pathB, kIntersect_PathOp, filename); } -/* Three edges are partially coincident. Only one of the three knows about the other two. - Subsequently, when the angle loop is created, it misses one of the edges. - After coincident edges are processed, probably need a check-and-correct that makes sure the - coincidences are all self-consistent. - */ static void skpelpais_com_18(skiatest::Reporter* reporter, const char* filename) { SkPath path; path.setFillType(SkPath::kEvenOdd_FillType); @@ -1606,13 +1579,6 @@ static void skpelpais_com_18(skiatest::Reporter* reporter, const char* filename) testPathOp(reporter, path, pathB, kIntersect_PathOp, filename); } -/* this generates a pair of lines that are essentially coincident; but the next line at a right - angle is not treated as if it intersects at the same point. - There are several of options: - move the intersection of the right angle line to the coincident point (should 'near' do this? - construct another coincident pair from the right angle line to the coincident point - treat the intersection as simple and not coincident - */ static void skpnamecheap_com_405(skiatest::Reporter* reporter, const char* filename) { SkPath path; path.setFillType(SkPath::kEvenOdd_FillType); @@ -1631,7 +1597,6 @@ static void skpnamecheap_com_405(skiatest::Reporter* reporter, const char* filen testPathOp(reporter, path, pathB, kIntersect_PathOp, filename); } -// fails on angle insert -- haven't investigated yet static void skpwww_alrakoba_net_62(skiatest::Reporter* reporter, const char* filename) { SkPath path; path.setFillType(SkPath::kEvenOdd_FillType); @@ -1657,7 +1622,6 @@ static void skpwww_alrakoba_net_62(skiatest::Reporter* reporter, const char* fil testPathOp(reporter, path, pathB, kIntersect_PathOp, filename); } -/* asserts in alignSpanState looks like a coincident related bug */ static void skpwww_cityads_ru_249(skiatest::Reporter* reporter, const char* filename) { SkPath path; path.setFillType(SkPath::kEvenOdd_FillType); @@ -1694,7 +1658,6 @@ static void skpwww_cityads_ru_249(skiatest::Reporter* reporter, const char* file testPathOp(reporter, path, pathB, kIntersect_PathOp, filename); } -// fails on angle insert static void skpwww_dealnews_com_315(skiatest::Reporter* reporter, const char* filename) { SkPath path; path.setFillType(SkPath::kEvenOdd_FillType); @@ -1721,7 +1684,6 @@ static void skpwww_dealnews_com_315(skiatest::Reporter* reporter, const char* fi testPathOp(reporter, path, pathB, kIntersect_PathOp, filename); } -// fails in intersections insert static void skpwww_inmotionhosting_com_9(skiatest::Reporter* reporter, const char* filename) { SkPath path; path.setFillType(SkPath::kEvenOdd_FillType); @@ -1766,7 +1728,6 @@ static void skpwww_alucinados_net_101(skiatest::Reporter* reporter, const char* testPathOp(reporter, path, pathB, kIntersect_PathOp, filename); } -// /SkOpContour.cpp:278: failed assertion "!approximately_negative(oEndT - oStartT) static void skpwww_hairjobsearch_com_31(skiatest::Reporter* reporter, const char* filename) { SkPath path; path.setFillType(SkPath::kEvenOdd_FillType); @@ -1787,7 +1748,6 @@ static void skpwww_hairjobsearch_com_31(skiatest::Reporter* reporter, const char testPathOp(reporter, path, pathB, kIntersect_PathOp, filename); } -// SkOpSegment::checkSmallCoincidence; line 1958 SkASSERT(span.fWindValue); static void skpwww_heartiste_wordpress_com_86(skiatest::Reporter* reporter, const char* filename) { SkPath path; path.setFillType(SkPath::kEvenOdd_FillType); @@ -1825,7 +1785,6 @@ static void skpwww_argus_presse_fr_41(skiatest::Reporter* reporter, const char* testPathOp(reporter, path, pathB, kIntersect_PathOp, filename); } -// SkOpSegment::checkSmallCoincidence; line 1958 SkASSERT(span.fWindValue); static void skpwww_320kbps_net_2231(skiatest::Reporter* reporter, const char* filename) { SkPath path; path.setFillType(SkPath::kEvenOdd_FillType); @@ -1844,7 +1803,6 @@ static void skpwww_320kbps_net_2231(skiatest::Reporter* reporter, const char* fi testPathOp(reporter, path, pathB, kIntersect_PathOp, filename); } -// debugValidateLoop loop sum fails static void skpwww_exystence_net_61(skiatest::Reporter* reporter, const char* filename) { SkPath path; path.setFillType(SkPath::kEvenOdd_FillType); @@ -1863,7 +1821,6 @@ static void skpwww_exystence_net_61(skiatest::Reporter* reporter, const char* fi testPathOp(reporter, path, pathB, kIntersect_PathOp, filename); } -// debugValidateLoop loop sum fails static void skpwww_trashness_com_36(skiatest::Reporter* reporter, const char* filename) { SkPath path; path.setFillType(SkPath::kEvenOdd_FillType); @@ -1882,7 +1839,6 @@ static void skpwww_trashness_com_36(skiatest::Reporter* reporter, const char* fi testPathOp(reporter, path, pathB, kIntersect_PathOp, filename); } -// SkIntersections::lineVertical fUsed >= fMax static void skpwww_getgold_jp_731(skiatest::Reporter* reporter, const char* filename) { SkPath path; path.setFillType(SkPath::kEvenOdd_FillType); @@ -1904,7 +1860,6 @@ static void skpwww_getgold_jp_731(skiatest::Reporter* reporter, const char* file testPathOp(reporter, path, pathB, kIntersect_PathOp, filename); } -// SkOpContour::calcPartialCoincidentWinding SkASSERT(!approximately_negative(endT - startT)); static void skpwww_maturesupertube_com_21(skiatest::Reporter* reporter, const char* filename) { SkPath path; path.setFillType(SkPath::kEvenOdd_FillType); @@ -1945,7 +1900,6 @@ static void skpwww_maturesupertube_com_21(skiatest::Reporter* reporter, const ch testPathOp(reporter, path, pathB, kIntersect_PathOp, filename); } -// can't find winding of remaining vertical edges static void skpwww_hubbyscook_com_22(skiatest::Reporter* reporter, const char* filename) { SkPath path; path.setFillType(SkPath::kEvenOdd_FillType); @@ -1993,7 +1947,6 @@ static void skpwww_gruposejaumdivulgador_com_br_4(skiatest::Reporter* reporter, testPathOp(reporter, path, pathB, kIntersect_PathOp, filename); } -// asserts in bridgeOp simple->isClosed() static void skpwww_phototransferapp_com_24(skiatest::Reporter* reporter, const char* filename) { SkPath path; path.setFillType(SkPath::kEvenOdd_FillType); @@ -2134,7 +2087,6 @@ static void skpwww_cooksnaps_com_32a(skiatest::Reporter* reporter, const char* f testPathOp(reporter, path, pathB, kIntersect_PathOp, filename); } -// !simple->isClosed() static void skpwww_contextualnewsfeeds_com_346(skiatest::Reporter* reporter, const char* filename) { SkPath path; path.setFillType(SkPath::kEvenOdd_FillType); @@ -2158,7 +2110,6 @@ static void skpwww_contextualnewsfeeds_com_346(skiatest::Reporter* reporter, con testPathOp(reporter, path, pathB, kIntersect_PathOp, filename); } -// line quad intersection SkIntersections::assert static void skpwww_pindosiya_com_99(skiatest::Reporter* reporter, const char* filename) { SkPath path; path.setFillType(SkPath::kEvenOdd_FillType); @@ -2180,7 +2131,6 @@ static void skpwww_pindosiya_com_99(skiatest::Reporter* reporter, const char* fi testPathOp(reporter, path, pathB, kIntersect_PathOp, filename); } -// SkOpAngle::setSector SkASSERT(fSectorStart >= 0); static void skpwww_karnivool_com_au_11(skiatest::Reporter* reporter, const char* filename) { SkPath path; path.setFillType(SkPath::kEvenOdd_FillType); @@ -2303,7 +2253,6 @@ static void skpwww_artblart_com_8(skiatest::Reporter* reporter, const char* file testPathOp(reporter, path, pathB, kIntersect_PathOp, filename); } -// joinCoincidence / findT / assert static void skpwww_jessicaslens_wordpress_com_222(skiatest::Reporter* reporter, const char* filename) { SkPath path; path.setFillType(SkPath::kEvenOdd_FillType); @@ -2332,7 +2281,6 @@ static void skpwww_jessicaslens_wordpress_com_222(skiatest::Reporter* reporter, testPathOp(reporter, path, pathB, kDifference_PathOp, filename); } -// joinCoincidence / findT / assert static void skpwww_simplysaru_com_40(skiatest::Reporter* reporter, const char* filename) { SkPath path; path.setFillType(SkPath::kEvenOdd_FillType); @@ -2361,7 +2309,6 @@ static void skpwww_simplysaru_com_40(skiatest::Reporter* reporter, const char* f testPathOp(reporter, path, pathB, kDifference_PathOp, filename); } -// cubic-cubic intersection reduce checkLinear assert static void skpwww_partsdata_de_53(skiatest::Reporter* reporter, const char* filename) { SkPath path; path.setFillType(SkPath::kEvenOdd_FillType); @@ -2660,7 +2607,6 @@ static void skpwww_partsdata_de_53(skiatest::Reporter* reporter, const char* fil testPathOp(reporter, path, pathB, kIntersect_PathOp, filename); } -// SkOpAngle::setSector SkASSERT(fSectorStart >= 0); static void skpwww_seopack_blogspot_com_2153(skiatest::Reporter* reporter, const char* filename) { SkPath path; path.setFillType(SkPath::kEvenOdd_FillType); @@ -2684,7 +2630,6 @@ static void skpwww_seopack_blogspot_com_2153(skiatest::Reporter* reporter, const testPathOp(reporter, path, pathB, kIntersect_PathOp, filename); } -// joinCoincidence / findT / assert static void skpwww_lokado_de_173(skiatest::Reporter* reporter, const char* filename) { SkPath path; path.setFillType(SkPath::kEvenOdd_FillType); @@ -2721,7 +2666,6 @@ static void skpwww_lokado_de_173(skiatest::Reporter* reporter, const char* filen testPathOp(reporter, path, pathB, kDifference_PathOp, filename); } -// !simple->isClosed() static void skpwww_wartepop_blogspot_com_br_6(skiatest::Reporter* reporter, const char* filename) { SkPath path; path.setFillType(SkPath::kEvenOdd_FillType); @@ -2786,7 +2730,6 @@ static void skpwww_wartepop_blogspot_com_br_6a(skiatest::Reporter* reporter, con testPathOp(reporter, path, pathB, kDifference_PathOp, filename); } -// !simple->isClosed() static void skpwww_odia_com_br_26(skiatest::Reporter* reporter, const char* filename) { SkPath path; path.setFillType(SkPath::kEvenOdd_FillType); @@ -2870,7 +2813,6 @@ static void skpwww_evolvehq_com_210(skiatest::Reporter* reporter, const char* fi testPathOp(reporter, path, pathB, kDifference_PathOp, filename); } -// hangs static void skpwww_catingueiraonline_com_352(skiatest::Reporter* reporter, const char* filename) { SkPath path; path.setFillType(SkPath::kEvenOdd_FillType); @@ -2889,7 +2831,6 @@ static void skpwww_catingueiraonline_com_352(skiatest::Reporter* reporter, const testPathOp(reporter, path, pathB, kIntersect_PathOp, filename); } -// hangs static void skpwww_galaxystwo_com_4(skiatest::Reporter* reporter, const char* filename) { SkPath path; path.setFillType(SkPath::kEvenOdd_FillType); @@ -3613,12 +3554,7 @@ 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(); - 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); - } + testPathOp(reporter, path, pathB, kIntersect_PathOp, filename); } static void skpwww_alamdi_com_3(skiatest::Reporter* reporter, const char* filename) { @@ -3707,7 +3643,6 @@ static void skpwww_firstunitedbank_com_19(skiatest::Reporter* reporter, const ch testPathOp(reporter, path, pathB, kIntersect_PathOp, filename); } -// addSimpleAngle: failed assertion "index == count() - 2" static void skpwww_shinydemos_com_5(skiatest::Reporter* reporter, const char* filename) { SkPath path; path.setFillType(SkPath::kEvenOdd_FillType); @@ -3727,7 +3662,6 @@ static void skpwww_shinydemos_com_5(skiatest::Reporter* reporter, const char* fi testPathOp(reporter, path, pathB, kIntersect_PathOp, filename); } -// addTCoincident oPeek = &other->fTs[++oPeekIndex]; static void skpwww_lptemp_com_3(skiatest::Reporter* reporter, const char* filename) { SkPath path; path.setFillType(SkPath::kEvenOdd_FillType); @@ -3781,11 +3715,7 @@ static void skpwww_shinydemos_com_15(skiatest::Reporter* reporter, const char* f testPathOp(reporter, path, pathB, kIntersect_PathOp, filename); } -// 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,12 +3744,36 @@ 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(); - testPathOpCheck(reporter, path, pathB, kIntersect_PathOp, filename, FLAGS_runFail); + testPathOp(reporter, path, pathB, kIntersect_PathOp, filename); +} + +static void skpwww_educationalcraft_com_4a(skiatest::Reporter* reporter, const char* filename) { + SkPath path; + path.setFillType(SkPath::kEvenOdd_FillType); + path.moveTo(941, 1494); + path.lineTo(941, 1464); + path.lineTo(985, 1464); + path.lineTo(985, 1494); + path.lineTo(941, 1494); + path.close(); + SkPath pathB; + pathB.setFillType(SkPath::kWinding_FillType); + +pathB.moveTo(984.546021f, 1478.31494f); +pathB.cubicTo(984.546021f, 1478.31494f, 984.543213f, 1478.32239f, 984.537598f, 1478.33655f); +pathB.cubicTo(984.419006f, 1478.63477f, 983.044373f, 1481.90405f, 980.026001f, 1481.276f); +pathB.cubicTo(980.026001f, 1481.276f, 980.02594f, 1481.27576f, 980.025879f, 1481.27527f); +pathB.cubicTo(980.018494f, 1481.22131f, 979.602478f, 1478.38831f, 984.546021f, 1478.31494f); + testPathOp(reporter, path, pathB, kIntersect_PathOp, filename); + } +static void (*skipTest)(skiatest::Reporter* , const char* filename) = 0; static void (*firstTest)(skiatest::Reporter* , const char* filename) = 0; +static void (*stopTest)(skiatest::Reporter* , const char* filename) = 0; static struct TestDesc tests[] = { + TEST(skpwww_educationalcraft_com_4a), TEST(skpwww_lptemp_com_3), TEST(skpwww_shinydemos_com_5), TEST(skpwww_lptemp_com_5), @@ -3939,11 +3893,10 @@ static struct TestDesc tests[] = { static const size_t testCount = SK_ARRAY_COUNT(tests); static bool runReverse = false; -static void (*stopTest)(skiatest::Reporter* , const char* filename) = 0; DEF_TEST(PathOpsSkp, reporter) { #if DEBUG_SHOW_TEST_NAME strncpy(DEBUG_FILENAME_STRING, "", DEBUG_FILENAME_STRING_LENGTH); #endif - RunTestSet(reporter, tests, testCount, firstTest, stopTest, runReverse); + RunTestSet(reporter, tests, testCount, firstTest, skipTest, stopTest, runReverse); } -- cgit v1.2.3