diff options
author | caryclark <caryclark@google.com> | 2016-09-23 05:47:20 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-09-23 05:47:20 -0700 |
commit | 27c015dfcf4e2b8fb1abe327cc40204e2a4f452a (patch) | |
tree | 1fab83dc8286a4f1900871c69e80e624203e7e3e /tests/PathOpsOpTest.cpp | |
parent | 5a9c2f110e4f1a78d9bfedcf708168909706d7fd (diff) |
split tight quads and conics
Tight quads and conics may nearly fold over on themselves, confusing
coincidence against other curves. Split them at their max curvature
early on to avoid complicating later logic.
TBR=reed@google.com
BUG=skia:5131
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2357353002
Review-Url: https://codereview.chromium.org/2357353002
Diffstat (limited to 'tests/PathOpsOpTest.cpp')
-rw-r--r-- | tests/PathOpsOpTest.cpp | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/PathOpsOpTest.cpp b/tests/PathOpsOpTest.cpp index 8ff0079dd4..9bb3a0fbb6 100644 --- a/tests/PathOpsOpTest.cpp +++ b/tests/PathOpsOpTest.cpp @@ -5375,6 +5375,26 @@ static void cubicOp158(skiatest::Reporter* reporter, const char* filename) { testPathOp(reporter, path, pathB, kDifference_SkPathOp, filename); } +static void loop17(skiatest::Reporter* reporter, const char* filename) { + SkPath path, pathB; + path.moveTo(1, 2); + path.cubicTo(0, 3, -0.333333343f, 3.33333325f, 0.833333373f, 3.5f); + path.close(); + pathB.moveTo(0, 3); + pathB.cubicTo(-0.333333343f, 3.33333325f, 0.833333373f, 3.5f, 1, 2); + pathB.close(); + testPathOp(reporter, path, pathB, kIntersect_SkPathOp, filename); +} + +static void circlesOp4(skiatest::Reporter* reporter, const char* filename) { + SkPath path, pathB; + path.setFillType(SkPath::kWinding_FillType); + path.addCircle(0, 1, 5, SkPath::kCW_Direction); + pathB.setFillType(SkPath::kWinding_FillType); + pathB.addCircle(0, 1, 0, SkPath::kCW_Direction); + testPathOp(reporter, path, pathB, kDifference_SkPathOp, 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; @@ -5382,6 +5402,8 @@ static void (*stopTest)(skiatest::Reporter* , const char* filename) = 0; #define TEST(name) { name, #name } static struct TestDesc tests[] = { + TEST(circlesOp4), + TEST(loop17), TEST(cubicOp158), TEST(loops_i1), TEST(loops_i2), |