From 27c46a08a9210e9306b8ea1b00349ec198153c38 Mon Sep 17 00:00:00 2001 From: hcm Date: Tue, 28 Oct 2014 10:55:54 -0700 Subject: Revert of harden pathops for pathological test (patchset #19 id:410001 of https://codereview.chromium.org/633393002/) Reason for revert: Compile errors on bots Original issue's description: > 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 > > Committed: https://skia.googlesource.com/skia/+/6f726addf3178b01949bb389ef83cf14a1d7b6b2 TBR=caryclark@google.com NOTREECHECKS=true NOTRY=true BUG=421132 Review URL: https://codereview.chromium.org/686843002 --- tests/PathOpsBattles.cpp | 131 +++++++++++++++++++++++++++++++++-------------- 1 file changed, 93 insertions(+), 38 deletions(-) (limited to 'tests/PathOpsBattles.cpp') diff --git a/tests/PathOpsBattles.cpp b/tests/PathOpsBattles.cpp index c17ca68fb3..15fffd5d46 100644 --- a/tests/PathOpsBattles.cpp +++ b/tests/PathOpsBattles.cpp @@ -1273,6 +1273,9 @@ path.close(); // op end success 1 static void battleOp46(skiatest::Reporter* reporter, const char* filename) { + if (!FLAGS_runFail) { + return; + } SkPath path; path.setFillType((SkPath::FillType) 1); path.moveTo(SkBits2Float(0x3697ff52), SkBits2Float(0xc26fffff)); @@ -1296,7 +1299,7 @@ path.lineTo(SkBits2Float(0x4285e672), SkBits2Float(0xc2443b5f)); path.close(); SkPath path2(path); - testPathOpCheck(reporter, path1, path2, (SkPathOp) 2, filename, FLAGS_runFail); + testPathOp(reporter, path1, path2, (SkPathOp) 2, filename); } // op end success 1 @@ -1487,6 +1490,9 @@ path.close(); // op end success 1 static void battleOp54(skiatest::Reporter* reporter, const char* filename) { + if (!FLAGS_runFail) { + return; + } SkPath path; path.setFillType((SkPath::FillType) 1); path.moveTo(SkBits2Float(0x00000000), SkBits2Float(0xc2700000)); @@ -1512,7 +1518,7 @@ path.lineTo(SkBits2Float(0x42a3a81d), SkBits2Float(0xc15e595e)); path.close(); SkPath path2(path); - testPathOpCheck(reporter, path1, path2, (SkPathOp) 2, filename, FLAGS_runFail); + testPathOp(reporter, path1, path2, (SkPathOp) 2, filename); } // op end success 1 @@ -1626,6 +1632,9 @@ path.close(); // op end success 1 static void battleOp59(skiatest::Reporter* reporter, const char* filename) { // hung + if (!FLAGS_runFail) { + return; + } SkPath path; path.setFillType((SkPath::FillType) 0); path.moveTo(SkBits2Float(0x27b71bcd), SkBits2Float(0xc2a60000)); @@ -1727,6 +1736,9 @@ path.close(); // op end success 1 static void battleOp63(skiatest::Reporter* reporter, const char* filename) { + if (!FLAGS_runFail) { + return; + } SkPath path; path.setFillType((SkPath::FillType) 1); path.moveTo(SkBits2Float(0x00000000), SkBits2Float(0xc2700000)); @@ -1754,7 +1766,7 @@ path.lineTo(SkBits2Float(0x4039d102), SkBits2Float(0xc2a5e5fe)); path.close(); SkPath path2(path); - testPathOpCheck(reporter, path1, path2, (SkPathOp) 2, filename, FLAGS_runFail); + testPathOp(reporter, path1, path2, (SkPathOp) 2, filename); } // op end success 1 @@ -2302,6 +2314,9 @@ path.close(); // op end success 1 static void battleOp85(skiatest::Reporter* reporter, const char* filename) { + if (!FLAGS_runFail) { + return; + } SkPath path; path.setFillType((SkPath::FillType) 1); path.moveTo(SkBits2Float(0x00000000), SkBits2Float(0xc2700000)); @@ -3958,6 +3973,9 @@ path.close(); // op end success 1 static void battleOp148(skiatest::Reporter* reporter, const char* filename) { + if (!FLAGS_runFail) { + return; + } SkPath path; path.setFillType((SkPath::FillType) 0); path.moveTo(SkBits2Float(0x27b71bcd), SkBits2Float(0xc2a60000)); @@ -3978,7 +3996,7 @@ path.lineTo(SkBits2Float(0x42a38b52), SkBits2Float(0xc1639578)); path.close(); SkPath path2(path); - testPathOpCheck(reporter, path1, path2, (SkPathOp) 2, filename, FLAGS_runFail); + testPathOp(reporter, path1, path2, (SkPathOp) 2, filename); } // op end success 1 @@ -4066,6 +4084,9 @@ path.close(); // op end success 1 static void battleOp152(skiatest::Reporter* reporter, const char* filename) { + if (!FLAGS_runFail) { + return; // draws wrong + } SkPath path; path.setFillType((SkPath::FillType) 0); path.moveTo(SkBits2Float(0x27b71bcd), SkBits2Float(0xc2a60000)); @@ -4088,7 +4109,7 @@ path.lineTo(SkBits2Float(0x42a5fe22), SkBits2Float(0x3f4744a1)); path.close(); SkPath path2(path); - testPathOpCheck(reporter, path1, path2, (SkPathOp) 2, filename, FLAGS_runFail); + testPathOp(reporter, path1, path2, (SkPathOp) 2, filename); } // op end success 1 @@ -4208,6 +4229,9 @@ path.close(); // op end success 1 static void battleOp157(skiatest::Reporter* reporter, const char* filename) { + if (!FLAGS_runFail) { + return; // draws wrong + } SkPath path; path.setFillType((SkPath::FillType) 1); path.moveTo(SkBits2Float(0x00000000), SkBits2Float(0xc2700000)); @@ -4236,7 +4260,7 @@ path.lineTo(SkBits2Float(0x429c4e4c), SkBits2Float(0x41df969b)); path.close(); SkPath path2(path); - testPathOpCheck(reporter, path1, path2, (SkPathOp) 2, filename, FLAGS_runFail); + testPathOp(reporter, path1, path2, (SkPathOp) 2, filename); } // op end success 1 @@ -4384,6 +4408,9 @@ path.close(); // op end success 1 static void battleOp163(skiatest::Reporter* reporter, const char* filename) { + if (!FLAGS_runFail) { + return; // draws wrong + } SkPath path; path.setFillType((SkPath::FillType) 1); path.moveTo(SkBits2Float(0x3697ff52), SkBits2Float(0xc2700000)); @@ -4410,7 +4437,7 @@ path.lineTo(SkBits2Float(0x428cfdb5), SkBits2Float(0x422f3e36)); path.close(); SkPath path2(path); - testPathOpCheck(reporter, path1, path2, (SkPathOp) 2, filename, FLAGS_runFail); + testPathOp(reporter, path1, path2, (SkPathOp) 2, filename); } // op end success 1 @@ -4924,6 +4951,9 @@ path.close(); // op end success 1 static void battleOp181(skiatest::Reporter* reporter, const char* filename) { + if (!FLAGS_runFail) { + return; // draws wrong + } SkPath path; path.setFillType((SkPath::FillType) 1); path.moveTo(SkBits2Float(0xb7060057), SkBits2Float(0xc2700000)); @@ -4952,7 +4982,7 @@ path.lineTo(SkBits2Float(0x424f88ba), SkBits2Float(0x428191f0)); path.close(); SkPath path2(path); - testPathOpCheck(reporter, path1, path2, (SkPathOp) 2, filename, FLAGS_runFail); + testPathOp(reporter, path1, path2, (SkPathOp) 2, filename); } // op end success 1 @@ -4984,6 +5014,9 @@ path.close(); // op end success 1 static void battleOp183(skiatest::Reporter* reporter, const char* filename) { + if (!FLAGS_runFail) { + return; // draws wrong + } SkPath path; path.setFillType((SkPath::FillType) 1); path.moveTo(SkBits2Float(0x36d3ff52), SkBits2Float(0xc2700000)); @@ -5012,7 +5045,7 @@ path.lineTo(SkBits2Float(0x424b624a), SkBits2Float(0x42833479)); path.close(); SkPath path2(path); - testPathOpCheck(reporter, path1, path2, (SkPathOp) 2, filename, FLAGS_runFail); + testPathOp(reporter, path1, path2, (SkPathOp) 2, filename); } // op end success 1 @@ -5343,6 +5376,9 @@ path.close(); // op end success 1 static void battleOp195(skiatest::Reporter* reporter, const char* filename) { + if (!FLAGS_runFail) { + return; // draws wrong + } SkPath path; path.setFillType((SkPath::FillType) 0); path.moveTo(SkBits2Float(0x27b71bcd), SkBits2Float(0xc2a60000)); @@ -5363,7 +5399,7 @@ path.lineTo(SkBits2Float(0x3fc9081a), SkBits2Float(0xc2a5f864)); path.close(); SkPath path2(path); - testPathOpCheck(reporter, path1, path2, (SkPathOp) 2, filename, FLAGS_runFail); + testPathOp(reporter, path1, path2, (SkPathOp) 2, filename); } // op end success 1 @@ -5415,6 +5451,9 @@ path.close(); // op end success 1 static void battleOp198(skiatest::Reporter* reporter, const char* filename) { + if (!FLAGS_runFail) { + return; // draws wrong + } SkPath path; path.setFillType((SkPath::FillType) 1); path.moveTo(SkBits2Float(0x369bbf59), SkBits2Float(0xc2700000)); @@ -5439,7 +5478,7 @@ path.lineTo(SkBits2Float(0x40848cae), SkBits2Float(0xc2a5cb0c)); path.close(); SkPath path2(path); - testPathOpCheck(reporter, path1, path2, (SkPathOp) 2, filename, FLAGS_runFail); + testPathOp(reporter, path1, path2, (SkPathOp) 2, filename); } // op end success 1 @@ -6269,6 +6308,9 @@ path.close(); // op end success 1 static void battleOp230(skiatest::Reporter* reporter, const char* filename) { + if (!FLAGS_runFail) { + return; // draws wrong + } SkPath path; path.setFillType((SkPath::FillType) 1); path.moveTo(SkBits2Float(0x00000000), SkBits2Float(0xc2700000)); @@ -6293,7 +6335,7 @@ path.lineTo(SkBits2Float(0x429ff91f), SkBits2Float(0xc1b14b8a)); path.close(); SkPath path2(path); - testPathOpCheck(reporter, path1, path2, (SkPathOp) 2, filename, FLAGS_runFail); + testPathOp(reporter, path1, path2, (SkPathOp) 2, filename); } // op end success 1 @@ -6463,6 +6505,9 @@ path.close(); // op end success 1 static void battleOp237(skiatest::Reporter* reporter, const char* filename) { + if (!FLAGS_runFail) { + return; // draws wrong + } SkPath path; path.setFillType((SkPath::FillType) 0); path.moveTo(SkBits2Float(0x27b71bcd), SkBits2Float(0xc2a60000)); @@ -7021,6 +7066,9 @@ path.close(); // op end success 1 static void battleOp256(skiatest::Reporter* reporter, const char* filename) { + if (!FLAGS_runFail) { + return; // draws wrong + } SkPath path; path.setFillType((SkPath::FillType) 1); path.moveTo(SkBits2Float(0xb69400ae), SkBits2Float(0xc2700000)); @@ -7050,7 +7098,7 @@ path.lineTo(SkBits2Float(0x4273ad4f), SkBits2Float(0x42617d52)); path.close(); SkPath path2(path); - testPathOpCheck(reporter, path1, path2, (SkPathOp) 2, filename, FLAGS_runFail); + testPathOp(reporter, path1, path2, (SkPathOp) 2, filename); } // op end success 1 @@ -7417,6 +7465,9 @@ path.close(); // op end success 1 static void battleOp269(skiatest::Reporter* reporter, const char* filename) { + if (!FLAGS_runFail) { + return; // draws wrong + } SkPath path; path.setFillType((SkPath::FillType) 0); path.moveTo(SkBits2Float(0x27b71bcd), SkBits2Float(0xc2a60000)); @@ -7439,7 +7490,7 @@ path.lineTo(SkBits2Float(0x427e3109), SkBits2Float(0x42559108)); path.close(); SkPath path2(path); - testPathOpCheck(reporter, path1, path2, (SkPathOp) 2, filename, FLAGS_runFail); + testPathOp(reporter, path1, path2, (SkPathOp) 2, filename); } // op end success 1 @@ -7534,6 +7585,9 @@ path.close(); // op end success 1 static void battleOp273(skiatest::Reporter* reporter, const char* filename) { + if (!FLAGS_runFail) { + return; // draws wrong + } SkPath path; path.setFillType((SkPath::FillType) 0); path.moveTo(SkBits2Float(0x27b71bcd), SkBits2Float(0xc2a60000)); @@ -7556,7 +7610,7 @@ path.lineTo(SkBits2Float(0x4279eebd), SkBits2Float(0x425a890e)); path.close(); SkPath path2(path); - testPathOpCheck(reporter, path1, path2, (SkPathOp) 2, filename, FLAGS_runFail); + testPathOp(reporter, path1, path2, (SkPathOp) 2, filename); } // op end success 1 @@ -7837,6 +7891,9 @@ path.close(); // op end success 1 static void battleOp283(skiatest::Reporter* reporter, const char* filename) { + if (!FLAGS_runFail) { + return; // draws wrong + } SkPath path; path.setFillType((SkPath::FillType) 0); path.moveTo(SkBits2Float(0x27b71bcd), SkBits2Float(0xc2a60000)); @@ -7859,7 +7916,7 @@ path.lineTo(SkBits2Float(0x42759f2b), SkBits2Float(0x425f5e9b)); path.close(); SkPath path2(path); - testPathOpCheck(reporter, path1, path2, (SkPathOp) 2, filename, FLAGS_runFail); + testPathOp(reporter, path1, path2, (SkPathOp) 2, filename); } // op end success 1 @@ -10682,7 +10739,7 @@ path.close(); testPathOp(reporter, path1, path2, (SkPathOp) 2, filename); } -static void (*firstTest)(skiatest::Reporter* , const char* filename) = battleOp352; +static void (*firstTest)(skiatest::Reporter* , const char* filename) = battleOp6001; static void (*stopTest)(skiatest::Reporter* , const char* filename) = 0; static struct TestDesc tests[] = { @@ -10735,6 +10792,8 @@ static struct TestDesc tests[] = { TEST(battleOp43), TEST(battleOp44), TEST(battleOp45), + TEST(battleOp46), // draws wrong : dropped an outer cubic incorrectly + // if assembly rewrite was done, the error would be hidden TEST(battleOp47), TEST(battleOp48), TEST(battleOp49), @@ -10743,15 +10802,17 @@ static struct TestDesc tests[] = { TEST(battleOp51), TEST(battleOp52), TEST(battleOp53), + TEST(battleOp54), // draws wrong TEST(battleOp55), TEST(battleOp56), TEST(battleOp57), TEST(battleOp58), - TEST(battleOp59), + TEST(battleOp59), // draws wrong TEST(battleOp60), TEST(battleOp61), TEST(battleOp62), + TEST(battleOp63), // draws wrong TEST(battleOp64), TEST(battleOp65), TEST(battleOp66), @@ -10775,7 +10836,7 @@ static struct TestDesc tests[] = { TEST(battleOp82), TEST(battleOp83), TEST(battleOp84), - TEST(battleOp85), + TEST(battleOp85), // draws wrong TEST(battleOp86), TEST(battleOp87), TEST(battleOp88), @@ -10844,20 +10905,24 @@ static struct TestDesc tests[] = { TEST(battleOp145), TEST(battleOp146), TEST(battleOp147), + TEST(battleOp148), // draws wrong TEST(battleOp149), TEST(battleOp150), TEST(battleOp151), + TEST(battleOp152), TEST(battleOp153), TEST(battleOp154), TEST(battleOp155), TEST(battleOp156), + TEST(battleOp157), TEST(battleOp158), TEST(battleOp159), TEST(battleOp160), TEST(battleOp161), TEST(battleOp162), + TEST(battleOp163), TEST(battleOp164), TEST(battleOp165), TEST(battleOp166), @@ -10877,7 +10942,9 @@ static struct TestDesc tests[] = { TEST(battleOp179), TEST(battleOp180), + TEST(battleOp181), TEST(battleOp182), + TEST(battleOp183), TEST(battleOp184), TEST(battleOp185), TEST(battleOp186), @@ -10890,8 +10957,10 @@ static struct TestDesc tests[] = { TEST(battleOp192), TEST(battleOp193), TEST(battleOp194), + TEST(battleOp195), TEST(battleOp196), TEST(battleOp197), + TEST(battleOp198), TEST(battleOp199), TEST(battleOp200), @@ -10926,6 +10995,7 @@ static struct TestDesc tests[] = { TEST(battleOp227), TEST(battleOp228), TEST(battleOp229), + TEST(battleOp230), TEST(battleOp231), TEST(battleOp232), @@ -10954,6 +11024,7 @@ static struct TestDesc tests[] = { TEST(battleOp253), TEST(battleOp254), TEST(battleOp255), + TEST(battleOp256), TEST(battleOp257), TEST(battleOp258), TEST(battleOp259), @@ -10967,10 +11038,12 @@ static struct TestDesc tests[] = { TEST(battleOp266), TEST(battleOp267), TEST(battleOp268), + TEST(battleOp269), TEST(battleOp270), TEST(battleOp271), TEST(battleOp272), + TEST(battleOp273), TEST(battleOp274), TEST(battleOp275), TEST(battleOp276), @@ -10981,6 +11054,7 @@ static struct TestDesc tests[] = { TEST(battleOp281), TEST(battleOp282), + TEST(battleOp283), TEST(battleOp284), TEST(battleOp285), TEST(battleOp286), @@ -11094,25 +11168,6 @@ static struct TestDesc tests[] = { TEST(issue414409c), TEST(issue414409b), TEST(issue414409), - - // these draw wrong - TEST(battleOp46), // dropped an outer cubic incorrectly - // if assembly rewrite was done, the error would be hidden - TEST(battleOp54), - TEST(battleOp63), - TEST(battleOp152), - TEST(battleOp157), - TEST(battleOp163), - TEST(battleOp181), - TEST(battleOp183), - TEST(battleOp195), - TEST(battleOp198), - TEST(battleOp230), - TEST(battleOp256), - TEST(battleOp269), - TEST(battleOp273), - TEST(battleOp148), - TEST(battleOp283), }; -- cgit v1.2.3