diff options
author | caryclark <caryclark@google.com> | 2016-09-28 09:22:17 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-09-28 09:22:17 -0700 |
commit | e3a4e993ef79788d5ee807b10ff588e9c46bac6d (patch) | |
tree | da042cd555a96f4fa5d8975e8fafeb20d7b75f26 /tests/PathOpsSimplifyTest.cpp | |
parent | 33069255769246c703e1fbdbe14a752c31d0ad1e (diff) |
fix cubic linear test
Check to see if the line between end points is
degenerate before measuring control points.
Also, add test case for a bug to see if it
shows up on any platform.
TBR=reed@google.com
BUG=skia:5169, skia:5240
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2375053002
Review-Url: https://codereview.chromium.org/2375053002
Diffstat (limited to 'tests/PathOpsSimplifyTest.cpp')
-rw-r--r-- | tests/PathOpsSimplifyTest.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/PathOpsSimplifyTest.cpp b/tests/PathOpsSimplifyTest.cpp index 37e50cae36..5a2f012cfc 100644 --- a/tests/PathOpsSimplifyTest.cpp +++ b/tests/PathOpsSimplifyTest.cpp @@ -5542,11 +5542,21 @@ static void testQuads73(skiatest::Reporter* reporter, const char* filename) { testSimplify(reporter, path, filename); } +static void bug5169(skiatest::Reporter* reporter, const char* filename) { + SkPath path; +path.moveTo(SkBits2Float(0x00000000), SkBits2Float(0x4281c71c)); // 0, 64.8889f +path.cubicTo(SkBits2Float(0x434e0000), SkBits2Float(0x4281c71c), SkBits2Float(0x00000000), SkBits2Float(0xc2a238e4), SkBits2Float(0x00000000), SkBits2Float(0x4281c71c)); // 206, 64.8889f, 0, -81.1111f, 0, 64.8889f +path.moveTo(SkBits2Float(0x43300000), SkBits2Float(0x41971c72)); // 176, 18.8889f +path.cubicTo(SkBits2Float(0xc29e0000), SkBits2Float(0xc25c71c7), SkBits2Float(0x42b20000), SkBits2Float(0x42fbc71c), SkBits2Float(0x43300000), SkBits2Float(0x41971c72)); // -79, -55.1111f, 89, 125.889f, 176, 18.8889f + testSimplify(reporter, path, 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 TestDesc tests[] = { + TEST(bug5169), TEST(testQuads73), TEST(testQuads72), TEST(testQuads71), |