diff options
author | caryclark <caryclark@google.com> | 2016-09-15 07:48:18 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-09-15 07:48:18 -0700 |
commit | e839e78443e48d4ccad89059b4bc4b3d894fcfdd (patch) | |
tree | 516e3a08710bdbe9dc4785553026f06f14c75e61 /tests/PathOpsSimplifyTest.cpp | |
parent | 32d1e95ca593adfaa12bc48d4ac0d5501a4b2046 (diff) |
quad and conic do not intersect
If a quad a conic intersect only where the end of one
is contained by the convex hull of the other, and the
curve contained by the hull is nearly a straight line,
treating it as a line may move the end point to the
other side of the curve.
Detect this by checking to see if the end point is in
the hull, and if so, continue to subdivide the curve
rather than treating it as a line.
This fixes several existing tests that were disabled
earlier this year.
A typo in SkDCurve::nearPoint() prevented detecting when
the end of a line was nearly touching a curve.
Also fixed concidence a bit to get the second half of
tiger further along.
All existing tests, including extended testing in
Release and the first half of tiger, work.
TBR=reed@google.com
BUG=skia:5131
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2338323002
Review-Url: https://codereview.chromium.org/2338323002
Diffstat (limited to 'tests/PathOpsSimplifyTest.cpp')
-rw-r--r-- | tests/PathOpsSimplifyTest.cpp | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/tests/PathOpsSimplifyTest.cpp b/tests/PathOpsSimplifyTest.cpp index d91cc98fcb..07e3720583 100644 --- a/tests/PathOpsSimplifyTest.cpp +++ b/tests/PathOpsSimplifyTest.cpp @@ -5331,7 +5331,7 @@ static void tiger8b_h_1(skiatest::Reporter* reporter, const char* filename) { #if DEBUG_UNDER_DEVELOPMENT // tiger return; #endif - uint64_t testlines = 0x0000000001000893; // best so far: 0x0000000001000893 + uint64_t testlines = 0x0000001000350204; // best so far: 0x0000000104080223 tiger8b_x(reporter, filename, testlines); } @@ -5382,8 +5382,6 @@ path.close(); testSimplify(reporter, path, filename); } -// FIXME: this should not fail -- it was isolated looking for the root cause to fuzz763_4713 -// it fails with and without that change static void fuzz763_4713_b(skiatest::Reporter* reporter, const char* filename) { SkPath path; path.setFillType((SkPath::FillType) 0); @@ -5416,8 +5414,7 @@ path.quadTo(SkBits2Float(0x41dc55b6), SkBits2Float(0x41d924df), SkBits2Float(0x4 path.quadTo(SkBits2Float(0x41dcaf1e), SkBits2Float(0x41d8ca01), SkBits2Float(0x41dcdc4c), SkBits2Float(0x41d89bf0)); path.quadTo(SkBits2Float(0x41ef6c33), SkBits2Float(0x41c5aec5), SkBits2Float(0x4204f72e), SkBits2Float(0x41c56cd2)); path.close(); -// DEBUG_UNDER_DEVELOPMENT fuzz763_4713_b disable expectation check for now -testSimplifyCheck(reporter, path, filename, !FLAGS_runFail); +testSimplify(reporter, path, filename); } static void dean4(skiatest::Reporter* reporter, const char* filename) { @@ -5859,11 +5856,25 @@ static void testQuads72(skiatest::Reporter* reporter, const char* filename) { testSimplify(reporter, path, filename); } +static void testQuads73(skiatest::Reporter* reporter, const char* filename) { + SkPath path; + path.moveTo(0, 0); + path.quadTo(0, 1, 1, 2); + path.lineTo(0, 3); + path.close(); + path.moveTo(0, 0); + path.lineTo(0, 0); + path.quadTo(0, 1, 1, 1); + path.close(); + testSimplify(reporter, path, filename); +} + static void (*skipTest)(skiatest::Reporter* , const char* filename) = 0; static void (*firstTest)(skiatest::Reporter* , const char* filename) = tiger8b_h_1; static void (*stopTest)(skiatest::Reporter* , const char* filename) = 0; static TestDesc tests[] = { + TEST(testQuads73), TEST(tiger8a_h_1), TEST(tiger8a_h), TEST(tiger8a), |