OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2012 Google Inc. | 2 * Copyright 2012 Google Inc. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 #include "PathOpsExtendedTest.h" | 7 #include "PathOpsExtendedTest.h" |
8 #include "PathOpsTestCommon.h" | 8 #include "PathOpsTestCommon.h" |
9 | 9 |
10 #define TEST(name) { name, #name } | 10 class PathTest_Private { |
| 11 public: |
| 12 PathTest_Private(SkPath* path) |
| 13 : fPath(path) {} |
| 14 |
| 15 void setPt(int index, SkScalar x, SkScalar y) { |
| 16 fPath->setPt(index, x, y); |
| 17 } |
| 18 |
| 19 SkPath* fPath; |
| 20 }; |
| 21 |
| 22 static void path_edit(const SkPoint& from, const SkPoint& to, SkPath* path) { |
| 23 PathTest_Private testPath(path); |
| 24 for (int index = 0; index < path->countPoints(); ++index) { |
| 25 if (SkDPoint::ApproximatelyEqual(path->getPoint(index), from)) { |
| 26 testPath.setPt(index, to.fX, to.fY); |
| 27 return; |
| 28 } |
| 29 } |
| 30 } |
11 | 31 |
12 static void cubicOp1d(skiatest::Reporter* reporter, const char* filename) { | 32 static void cubicOp1d(skiatest::Reporter* reporter, const char* filename) { |
13 SkPath path, pathB; | 33 SkPath path, pathB; |
14 path.setFillType(SkPath::kWinding_FillType); | 34 path.setFillType(SkPath::kWinding_FillType); |
15 path.moveTo(0,1); | 35 path.moveTo(0,1); |
16 path.cubicTo(0,2, 1,0, 1,0); | 36 path.cubicTo(0,2, 1,0, 1,0); |
17 path.close(); | 37 path.close(); |
18 pathB.setFillType(SkPath::kWinding_FillType); | 38 pathB.setFillType(SkPath::kWinding_FillType); |
19 pathB.moveTo(0,1); | 39 pathB.moveTo(0,1); |
20 pathB.cubicTo(0,1, 1,0, 2,0); | 40 pathB.cubicTo(0,1, 1,0, 2,0); |
(...skipping 2427 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2448 pathB.moveTo(317, 711); | 2468 pathB.moveTo(317, 711); |
2449 pathB.cubicTo(322.522858f, 711, 327, 715.477173f, 327, 721); | 2469 pathB.cubicTo(322.522858f, 711, 327, 715.477173f, 327, 721); |
2450 pathB.lineTo(327, 838); | 2470 pathB.lineTo(327, 838); |
2451 pathB.cubicTo(327, 843.522827f, 322.522858f, 848, 317, 848); | 2471 pathB.cubicTo(327, 843.522827f, 322.522858f, 848, 317, 848); |
2452 pathB.lineTo(155, 848); | 2472 pathB.lineTo(155, 848); |
2453 pathB.cubicTo(149.477158f, 848, 145, 843.522827f, 145, 838); | 2473 pathB.cubicTo(149.477158f, 848, 145, 843.522827f, 145, 838); |
2454 pathB.lineTo(145, 721); | 2474 pathB.lineTo(145, 721); |
2455 pathB.cubicTo(145, 715.477173f, 149.477158f, 711, 155, 711); | 2475 pathB.cubicTo(145, 715.477173f, 149.477158f, 711, 155, 711); |
2456 pathB.lineTo(317, 711); | 2476 pathB.lineTo(317, 711); |
2457 pathB.close(); | 2477 pathB.close(); |
2458 testPathOpCheck(reporter, path, pathB, kIntersect_SkPathOp, filename, FLAGS_
runFail); | 2478 testPathOp(reporter, path, pathB, kIntersect_SkPathOp, filename); |
2459 } | 2479 } |
2460 | 2480 |
2461 static void cubicOp92i(skiatest::Reporter* reporter, const char* filename) { | 2481 static void cubicOp92i(skiatest::Reporter* reporter, const char* filename) { |
2462 SkPath path, pathB; | 2482 SkPath path, pathB; |
2463 path.setFillType(SkPath::kWinding_FillType); | 2483 path.setFillType(SkPath::kWinding_FillType); |
2464 path.moveTo(0, 1); | 2484 path.moveTo(0, 1); |
2465 path.cubicTo(2, 6, 4, 1, 5, 4); | 2485 path.cubicTo(2, 6, 4, 1, 5, 4); |
2466 path.close(); | 2486 path.close(); |
2467 pathB.setFillType(SkPath::kWinding_FillType); | 2487 pathB.setFillType(SkPath::kWinding_FillType); |
2468 pathB.moveTo(1, 4); | 2488 pathB.moveTo(1, 4); |
(...skipping 1163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3632 #include "SkParsePath.h" | 3652 #include "SkParsePath.h" |
3633 | 3653 |
3634 static void issue3517(skiatest::Reporter* reporter, const char* filename) { | 3654 static void issue3517(skiatest::Reporter* reporter, const char* filename) { |
3635 SkPath path, pathB; | 3655 SkPath path, pathB; |
3636 | 3656 |
3637 const char str[] = "M31.35 57.75L31.35 57.75C31.9 57.7486 32.45 57.7948 33 5
7.7413C33.55 57.6878 34.1 57.5014 34.65 57.4291C35.2 57.3569 35.75 57.3223 36.3
57.3079C36.85 57.2935 37.4 57.3143 37.95 57.3428C38.5 57.3712 39.05 57.4112 39.6
57.4786C40.15 57.546 40.7 57.7029 41.25 57.7472C41.8 57.7916 42.35 57.7962 42.9
57.7445C43.45 57.6928 44 57.5345 44.55 57.4373C45.1 57.34 45.65 57.2115 46.2 57
.1611C46.75 57.1107 47.3 57.1371 47.85 57.1349C48.4 57.1327 48.95 57.144 49.5 57
.1478C50.05 57.1516 50.6 57.1553 51.15 57.1579C51.7 57.1605 52.25 57.1601 52.8 5
7.1634C53.35 57.1667 53.9 57.1731 54.45 57.1776C55 57.182 55.55 57.1916 56.1 57.
19C56.65 57.1884 57.2 57.178 57.75 57.168C58.3 57.158 58.85 57.1355 59.4 57.1299
C59.95 57.1243 60.5 57.1338 61.05 57.1345C61.6 57.1352 62.15 57.124 62.7 57.134C
63.25 57.1441 63.8 57.1731 64.35 57.195C64.9 57.2169 65.45 57.2532 66 57.2655C66
.55 57.2778 67.1 57.2647 67.65 57.2687C68.2 57.2728 68.75 57.267 69.3 57.2896C69
.85 57.3122 70.4 57.371 70.95 57.4044C71.5 57.4377 72.05 57.4668 72.6 57.4896C73
.15 57.5123 73.7 57.545 74.25 57.5408C74.8 57.5365 75.35 57.5068 75.9 57.4641C76
.45 57.4213 77 57.3244 77.55 57.2842C78.1 57.244 78.65 57.2163 79.2 57.2228C79.7
5 57.2293 80.3 57.29 80.85 57.3232C81.4 57.3563 81.95 57.396 82.5 57.4219C83.05
57.4478 83.6 57.4637 84.15 57.4787C84.7 57.4937 85.25 57.5011 85.8 57.5121C86.35
57.523 86.9 57.5411 87.45 57.5444C88 57.5477 88.55 57.5663 89.1 57.5318C89.65 5
7.4972 90.2 57.3126 90.75 57.337C91.3 57.3613 91.85 57.6088 92.4 57.6776C92.95 5
7.7465 93.5 57.7379 94.05 57.75C94.6 57.7621 95.15 57.75 95.7 57.75L95.7 57.75L3
1.35 57.75Z"; | 3657 const char str[] = "M31.35 57.75L31.35 57.75C31.9 57.7486 32.45 57.7948 33 5
7.7413C33.55 57.6878 34.1 57.5014 34.65 57.4291C35.2 57.3569 35.75 57.3223 36.3
57.3079C36.85 57.2935 37.4 57.3143 37.95 57.3428C38.5 57.3712 39.05 57.4112 39.6
57.4786C40.15 57.546 40.7 57.7029 41.25 57.7472C41.8 57.7916 42.35 57.7962 42.9
57.7445C43.45 57.6928 44 57.5345 44.55 57.4373C45.1 57.34 45.65 57.2115 46.2 57
.1611C46.75 57.1107 47.3 57.1371 47.85 57.1349C48.4 57.1327 48.95 57.144 49.5 57
.1478C50.05 57.1516 50.6 57.1553 51.15 57.1579C51.7 57.1605 52.25 57.1601 52.8 5
7.1634C53.35 57.1667 53.9 57.1731 54.45 57.1776C55 57.182 55.55 57.1916 56.1 57.
19C56.65 57.1884 57.2 57.178 57.75 57.168C58.3 57.158 58.85 57.1355 59.4 57.1299
C59.95 57.1243 60.5 57.1338 61.05 57.1345C61.6 57.1352 62.15 57.124 62.7 57.134C
63.25 57.1441 63.8 57.1731 64.35 57.195C64.9 57.2169 65.45 57.2532 66 57.2655C66
.55 57.2778 67.1 57.2647 67.65 57.2687C68.2 57.2728 68.75 57.267 69.3 57.2896C69
.85 57.3122 70.4 57.371 70.95 57.4044C71.5 57.4377 72.05 57.4668 72.6 57.4896C73
.15 57.5123 73.7 57.545 74.25 57.5408C74.8 57.5365 75.35 57.5068 75.9 57.4641C76
.45 57.4213 77 57.3244 77.55 57.2842C78.1 57.244 78.65 57.2163 79.2 57.2228C79.7
5 57.2293 80.3 57.29 80.85 57.3232C81.4 57.3563 81.95 57.396 82.5 57.4219C83.05
57.4478 83.6 57.4637 84.15 57.4787C84.7 57.4937 85.25 57.5011 85.8 57.5121C86.35
57.523 86.9 57.5411 87.45 57.5444C88 57.5477 88.55 57.5663 89.1 57.5318C89.65 5
7.4972 90.2 57.3126 90.75 57.337C91.3 57.3613 91.85 57.6088 92.4 57.6776C92.95 5
7.7465 93.5 57.7379 94.05 57.75C94.6 57.7621 95.15 57.75 95.7 57.75L95.7 57.75L3
1.35 57.75Z"; |
3638 SkParsePath::FromSVGString(str, &path); | 3658 SkParsePath::FromSVGString(str, &path); |
3639 | 3659 |
3640 const char strB[] = "M31.35 57.75L31.35 57.75C31.9 57.7514 32.45 57.7052 33
57.7587C33.55 57.8122 34.1 57.9986 34.65 58.0709C35.2 58.1431 35.75 58.1777 36.3
58.1921C36.85 58.2065 37.4 58.1857 37.95 58.1572C38.5 58.1288 39.05 58.0888 39.
6 58.0214C40.15 57.954 40.7 57.7971 41.25 57.7528C41.8 57.7084 42.35 57.7038 42.
9 57.7555C43.45 57.8072 44 57.9655 44.55 58.0627C45.1 58.16 45.65 58.2885 46.2 5
8.3389C46.75 58.3893 47.3 58.3629 47.85 58.3651C48.4 58.3673 48.95 58.356 49.5 5
8.3522C50.05 58.3484 50.6 58.3447 51.15 58.3421C51.7 58.3395 52.25 58.3399 52.8
58.3366C53.35 58.3333 53.9 58.3269 54.45 58.3224C55 58.318 55.55 58.3084 56.1 58
.31C56.65 58.3116 57.2 58.322 57.75 58.332C58.3 58.342 58.85 58.3645 59.4 58.370
1C59.95 58.3757 60.5 58.3662 61.05 58.3655C61.6 58.3648 62.15 58.376 62.7 58.366
C63.25 58.3559 63.8 58.3269 64.35 58.305C64.9 58.2831 65.45 58.2468 66 58.2345C6
6.55 58.2222 67.1 58.2353 67.65 58.2313C68.2 58.2272 68.75 58.233 69.3 58.2104C6
9.85 58.1878 70.4 58.129 70.95 58.0956C71.5 58.0623 72.05 58.0332 72.6 58.0104C7
3.15 57.9877 73.7 57.955 74.25 57.9592C74.8 57.9635 75.35 57.9932 75.9 58.0359C7
6.45 58.0787 77 58.1756 77.55 58.2158C78.1 58.256 78.65 58.2837 79.2 58.2772C79.
75 58.2707 80.3 58.21 80.85 58.1768C81.4 58.1437 81.95 58.104 82.5 58.0781C83.05
58.0522 83.6 58.0363 84.15 58.0213C84.7 58.0063 85.25 57.9989 85.8 57.9879C86.3
5 57.977 86.9 57.9589 87.45 57.9556C88 57.9523 88.55 57.9337 89.1 57.9682C89.65
58.0028 90.2 58.1874 90.75 58.163C91.3 58.1387 91.85 57.8912 92.4 57.8224C92.95
57.7535 93.5 57.7621 94.05 57.75C94.6 57.7379 95.15 57.75 95.7 57.75L95.7 57.75L
31.35 57.75Z"; | 3660 const char strB[] = "M31.35 57.75L31.35 57.75C31.9 57.7514 32.45 57.7052 33
57.7587C33.55 57.8122 34.1 57.9986 34.65 58.0709C35.2 58.1431 35.75 58.1777 36.3
58.1921C36.85 58.2065 37.4 58.1857 37.95 58.1572C38.5 58.1288 39.05 58.0888 39.
6 58.0214C40.15 57.954 40.7 57.7971 41.25 57.7528C41.8 57.7084 42.35 57.7038 42.
9 57.7555C43.45 57.8072 44 57.9655 44.55 58.0627C45.1 58.16 45.65 58.2885 46.2 5
8.3389C46.75 58.3893 47.3 58.3629 47.85 58.3651C48.4 58.3673 48.95 58.356 49.5 5
8.3522C50.05 58.3484 50.6 58.3447 51.15 58.3421C51.7 58.3395 52.25 58.3399 52.8
58.3366C53.35 58.3333 53.9 58.3269 54.45 58.3224C55 58.318 55.55 58.3084 56.1 58
.31C56.65 58.3116 57.2 58.322 57.75 58.332C58.3 58.342 58.85 58.3645 59.4 58.370
1C59.95 58.3757 60.5 58.3662 61.05 58.3655C61.6 58.3648 62.15 58.376 62.7 58.366
C63.25 58.3559 63.8 58.3269 64.35 58.305C64.9 58.2831 65.45 58.2468 66 58.2345C6
6.55 58.2222 67.1 58.2353 67.65 58.2313C68.2 58.2272 68.75 58.233 69.3 58.2104C6
9.85 58.1878 70.4 58.129 70.95 58.0956C71.5 58.0623 72.05 58.0332 72.6 58.0104C7
3.15 57.9877 73.7 57.955 74.25 57.9592C74.8 57.9635 75.35 57.9932 75.9 58.0359C7
6.45 58.0787 77 58.1756 77.55 58.2158C78.1 58.256 78.65 58.2837 79.2 58.2772C79.
75 58.2707 80.3 58.21 80.85 58.1768C81.4 58.1437 81.95 58.104 82.5 58.0781C83.05
58.0522 83.6 58.0363 84.15 58.0213C84.7 58.0063 85.25 57.9989 85.8 57.9879C86.3
5 57.977 86.9 57.9589 87.45 57.9556C88 57.9523 88.55 57.9337 89.1 57.9682C89.65
58.0028 90.2 58.1874 90.75 58.163C91.3 58.1387 91.85 57.8912 92.4 57.8224C92.95
57.7535 93.5 57.7621 94.05 57.75C94.6 57.7379 95.15 57.75 95.7 57.75L95.7 57.75L
31.35 57.75Z"; |
3641 SkParsePath::FromSVGString(strB, &pathB); | 3661 SkParsePath::FromSVGString(strB, &pathB); |
3642 testPathOp(reporter, path, pathB, kUnion_SkPathOp, filename); | 3662 testPathOpCheck(reporter, path, pathB, kUnion_SkPathOp, filename, FLAGS_runF
ail); |
3643 } | 3663 } |
3644 | 3664 |
3645 static void cubicOp119(skiatest::Reporter* reporter, const char* filename) { | 3665 static void cubicOp119(skiatest::Reporter* reporter, const char* filename) { |
3646 SkPath path, pathB; | 3666 SkPath path, pathB; |
3647 path.setFillType(SkPath::kWinding_FillType); | 3667 path.setFillType(SkPath::kWinding_FillType); |
3648 path.moveTo(0,1); | 3668 path.moveTo(0,1); |
3649 path.cubicTo(3,5, 2,1, 3,1); | 3669 path.cubicTo(3,5, 2,1, 3,1); |
3650 path.close(); | 3670 path.close(); |
3651 pathB.setFillType(SkPath::kWinding_FillType); | 3671 pathB.setFillType(SkPath::kWinding_FillType); |
3652 pathB.moveTo(1,2); | 3672 pathB.moveTo(1,2); |
(...skipping 370 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4023 SkPath path, pathB; | 4043 SkPath path, pathB; |
4024 path.moveTo(1,2); | 4044 path.moveTo(1,2); |
4025 path.cubicTo(0,6, -3.16666675f,3.66666675f, 6.33333349f,3.33333349f); | 4045 path.cubicTo(0,6, -3.16666675f,3.66666675f, 6.33333349f,3.33333349f); |
4026 path.close(); | 4046 path.close(); |
4027 pathB.moveTo(0,6); | 4047 pathB.moveTo(0,6); |
4028 pathB.cubicTo(-3.16666675f,3.66666675f, 6.33333349f,3.33333349f, 1,2); | 4048 pathB.cubicTo(-3.16666675f,3.66666675f, 6.33333349f,3.33333349f, 1,2); |
4029 pathB.close(); | 4049 pathB.close(); |
4030 testPathOp(reporter, path, pathB, kIntersect_SkPathOp, filename); | 4050 testPathOp(reporter, path, pathB, kIntersect_SkPathOp, filename); |
4031 } | 4051 } |
4032 | 4052 |
4033 static void loop15(skiatest::Reporter* reporter, const char* filename) { | |
4034 SkPath path, pathB; | |
4035 path.moveTo(2,6); | |
4036 path.cubicTo(1,2, 7.16666698f,6.66666698f, -4.66666651f,7.66666651f); | |
4037 path.close(); | |
4038 pathB.moveTo(1,2); | |
4039 pathB.cubicTo(7.16666698f,6.66666698f, -4.66666651f,7.66666651f, 2,6); | |
4040 pathB.close(); | |
4041 testPathOpCheck(reporter, path, pathB, kIntersect_SkPathOp, filename, FLAGS_
runFail); | |
4042 } | |
4043 | |
4044 // lots of loopy interesections -- all points appear to be present -- needs more
investigation | |
4045 static void loop16(skiatest::Reporter* reporter, const char* filename) { | |
4046 SkPath path, pathB; | |
4047 path.moveTo(1,5); | |
4048 path.cubicTo(0,1, 7.33333302f,5.33333349f, -7,7); | |
4049 path.close(); | |
4050 pathB.moveTo(0,1); | |
4051 pathB.cubicTo(7.33333302f,5.33333349f, -7,7, 1,5); | |
4052 pathB.close(); | |
4053 testPathOpCheck(reporter, path, pathB, kIntersect_SkPathOp, filename, FLAGS_
runFail); | |
4054 } | |
4055 | |
4056 static void cubicOp133(skiatest::Reporter* reporter, const char* filename) { | 4053 static void cubicOp133(skiatest::Reporter* reporter, const char* filename) { |
4057 SkPath path, pathB; | 4054 SkPath path, pathB; |
4058 path.setFillType(SkPath::kWinding_FillType); | 4055 path.setFillType(SkPath::kWinding_FillType); |
4059 path.moveTo(5,6); | 4056 path.moveTo(5,6); |
4060 path.cubicTo(5,6, 5,0, 4,1); | 4057 path.cubicTo(5,6, 5,0, 4,1); |
4061 path.close(); | 4058 path.close(); |
4062 pathB.setFillType(SkPath::kWinding_FillType); | 4059 pathB.setFillType(SkPath::kWinding_FillType); |
4063 pathB.moveTo(0,5); | 4060 pathB.moveTo(0,5); |
4064 pathB.cubicTo(1,4, 6,5, 6,5); | 4061 pathB.cubicTo(1,4, 6,5, 6,5); |
4065 pathB.close(); | 4062 pathB.close(); |
(...skipping 467 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4533 static void loops23i(skiatest::Reporter* reporter, const char* filename) { | 4530 static void loops23i(skiatest::Reporter* reporter, const char* filename) { |
4534 SkPath path, pathB; | 4531 SkPath path, pathB; |
4535 path.setFillType(SkPath::kWinding_FillType); | 4532 path.setFillType(SkPath::kWinding_FillType); |
4536 path.moveTo(1, 5); | 4533 path.moveTo(1, 5); |
4537 path.cubicTo(0, 1, 6.16666698f, 5.66666698f, -5.66666651f, 6.66666651f); | 4534 path.cubicTo(0, 1, 6.16666698f, 5.66666698f, -5.66666651f, 6.66666651f); |
4538 path.close(); | 4535 path.close(); |
4539 pathB.setFillType(SkPath::kWinding_FillType); | 4536 pathB.setFillType(SkPath::kWinding_FillType); |
4540 pathB.moveTo(0, 1); | 4537 pathB.moveTo(0, 1); |
4541 pathB.cubicTo(6.16666698f, 5.66666698f, -5.66666651f, 6.66666651f, 1, 5); | 4538 pathB.cubicTo(6.16666698f, 5.66666698f, -5.66666651f, 6.66666651f, 1, 5); |
4542 pathB.close(); | 4539 pathB.close(); |
4543 testPathOpCheck(reporter, path, pathB, kIntersect_SkPathOp, filename, FLAGS_
runFail); | 4540 testPathOp(reporter, path, pathB, kIntersect_SkPathOp, filename); |
4544 } | 4541 } |
4545 | 4542 |
4546 static void loops24i(skiatest::Reporter* reporter, const char* filename) { | 4543 static void loops24i(skiatest::Reporter* reporter, const char* filename) { |
4547 SkPath path, pathB; | 4544 SkPath path, pathB; |
4548 path.setFillType(SkPath::kWinding_FillType); | 4545 path.setFillType(SkPath::kWinding_FillType); |
4549 path.moveTo(1, 2); | 4546 path.moveTo(1, 2); |
4550 path.cubicTo(0, 2, 0.833333313f, 2, 1, 3); | 4547 path.cubicTo(0, 2, 0.833333313f, 2, 1, 3); |
4551 path.close(); | 4548 path.close(); |
4552 pathB.setFillType(SkPath::kWinding_FillType); | 4549 pathB.setFillType(SkPath::kWinding_FillType); |
4553 pathB.moveTo(0, 2); | 4550 pathB.moveTo(0, 2); |
(...skipping 18 matching lines...) Expand all Loading... |
4572 static void loops26i(skiatest::Reporter* reporter, const char* filename) { | 4569 static void loops26i(skiatest::Reporter* reporter, const char* filename) { |
4573 SkPath path, pathB; | 4570 SkPath path, pathB; |
4574 path.setFillType(SkPath::kWinding_FillType); | 4571 path.setFillType(SkPath::kWinding_FillType); |
4575 path.moveTo(1, 6); | 4572 path.moveTo(1, 6); |
4576 path.cubicTo(0, 2, 6.16666698f, 6.66666698f, -5.66666651f, 7.66666651f); | 4573 path.cubicTo(0, 2, 6.16666698f, 6.66666698f, -5.66666651f, 7.66666651f); |
4577 path.close(); | 4574 path.close(); |
4578 pathB.setFillType(SkPath::kWinding_FillType); | 4575 pathB.setFillType(SkPath::kWinding_FillType); |
4579 pathB.moveTo(0, 2); | 4576 pathB.moveTo(0, 2); |
4580 pathB.cubicTo(6.16666698f, 6.66666698f, -5.66666651f, 7.66666651f, 1, 6); | 4577 pathB.cubicTo(6.16666698f, 6.66666698f, -5.66666651f, 7.66666651f, 1, 6); |
4581 pathB.close(); | 4578 pathB.close(); |
4582 testPathOpCheck(reporter, path, pathB, kIntersect_SkPathOp, filename, FLAGS_
runFail); | 4579 testPathOp(reporter, path, pathB, kIntersect_SkPathOp, filename); |
4583 } | 4580 } |
4584 | 4581 |
4585 static void loops27i(skiatest::Reporter* reporter, const char* filename) { | 4582 static void loops27i(skiatest::Reporter* reporter, const char* filename) { |
4586 SkPath path, pathB; | 4583 SkPath path, pathB; |
4587 path.setFillType(SkPath::kWinding_FillType); | 4584 path.setFillType(SkPath::kWinding_FillType); |
4588 path.moveTo(1, 3); | 4585 path.moveTo(1, 3); |
4589 path.cubicTo(0, 3, 0.833333313f, 3, 1, 4.33333349f); | 4586 path.cubicTo(0, 3, 0.833333313f, 3, 1, 4.33333349f); |
4590 path.close(); | 4587 path.close(); |
4591 pathB.setFillType(SkPath::kWinding_FillType); | 4588 pathB.setFillType(SkPath::kWinding_FillType); |
4592 pathB.moveTo(0, 3); | 4589 pathB.moveTo(0, 3); |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4663 static void loops33i(skiatest::Reporter* reporter, const char* filename) { | 4660 static void loops33i(skiatest::Reporter* reporter, const char* filename) { |
4664 SkPath path, pathB; | 4661 SkPath path, pathB; |
4665 path.setFillType(SkPath::kWinding_FillType); | 4662 path.setFillType(SkPath::kWinding_FillType); |
4666 path.moveTo(2, 6); | 4663 path.moveTo(2, 6); |
4667 path.cubicTo(1, 2, 7.16666698f, 6.66666698f, -4.66666651f, 7.66666651f); | 4664 path.cubicTo(1, 2, 7.16666698f, 6.66666698f, -4.66666651f, 7.66666651f); |
4668 path.close(); | 4665 path.close(); |
4669 pathB.setFillType(SkPath::kWinding_FillType); | 4666 pathB.setFillType(SkPath::kWinding_FillType); |
4670 pathB.moveTo(1, 2); | 4667 pathB.moveTo(1, 2); |
4671 pathB.cubicTo(7.16666698f, 6.66666698f, -4.66666651f, 7.66666651f, 2, 6); | 4668 pathB.cubicTo(7.16666698f, 6.66666698f, -4.66666651f, 7.66666651f, 2, 6); |
4672 pathB.close(); | 4669 pathB.close(); |
4673 testPathOpCheck(reporter, path, pathB, kIntersect_SkPathOp, filename, FLAGS_
runFail); | 4670 testPathOp(reporter, path, pathB, kIntersect_SkPathOp, filename); |
4674 } | 4671 } |
4675 | 4672 |
4676 static void loops33iMod(skiatest::Reporter* reporter, const char* filename) { | 4673 static void loops33iMod(skiatest::Reporter* reporter, const char* filename) { |
4677 SkPoint pts[] = {{2, 6}, {1, 2}, {7.16666698f, 6.66666698f}, {-4.66666651f,
7.66666651f}, | 4674 SkPoint pts[] = {{2, 6}, {1, 2}, {7.16666698f, 6.66666698f}, {-4.66666651f,
7.66666651f}, |
4678 {1, 2}, {7.16666698f, 6.66666698f}, {-4.66666651f, 7.666666
51f}, {2, 6}}; | 4675 {1, 2}, {7.16666698f, 6.66666698f}, {-4.66666651f, 7.666666
51f}, {2, 6}}; |
4679 bool up = false; | 4676 bool up = false; |
4680 float offset = 0.0380172729f; | 4677 float offset = 0.0380172729f; |
4681 float step = 7.62939453e-006f; | 4678 float step = 7.62939453e-006f; |
4682 bool lastResult = true; | 4679 bool lastResult = true; |
4683 // for (int i = 0; i < 30; ++i) { | 4680 // for (int i = 0; i < 30; ++i) { |
4684 SkString name(filename); | 4681 SkString name(filename); |
4685 // name.appendS32(i); | 4682 // name.appendS32(i); |
4686 // if (i > 0) { | 4683 // if (i > 0) { |
4687 // SkDebugf("\n\n<div id=\"%s\">\n", name.c_str()); | 4684 // SkDebugf("\n\n<div id=\"%s\">\n", name.c_str()); |
4688 // } | 4685 // } |
4689 pts[5].fY = 6.66666698f + offset; | 4686 pts[5].fY = 6.66666698f + offset; |
4690 SkPath path, pathB; | 4687 SkPath path, pathB; |
4691 path.setFillType(SkPath::kWinding_FillType); | 4688 path.setFillType(SkPath::kWinding_FillType); |
4692 path.moveTo(pts[0]); | 4689 path.moveTo(pts[0]); |
4693 path.cubicTo(pts[1], pts[2], pts[3]); | 4690 path.cubicTo(pts[1], pts[2], pts[3]); |
4694 path.close(); | 4691 path.close(); |
4695 pathB.setFillType(SkPath::kWinding_FillType); | 4692 pathB.setFillType(SkPath::kWinding_FillType); |
4696 pathB.moveTo(pts[4]); | 4693 pathB.moveTo(pts[4]); |
4697 pathB.cubicTo(pts[5], pts[6], pts[7]); | 4694 pathB.cubicTo(pts[5], pts[6], pts[7]); |
4698 pathB.close(); | 4695 pathB.close(); |
4699 bool result = testPathOpCheck(reporter, path, pathB, kIntersect_SkPathOp
, name.c_str(), | 4696 bool result = testPathOp(reporter, path, pathB, kIntersect_SkPathOp, nam
e.c_str()); |
4700 FLAGS_runFail); | |
4701 if (lastResult != result) { | 4697 if (lastResult != result) { |
4702 up = !up; | 4698 up = !up; |
4703 } | 4699 } |
4704 step /= 2; | 4700 step /= 2; |
4705 offset += up ? step : -step; | 4701 offset += up ? step : -step; |
4706 lastResult = result; | 4702 lastResult = result; |
4707 // } | 4703 // } |
4708 } | 4704 } |
4709 | 4705 |
4710 | 4706 |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4824 pathB.setFillType(SkPath::kWinding_FillType); | 4820 pathB.setFillType(SkPath::kWinding_FillType); |
4825 pathB.moveTo(0, 5); | 4821 pathB.moveTo(0, 5); |
4826 pathB.cubicTo(2.5f, 5, 3, 11, 3, 5); | 4822 pathB.cubicTo(2.5f, 5, 3, 11, 3, 5); |
4827 pathB.close(); | 4823 pathB.close(); |
4828 SkPath qPath, qPathB; | 4824 SkPath qPath, qPathB; |
4829 CubicPathToQuads(path, &qPath); | 4825 CubicPathToQuads(path, &qPath); |
4830 CubicPathToQuads(pathB, &qPathB); | 4826 CubicPathToQuads(pathB, &qPathB); |
4831 testPathOp(reporter, qPath, qPathB, kIntersect_SkPathOp, filename); | 4827 testPathOp(reporter, qPath, qPathB, kIntersect_SkPathOp, filename); |
4832 } | 4828 } |
4833 | 4829 |
4834 static void loops41i(skiatest::Reporter* reporter, const char* filename) { | |
4835 SkPath path, pathB; | |
4836 path.setFillType(SkPath::kWinding_FillType); | |
4837 path.moveTo(1, 5); | |
4838 path.cubicTo(0, 1, 6.16666698f, 5.66666698f, -5.66666651f, 6.66666651f); | |
4839 path.close(); | |
4840 pathB.setFillType(SkPath::kWinding_FillType); | |
4841 pathB.moveTo(0, 1); | |
4842 pathB.cubicTo(6.16666698f, 5.66666698f, -5.66666651f, 6.66666651f, 1, 5); | |
4843 pathB.close(); | |
4844 testPathOpCheck(reporter, path, pathB, kIntersect_SkPathOp, filename, FLAGS_
runFail); | |
4845 } | |
4846 | |
4847 /* | |
4848 FAILED: d:\cygwin\puregit\tests\pathopsextendedtest.cpp:346 0 */ | |
4849 static void loops42i(skiatest::Reporter* reporter, const char* filename) { | |
4850 SkPath path, pathB; | |
4851 path.setFillType(SkPath::kWinding_FillType); | |
4852 path.moveTo(1, 6); | |
4853 path.cubicTo(0, 2, 6.16666698f, 6.66666698f, -5.66666651f, 7.66666651f); | |
4854 path.close(); | |
4855 pathB.setFillType(SkPath::kWinding_FillType); | |
4856 pathB.moveTo(0, 2); | |
4857 pathB.cubicTo(6.16666698f, 6.66666698f, -5.66666651f, 7.66666651f, 1, 6); | |
4858 pathB.close(); | |
4859 testPathOpCheck(reporter, path, pathB, kIntersect_SkPathOp, filename, FLAGS_
runFail); | |
4860 } | |
4861 | |
4862 /* | |
4863 FAILED: d:\cygwin\puregit\tests\pathopsextendedtest.cpp:346 0 */ | |
4864 static void loops43i(skiatest::Reporter* reporter, const char* filename) { | |
4865 SkPath path, pathB; | |
4866 path.setFillType(SkPath::kWinding_FillType); | |
4867 path.moveTo(2, 6); | |
4868 path.cubicTo(1, 2, 7.16666698f, 6.66666698f, -4.66666651f, 7.66666651f); | |
4869 path.close(); | |
4870 pathB.setFillType(SkPath::kWinding_FillType); | |
4871 pathB.moveTo(1, 2); | |
4872 pathB.cubicTo(7.16666698f, 6.66666698f, -4.66666651f, 7.66666651f, 2, 6); | |
4873 pathB.close(); | |
4874 testPathOpCheck(reporter, path, pathB, kIntersect_SkPathOp, filename, FLAGS_
runFail); | |
4875 } | |
4876 | |
4877 /* | |
4878 FAILED: d:\cygwin\puregit\tests\pathopsextendedtest.cpp:346 0 */ | |
4879 static void loops44i(skiatest::Reporter* reporter, const char* filename) { | 4830 static void loops44i(skiatest::Reporter* reporter, const char* filename) { |
4880 SkPath path, pathB; | 4831 SkPath path, pathB; |
4881 path.setFillType(SkPath::kWinding_FillType); | 4832 path.setFillType(SkPath::kWinding_FillType); |
4882 path.moveTo(1, 5); | 4833 path.moveTo(1, 5); |
4883 path.cubicTo(0, 1, 7.33333302f, 5.33333349f, -7, 7); | 4834 path.cubicTo(0, 1, 7.33333302f, 5.33333349f, -7, 7); |
4884 path.close(); | 4835 path.close(); |
4885 pathB.setFillType(SkPath::kWinding_FillType); | 4836 pathB.setFillType(SkPath::kWinding_FillType); |
4886 pathB.moveTo(0, 1); | 4837 pathB.moveTo(0, 1); |
4887 pathB.cubicTo(7.33333302f, 5.33333349f, -7, 7, 1, 5); | 4838 pathB.cubicTo(7.33333302f, 5.33333349f, -7, 7, 1, 5); |
4888 pathB.close(); | 4839 pathB.close(); |
4889 testPathOpCheck(reporter, path, pathB, kIntersect_SkPathOp, filename, FLAGS_
runFail); | 4840 testPathOp(reporter, path, pathB, kIntersect_SkPathOp, filename); |
4890 } | 4841 } |
4891 | 4842 |
4892 /* | |
4893 FAILED: d:\cygwin\puregit\tests\pathopsextendedtest.cpp:346 0 */ | |
4894 static void loops45i(skiatest::Reporter* reporter, const char* filename) { | 4843 static void loops45i(skiatest::Reporter* reporter, const char* filename) { |
4895 SkPath path, pathB; | 4844 SkPath path, pathB; |
4896 path.setFillType(SkPath::kWinding_FillType); | 4845 path.setFillType(SkPath::kWinding_FillType); |
4897 path.moveTo(1, 6); | 4846 path.moveTo(1, 6); |
4898 path.cubicTo(0, 2, 7.33333302f, 6.33333302f, -7, 8); | 4847 path.cubicTo(0, 2, 7.33333302f, 6.33333302f, -7, 8); |
4899 path.close(); | 4848 path.close(); |
4900 pathB.setFillType(SkPath::kWinding_FillType); | 4849 pathB.setFillType(SkPath::kWinding_FillType); |
4901 pathB.moveTo(0, 2); | 4850 pathB.moveTo(0, 2); |
4902 pathB.cubicTo(7.33333302f, 6.33333302f, -7, 8, 1, 6); | 4851 pathB.cubicTo(7.33333302f, 6.33333302f, -7, 8, 1, 6); |
4903 pathB.close(); | 4852 pathB.close(); |
4904 testPathOpCheck(reporter, path, pathB, kIntersect_SkPathOp, filename, FLAGS_
runFail); | 4853 testPathOp(reporter, path, pathB, kIntersect_SkPathOp, filename); |
4905 } | 4854 } |
4906 | 4855 |
4907 /* | |
4908 FAILED: d:\cygwin\puregit\tests\pathopsextendedtest.cpp:346 0 */ | |
4909 static void loops46i(skiatest::Reporter* reporter, const char* filename) { | 4856 static void loops46i(skiatest::Reporter* reporter, const char* filename) { |
4910 SkPath path, pathB; | 4857 SkPath path, pathB; |
4911 path.setFillType(SkPath::kWinding_FillType); | 4858 path.setFillType(SkPath::kWinding_FillType); |
4912 path.moveTo(2, 6); | 4859 path.moveTo(2, 6); |
4913 path.cubicTo(1, 2, 8.33333302f, 6.33333302f, -6, 8); | 4860 path.cubicTo(1, 2, 8.33333302f, 6.33333302f, -6, 8); |
4914 path.close(); | 4861 path.close(); |
4915 pathB.setFillType(SkPath::kWinding_FillType); | 4862 pathB.setFillType(SkPath::kWinding_FillType); |
4916 pathB.moveTo(1, 2); | 4863 pathB.moveTo(1, 2); |
4917 pathB.cubicTo(8.33333302f, 6.33333302f, -6, 8, 2, 6); | 4864 pathB.cubicTo(8.33333302f, 6.33333302f, -6, 8, 2, 6); |
4918 pathB.close(); | 4865 pathB.close(); |
4919 testPathOpCheck(reporter, path, pathB, kIntersect_SkPathOp, filename, FLAGS_
runFail); | 4866 testPathOp(reporter, path, pathB, kIntersect_SkPathOp, filename); |
4920 } | 4867 } |
4921 | 4868 |
4922 /* | 4869 /* |
4923 FAILED: d:\cygwin\puregit\tests\pathopsextendedtest.cpp:346 0 */ | 4870 FAILED: d:\cygwin\puregit\tests\pathopsextendedtest.cpp:346 0 */ |
4924 static void loops47i(skiatest::Reporter* reporter, const char* filename) { | 4871 static void loops47i(skiatest::Reporter* reporter, const char* filename) { |
4925 SkPath path, pathB; | 4872 SkPath path, pathB; |
4926 path.setFillType(SkPath::kWinding_FillType); | 4873 path.setFillType(SkPath::kWinding_FillType); |
4927 path.moveTo(2, 4); | 4874 path.moveTo(2, 4); |
4928 path.cubicTo(0, 1, 6, 5.83333302f, -4, 8); | 4875 path.cubicTo(0, 1, 6, 5.83333302f, -4, 8); |
4929 path.close(); | 4876 path.close(); |
4930 pathB.setFillType(SkPath::kWinding_FillType); | 4877 pathB.setFillType(SkPath::kWinding_FillType); |
4931 pathB.moveTo(0, 1); | 4878 pathB.moveTo(0, 1); |
4932 pathB.cubicTo(6, 5.83333302f, -4, 8, 2, 4); | 4879 pathB.cubicTo(6, 5.83333302f, -4, 8, 2, 4); |
4933 pathB.close(); | 4880 pathB.close(); |
4934 testPathOpCheck(reporter, path, pathB, kIntersect_SkPathOp, filename, FLAGS_
runFail); | 4881 testPathOp(reporter, path, pathB, kIntersect_SkPathOp, filename); |
4935 } | 4882 } |
4936 | 4883 |
4937 /* | |
4938 FAILED: d:\cygwin\puregit\tests\pathopsextendedtest.cpp:346 0 */ | |
4939 static void loops48i(skiatest::Reporter* reporter, const char* filename) { | 4884 static void loops48i(skiatest::Reporter* reporter, const char* filename) { |
4940 SkPath path, pathB; | 4885 SkPath path, pathB; |
4941 path.setFillType(SkPath::kWinding_FillType); | 4886 path.setFillType(SkPath::kWinding_FillType); |
4942 path.moveTo(2, 6); | 4887 path.moveTo(2, 6); |
4943 path.cubicTo(0, 1, 9.33333302f, 6.83333302f, -8.33333302f, 9.16666603f); | 4888 path.cubicTo(0, 1, 9.33333302f, 6.83333302f, -8.33333302f, 9.16666603f); |
4944 path.close(); | 4889 path.close(); |
4945 pathB.setFillType(SkPath::kWinding_FillType); | 4890 pathB.setFillType(SkPath::kWinding_FillType); |
4946 pathB.moveTo(0, 1); | 4891 pathB.moveTo(0, 1); |
4947 pathB.cubicTo(9.33333302f, 6.83333302f, -8.33333302f, 9.16666603f, 2, 6); | 4892 pathB.cubicTo(9.33333302f, 6.83333302f, -8.33333302f, 9.16666603f, 2, 6); |
4948 pathB.close(); | 4893 pathB.close(); |
4949 testPathOpCheck(reporter, path, pathB, kIntersect_SkPathOp, filename, FLAGS_
runFail); | 4894 testPathOp(reporter, path, pathB, kIntersect_SkPathOp, filename); |
4950 } | 4895 } |
4951 | 4896 |
4952 /* | |
4953 FAILED: d:\cygwin\puregit\tests\pathopsextendedtest.cpp:346 0 */ | |
4954 static void loops49i(skiatest::Reporter* reporter, const char* filename) { | 4897 static void loops49i(skiatest::Reporter* reporter, const char* filename) { |
4955 SkPath path, pathB; | 4898 SkPath path, pathB; |
4956 path.setFillType(SkPath::kWinding_FillType); | 4899 path.setFillType(SkPath::kWinding_FillType); |
4957 path.moveTo(0, 2); | 4900 path.moveTo(0, 2); |
4958 path.cubicTo(1, 4, -0.166666687f, 2.66666675f, 1.66666675f, 2); | 4901 path.cubicTo(1, 4, -0.166666687f, 2.66666675f, 1.66666675f, 2); |
4959 path.close(); | 4902 path.close(); |
4960 pathB.setFillType(SkPath::kWinding_FillType); | 4903 pathB.setFillType(SkPath::kWinding_FillType); |
4961 pathB.moveTo(1, 4); | 4904 pathB.moveTo(1, 4); |
4962 pathB.cubicTo(-0.166666687f, 2.66666675f, 1.66666675f, 2, 0, 2); | 4905 pathB.cubicTo(-0.166666687f, 2.66666675f, 1.66666675f, 2, 0, 2); |
4963 pathB.close(); | 4906 pathB.close(); |
4964 testPathOpCheck(reporter, path, pathB, kIntersect_SkPathOp, filename, FLAGS_
runFail); | 4907 testPathOp(reporter, path, pathB, kIntersect_SkPathOp, filename); |
4965 } | 4908 } |
4966 | 4909 |
4967 /* | |
4968 FAILED: d:\cygwin\puregit\tests\pathopsextendedtest.cpp:346 0 */ | |
4969 static void loops50i(skiatest::Reporter* reporter, const char* filename) { | 4910 static void loops50i(skiatest::Reporter* reporter, const char* filename) { |
4970 SkPath path, pathB; | 4911 SkPath path, pathB; |
4971 path.setFillType(SkPath::kWinding_FillType); | 4912 path.setFillType(SkPath::kWinding_FillType); |
4972 path.moveTo(0, 3); | 4913 path.moveTo(0, 3); |
4973 path.cubicTo(1, 5, -0.166666687f, 3.66666675f, 1.66666675f, 3); | 4914 path.cubicTo(1, 5, -0.166666687f, 3.66666675f, 1.66666675f, 3); |
4974 path.close(); | 4915 path.close(); |
4975 pathB.setFillType(SkPath::kWinding_FillType); | 4916 pathB.setFillType(SkPath::kWinding_FillType); |
4976 pathB.moveTo(1, 5); | 4917 pathB.moveTo(1, 5); |
4977 pathB.cubicTo(-0.166666687f, 3.66666675f, 1.66666675f, 3, 0, 3); | 4918 pathB.cubicTo(-0.166666687f, 3.66666675f, 1.66666675f, 3, 0, 3); |
4978 pathB.close(); | 4919 pathB.close(); |
4979 testPathOpCheck(reporter, path, pathB, kIntersect_SkPathOp, filename, FLAGS_
runFail); | 4920 testPathOp(reporter, path, pathB, kIntersect_SkPathOp, filename); |
4980 } | 4921 } |
4981 | 4922 |
4982 /* | |
4983 FAILED: d:\cygwin\puregit\tests\pathopsextendedtest.cpp:346 0 */ | |
4984 static void loops51i(skiatest::Reporter* reporter, const char* filename) { | 4923 static void loops51i(skiatest::Reporter* reporter, const char* filename) { |
4985 SkPath path, pathB; | 4924 SkPath path, pathB; |
4986 path.setFillType(SkPath::kWinding_FillType); | 4925 path.setFillType(SkPath::kWinding_FillType); |
4987 path.moveTo(1, 2); | 4926 path.moveTo(1, 2); |
4988 path.cubicTo(2, 4, 0.833333313f, 2.66666675f, 2.66666675f, 2); | 4927 path.cubicTo(2, 4, 0.833333313f, 2.66666675f, 2.66666675f, 2); |
4989 path.close(); | 4928 path.close(); |
4990 pathB.setFillType(SkPath::kWinding_FillType); | 4929 pathB.setFillType(SkPath::kWinding_FillType); |
4991 pathB.moveTo(2, 4); | 4930 pathB.moveTo(2, 4); |
4992 pathB.cubicTo(0.833333313f, 2.66666675f, 2.66666675f, 2, 1, 2); | 4931 pathB.cubicTo(0.833333313f, 2.66666675f, 2.66666675f, 2, 1, 2); |
4993 pathB.close(); | 4932 pathB.close(); |
4994 testPathOpCheck(reporter, path, pathB, kIntersect_SkPathOp, filename, FLAGS_
runFail); | 4933 testPathOp(reporter, path, pathB, kIntersect_SkPathOp, filename); |
4995 } | 4934 } |
4996 | 4935 |
4997 /* | |
4998 FAILED: d:\cygwin\puregit\tests\pathopsextendedtest.cpp:346 0 */ | |
4999 static void loops52i(skiatest::Reporter* reporter, const char* filename) { | 4936 static void loops52i(skiatest::Reporter* reporter, const char* filename) { |
5000 SkPath path, pathB; | 4937 SkPath path, pathB; |
5001 path.setFillType(SkPath::kWinding_FillType); | 4938 path.setFillType(SkPath::kWinding_FillType); |
5002 path.moveTo(1, 3); | 4939 path.moveTo(1, 3); |
5003 path.cubicTo(2, 5, 0.833333313f, 3.66666675f, 2.66666675f, 3); | 4940 path.cubicTo(2, 5, 0.833333313f, 3.66666675f, 2.66666675f, 3); |
5004 path.close(); | 4941 path.close(); |
5005 pathB.setFillType(SkPath::kWinding_FillType); | 4942 pathB.setFillType(SkPath::kWinding_FillType); |
5006 pathB.moveTo(2, 5); | 4943 pathB.moveTo(2, 5); |
5007 pathB.cubicTo(0.833333313f, 3.66666675f, 2.66666675f, 3, 1, 3); | 4944 pathB.cubicTo(0.833333313f, 3.66666675f, 2.66666675f, 3, 1, 3); |
5008 pathB.close(); | 4945 pathB.close(); |
5009 testPathOpCheck(reporter, path, pathB, kIntersect_SkPathOp, filename, FLAGS_
runFail); | 4946 testPathOp(reporter, path, pathB, kIntersect_SkPathOp, filename); |
5010 } | 4947 } |
5011 | 4948 |
5012 /* | |
5013 FAILED: d:\cygwin\puregit\tests\pathopsextendedtest.cpp:346 0 */ | |
5014 static void loops53i(skiatest::Reporter* reporter, const char* filename) { | 4949 static void loops53i(skiatest::Reporter* reporter, const char* filename) { |
5015 SkPath path, pathB; | 4950 SkPath path, pathB; |
5016 path.setFillType(SkPath::kWinding_FillType); | 4951 path.setFillType(SkPath::kWinding_FillType); |
5017 path.moveTo(2, 3); | 4952 path.moveTo(2, 3); |
5018 path.cubicTo(3, 5, 1.83333325f, 3.66666675f, 3.66666651f, 3); | 4953 path.cubicTo(3, 5, 1.83333325f, 3.66666675f, 3.66666651f, 3); |
5019 path.close(); | 4954 path.close(); |
5020 pathB.setFillType(SkPath::kWinding_FillType); | 4955 pathB.setFillType(SkPath::kWinding_FillType); |
5021 pathB.moveTo(3, 5); | 4956 pathB.moveTo(3, 5); |
5022 pathB.cubicTo(1.83333325f, 3.66666675f, 3.66666651f, 3, 2, 3); | 4957 pathB.cubicTo(1.83333325f, 3.66666675f, 3.66666651f, 3, 2, 3); |
5023 pathB.close(); | 4958 pathB.close(); |
5024 testPathOpCheck(reporter, path, pathB, kIntersect_SkPathOp, filename, FLAGS_
runFail); | 4959 testPathOp(reporter, path, pathB, kIntersect_SkPathOp, filename); |
5025 } | 4960 } |
5026 | 4961 |
5027 /* | |
5028 FAILED: d:\cygwin\puregit\tests\pathopsextendedtest.cpp:346 0 */ | |
5029 static void loops54i(skiatest::Reporter* reporter, const char* filename) { | 4962 static void loops54i(skiatest::Reporter* reporter, const char* filename) { |
5030 SkPath path, pathB; | 4963 SkPath path, pathB; |
5031 path.setFillType(SkPath::kWinding_FillType); | 4964 path.setFillType(SkPath::kWinding_FillType); |
5032 path.moveTo(0, 2); | 4965 path.moveTo(0, 2); |
5033 path.cubicTo(1, 4, 0, 3, 1.66666675f, 2); | 4966 path.cubicTo(1, 4, 0, 3, 1.66666675f, 2); |
5034 path.close(); | 4967 path.close(); |
5035 pathB.setFillType(SkPath::kWinding_FillType); | 4968 pathB.setFillType(SkPath::kWinding_FillType); |
5036 pathB.moveTo(1, 4); | 4969 pathB.moveTo(1, 4); |
5037 pathB.cubicTo(0, 3, 1.66666675f, 2, 0, 2); | 4970 pathB.cubicTo(0, 3, 1.66666675f, 2, 0, 2); |
5038 pathB.close(); | 4971 pathB.close(); |
5039 testPathOpCheck(reporter, path, pathB, kIntersect_SkPathOp, filename, FLAGS_
runFail); | 4972 testPathOp(reporter, path, pathB, kIntersect_SkPathOp, filename); |
5040 } | 4973 } |
5041 | 4974 |
5042 /* | |
5043 FAILED: d:\cygwin\puregit\tests\pathopsextendedtest.cpp:346 0 */ | |
5044 static void loops55i(skiatest::Reporter* reporter, const char* filename) { | 4975 static void loops55i(skiatest::Reporter* reporter, const char* filename) { |
5045 SkPath path, pathB; | 4976 SkPath path, pathB; |
5046 path.setFillType(SkPath::kWinding_FillType); | 4977 path.setFillType(SkPath::kWinding_FillType); |
5047 path.moveTo(0, 3); | 4978 path.moveTo(0, 3); |
5048 path.cubicTo(1, 5, 0, 4, 1.66666675f, 3); | 4979 path.cubicTo(1, 5, 0, 4, 1.66666675f, 3); |
5049 path.close(); | 4980 path.close(); |
5050 pathB.setFillType(SkPath::kWinding_FillType); | 4981 pathB.setFillType(SkPath::kWinding_FillType); |
5051 pathB.moveTo(1, 5); | 4982 pathB.moveTo(1, 5); |
5052 pathB.cubicTo(0, 4, 1.66666675f, 3, 0, 3); | 4983 pathB.cubicTo(0, 4, 1.66666675f, 3, 0, 3); |
5053 pathB.close(); | 4984 pathB.close(); |
5054 testPathOpCheck(reporter, path, pathB, kIntersect_SkPathOp, filename, FLAGS_
runFail); | 4985 testPathOp(reporter, path, pathB, kIntersect_SkPathOp, filename); |
5055 } | 4986 } |
5056 | 4987 |
5057 /* | |
5058 FAILED: d:\cygwin\puregit\tests\pathopsextendedtest.cpp:346 0 */ | |
5059 static void loops56i(skiatest::Reporter* reporter, const char* filename) { | 4988 static void loops56i(skiatest::Reporter* reporter, const char* filename) { |
5060 SkPath path, pathB; | 4989 SkPath path, pathB; |
5061 path.setFillType(SkPath::kWinding_FillType); | 4990 path.setFillType(SkPath::kWinding_FillType); |
5062 path.moveTo(1, 2); | 4991 path.moveTo(1, 2); |
5063 path.cubicTo(2, 4, 0.99999994f, 3, 2.66666675f, 2); | 4992 path.cubicTo(2, 4, 0.99999994f, 3, 2.66666675f, 2); |
5064 path.close(); | 4993 path.close(); |
5065 pathB.setFillType(SkPath::kWinding_FillType); | 4994 pathB.setFillType(SkPath::kWinding_FillType); |
5066 pathB.moveTo(2, 4); | 4995 pathB.moveTo(2, 4); |
5067 pathB.cubicTo(0.99999994f, 3, 2.66666675f, 2, 1, 2); | 4996 pathB.cubicTo(0.99999994f, 3, 2.66666675f, 2, 1, 2); |
5068 pathB.close(); | 4997 pathB.close(); |
5069 testPathOpCheck(reporter, path, pathB, kIntersect_SkPathOp, filename, FLAGS_
runFail); | 4998 testPathOp(reporter, path, pathB, kIntersect_SkPathOp, filename); |
5070 } | 4999 } |
5071 | 5000 |
5072 /* | |
5073 FAILED: d:\cygwin\puregit\tests\pathopsextendedtest.cpp:346 0 */ | |
5074 static void loops57i(skiatest::Reporter* reporter, const char* filename) { | 5001 static void loops57i(skiatest::Reporter* reporter, const char* filename) { |
5075 SkPath path, pathB; | 5002 SkPath path, pathB; |
5076 path.setFillType(SkPath::kWinding_FillType); | 5003 path.setFillType(SkPath::kWinding_FillType); |
5077 path.moveTo(1, 3); | 5004 path.moveTo(1, 3); |
5078 path.cubicTo(2, 5, 0.99999994f, 4, 2.66666675f, 3); | 5005 path.cubicTo(2, 5, 0.99999994f, 4, 2.66666675f, 3); |
5079 path.close(); | 5006 path.close(); |
5080 pathB.setFillType(SkPath::kWinding_FillType); | 5007 pathB.setFillType(SkPath::kWinding_FillType); |
5081 pathB.moveTo(2, 5); | 5008 pathB.moveTo(2, 5); |
5082 pathB.cubicTo(0.99999994f, 4, 2.66666675f, 3, 1, 3); | 5009 pathB.cubicTo(0.99999994f, 4, 2.66666675f, 3, 1, 3); |
5083 pathB.close(); | 5010 pathB.close(); |
5084 testPathOpCheck(reporter, path, pathB, kIntersect_SkPathOp, filename, FLAGS_
runFail); | 5011 testPathOp(reporter, path, pathB, kIntersect_SkPathOp, filename); |
5085 } | 5012 } |
5086 | 5013 |
5087 /* | |
5088 FAILED: d:\cygwin\puregit\tests\pathopsextendedtest.cpp:346 0 */ | |
5089 static void loops58i(skiatest::Reporter* reporter, const char* filename) { | 5014 static void loops58i(skiatest::Reporter* reporter, const char* filename) { |
5090 SkPath path, pathB; | 5015 SkPath path, pathB; |
5091 path.setFillType(SkPath::kWinding_FillType); | 5016 path.setFillType(SkPath::kWinding_FillType); |
5092 path.moveTo(2, 3); | 5017 path.moveTo(2, 3); |
5093 path.cubicTo(3, 5, 2, 4, 3.66666651f, 3); | 5018 path.cubicTo(3, 5, 2, 4, 3.66666651f, 3); |
5094 path.close(); | 5019 path.close(); |
5095 pathB.setFillType(SkPath::kWinding_FillType); | 5020 pathB.setFillType(SkPath::kWinding_FillType); |
5096 pathB.moveTo(3, 5); | 5021 pathB.moveTo(3, 5); |
5097 pathB.cubicTo(2, 4, 3.66666651f, 3, 2, 3); | 5022 pathB.cubicTo(2, 4, 3.66666651f, 3, 2, 3); |
5098 pathB.close(); | 5023 pathB.close(); |
5099 testPathOpCheck(reporter, path, pathB, kIntersect_SkPathOp, filename, FLAGS_
runFail); | 5024 testPathOp(reporter, path, pathB, kIntersect_SkPathOp, filename); |
5100 } | 5025 } |
5101 | 5026 |
5102 /* | 5027 static void loops58iAsQuads(skiatest::Reporter* reporter, const char* filename)
{ |
5103 FAILED: d:\cygwin\puregit\tests\pathopsextendedtest.cpp:346» 0 */ | 5028 SkPath path, pathB; |
| 5029 path.setFillType(SkPath::kWinding_FillType); |
| 5030 path.moveTo(2, 3); |
| 5031 path.cubicTo(3, 5, 2, 4, 3.66666651f, 3); |
| 5032 path.close(); |
| 5033 pathB.setFillType(SkPath::kWinding_FillType); |
| 5034 pathB.moveTo(3, 5); |
| 5035 pathB.cubicTo(2, 4, 3.66666651f, 3, 2, 3); |
| 5036 pathB.close(); |
| 5037 SkPath qPath, qPathB; |
| 5038 CubicPathToQuads(path, &qPath); |
| 5039 CubicPathToQuads(pathB, &qPathB); |
| 5040 // SkPoint from = {2.61714339f,1.90228665f}; |
| 5041 // SkPoint to = {2.617045833359139f,1.9013528935803314f}; |
| 5042 // path_edit(from, to, &qPathB); |
| 5043 testPathOp(reporter, qPath, qPathB, kIntersect_SkPathOp, filename); |
| 5044 } |
| 5045 |
5104 static void loops59i(skiatest::Reporter* reporter, const char* filename) { | 5046 static void loops59i(skiatest::Reporter* reporter, const char* filename) { |
5105 SkPath path, pathB; | 5047 SkPath path, pathB; |
5106 path.setFillType(SkPath::kWinding_FillType); | 5048 path.setFillType(SkPath::kWinding_FillType); |
5107 path.moveTo(0, 6); | 5049 path.moveTo(0, 6); |
5108 path.cubicTo(1, 2, 7.33333302f, 1.66666663f, -7.5f, 2); | 5050 path.cubicTo(1, 2, 7.33333302f, 1.66666663f, -7.5f, 2); |
5109 path.close(); | 5051 path.close(); |
5110 pathB.setFillType(SkPath::kWinding_FillType); | 5052 pathB.setFillType(SkPath::kWinding_FillType); |
5111 pathB.moveTo(1, 2); | 5053 pathB.moveTo(1, 2); |
5112 pathB.cubicTo(7.33333302f, 1.66666663f, -7.5f, 2, 0, 6); | 5054 pathB.cubicTo(7.33333302f, 1.66666663f, -7.5f, 2, 0, 6); |
5113 pathB.close(); | 5055 pathB.close(); |
5114 testPathOp(reporter, path, pathB, kIntersect_SkPathOp, filename); | 5056 testPathOp(reporter, path, pathB, kIntersect_SkPathOp, filename); |
5115 } | 5057 } |
5116 | 5058 |
5117 class PathTest_Private { | |
5118 public: | |
5119 PathTest_Private(SkPath* path) | |
5120 : fPath(path) {} | |
5121 | |
5122 void setPt(int index, SkScalar x, SkScalar y) { | |
5123 fPath->setPt(index, x, y); | |
5124 } | |
5125 | |
5126 SkPath* fPath; | |
5127 }; | |
5128 | |
5129 static void path_edit(const SkPoint& from, const SkPoint& to, SkPath* path) { | |
5130 PathTest_Private testPath(path); | |
5131 for (int index = 0; index < path->countPoints(); ++index) { | |
5132 if (SkDPoint::ApproximatelyEqual(path->getPoint(index), from)) { | |
5133 testPath.setPt(index, to.fX, to.fY); | |
5134 return; | |
5135 } | |
5136 } | |
5137 } | |
5138 | |
5139 static void loops59iasQuads(skiatest::Reporter* reporter, const char* filename)
{ | 5059 static void loops59iasQuads(skiatest::Reporter* reporter, const char* filename)
{ |
5140 SkPath path, pathB; | 5060 SkPath path, pathB; |
5141 path.setFillType(SkPath::kWinding_FillType); | 5061 path.setFillType(SkPath::kWinding_FillType); |
5142 path.moveTo(0, 6); | 5062 path.moveTo(0, 6); |
5143 path.cubicTo(1, 2, 7.33333302f, 1.66666663f, -7.5f, 2); | 5063 path.cubicTo(1, 2, 7.33333302f, 1.66666663f, -7.5f, 2); |
5144 path.close(); | 5064 path.close(); |
5145 pathB.setFillType(SkPath::kWinding_FillType); | 5065 pathB.setFillType(SkPath::kWinding_FillType); |
5146 pathB.moveTo(1, 2); | 5066 pathB.moveTo(1, 2); |
5147 pathB.cubicTo(7.33333302f, 1.66666663f, -7.5f, 2, 0, 6); | 5067 pathB.cubicTo(7.33333302f, 1.66666663f, -7.5f, 2, 0, 6); |
5148 pathB.close(); | 5068 pathB.close(); |
(...skipping 12 matching lines...) Expand all Loading... |
5161 path.moveTo(0, 1); | 5081 path.moveTo(0, 1); |
5162 path.cubicTo(1, 4, 3, 0, 3, 1); | 5082 path.cubicTo(1, 4, 3, 0, 3, 1); |
5163 path.close(); | 5083 path.close(); |
5164 pathB.setFillType(SkPath::kWinding_FillType); | 5084 pathB.setFillType(SkPath::kWinding_FillType); |
5165 pathB.moveTo(0, 3); | 5085 pathB.moveTo(0, 3); |
5166 pathB.cubicTo(1, 3, 1, 0, 4, 1); | 5086 pathB.cubicTo(1, 3, 1, 0, 4, 1); |
5167 pathB.close(); | 5087 pathB.close(); |
5168 testPathOp(reporter, path, pathB, kDifference_SkPathOp, filename); | 5088 testPathOp(reporter, path, pathB, kDifference_SkPathOp, filename); |
5169 } | 5089 } |
5170 | 5090 |
| 5091 void loops61i(skiatest::Reporter* reporter, const char* filename) { |
| 5092 SkPath path, pathB; |
| 5093 path.setFillType(SkPath::kWinding_FillType); |
| 5094 path.moveTo(0, 1); |
| 5095 path.cubicTo(1, 5, -6.33333302f, 0.666666627f, 8, -1); |
| 5096 path.close(); |
| 5097 pathB.setFillType(SkPath::kWinding_FillType); |
| 5098 pathB.moveTo(1, 5); |
| 5099 pathB.cubicTo(-6.33333302f, 0.666666627f, 8, -1, 0, 1); |
| 5100 pathB.close(); |
| 5101 testPathOpCheck(reporter, path, pathB, kIntersect_SkPathOp, filename, FLAGS_
runFail); |
| 5102 } |
| 5103 |
| 5104 static void loops62i(skiatest::Reporter* reporter, const char* filename) { |
| 5105 SkPath path, pathB; |
| 5106 path.setFillType(SkPath::kWinding_FillType); |
| 5107 path.moveTo(0, 2); |
| 5108 path.cubicTo(1, 6, -6.33333302f, 1.66666663f, 8, 0); |
| 5109 path.close(); |
| 5110 pathB.setFillType(SkPath::kWinding_FillType); |
| 5111 pathB.moveTo(1, 6); |
| 5112 pathB.cubicTo(-6.33333302f, 1.66666663f, 8, 0, 0, 2); |
| 5113 pathB.close(); |
| 5114 testPathOpCheck(reporter, path, pathB, kIntersect_SkPathOp, filename, FLAGS_
runFail); |
| 5115 } |
| 5116 |
| 5117 static void loops63i(skiatest::Reporter* reporter, const char* filename) { |
| 5118 SkPath path, pathB; |
| 5119 path.setFillType(SkPath::kWinding_FillType); |
| 5120 path.moveTo(0, 1); |
| 5121 path.cubicTo(2, 4, -4, -0.833333254f, 6, -3); |
| 5122 path.close(); |
| 5123 pathB.setFillType(SkPath::kWinding_FillType); |
| 5124 pathB.moveTo(2, 4); |
| 5125 pathB.cubicTo(-4, -0.833333254f, 6, -3, 0, 1); |
| 5126 pathB.close(); |
| 5127 testPathOpCheck(reporter, path, pathB, kIntersect_SkPathOp, filename, FLAGS_
runFail); |
| 5128 } |
| 5129 |
| 5130 static void cubics44d(skiatest::Reporter* reporter, const char* filename) { |
| 5131 SkPath path, pathB; |
| 5132 path.setFillType(SkPath::kWinding_FillType); |
| 5133 path.moveTo(3, 4); |
| 5134 path.cubicTo(2, 5, 3, 1, 6, 2); |
| 5135 path.close(); |
| 5136 pathB.setFillType(SkPath::kWinding_FillType); |
| 5137 pathB.moveTo(1, 3); |
| 5138 pathB.cubicTo(2, 6, 4, 3, 5, 2); |
| 5139 pathB.close(); |
| 5140 testPathOpCheck(reporter, path, pathB, kDifference_SkPathOp, filename, FLAGS
_runFail); |
| 5141 } |
| 5142 |
| 5143 static void cubics45u(skiatest::Reporter* reporter, const char* filename) { |
| 5144 SkPath path, pathB; |
| 5145 path.setFillType(SkPath::kWinding_FillType); |
| 5146 path.moveTo(1, 3); |
| 5147 path.cubicTo(2, 6, 4, 3, 5, 2); |
| 5148 path.close(); |
| 5149 pathB.setFillType(SkPath::kWinding_FillType); |
| 5150 pathB.moveTo(3, 4); |
| 5151 pathB.cubicTo(2, 5, 3, 1, 6, 2); |
| 5152 pathB.close(); |
| 5153 testPathOpCheck(reporter, path, pathB, kUnion_SkPathOp, filename, FLAGS_runF
ail); |
| 5154 } |
| 5155 |
5171 static void (*skipTest)(skiatest::Reporter* , const char* filename) = 0; | 5156 static void (*skipTest)(skiatest::Reporter* , const char* filename) = 0; |
5172 static void (*firstTest)(skiatest::Reporter* , const char* filename) = loops59i; | 5157 static void (*firstTest)(skiatest::Reporter* , const char* filename) = 0; |
5173 static void (*stopTest)(skiatest::Reporter* , const char* filename) = 0; | 5158 static void (*stopTest)(skiatest::Reporter* , const char* filename) = 0; |
5174 | 5159 |
| 5160 #define TEST(name) { name, #name } |
| 5161 |
5175 static struct TestDesc tests[] = { | 5162 static struct TestDesc tests[] = { |
| 5163 TEST(cubics44d), |
| 5164 TEST(cubics45u), |
| 5165 TEST(loops61i), |
| 5166 TEST(loops62i), |
| 5167 TEST(loops63i), |
| 5168 TEST(loops58iAsQuads), |
5176 TEST(cubics41d), | 5169 TEST(cubics41d), |
5177 TEST(loops59iasQuads), | 5170 TEST(loops59iasQuads), |
5178 TEST(loops59i), | 5171 TEST(loops59i), |
5179 TEST(loops41i), | |
5180 TEST(loops42i), | |
5181 TEST(loops43i), | |
5182 TEST(loops44i), | 5172 TEST(loops44i), |
5183 TEST(loops45i), | 5173 TEST(loops45i), |
5184 TEST(loops46i), | 5174 TEST(loops46i), |
5185 TEST(loops47i), | 5175 TEST(loops47i), |
5186 TEST(loops48i), | 5176 TEST(loops48i), |
5187 TEST(loops49i), | 5177 TEST(loops49i), |
5188 TEST(loops50i), | 5178 TEST(loops50i), |
5189 TEST(loops51i), | 5179 TEST(loops51i), |
5190 TEST(loops52i), | 5180 TEST(loops52i), |
5191 TEST(loops53i), | 5181 TEST(loops53i), |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5247 TEST(loops5i), | 5237 TEST(loops5i), |
5248 TEST(cubicOp140), | 5238 TEST(cubicOp140), |
5249 TEST(cubicOp139), | 5239 TEST(cubicOp139), |
5250 TEST(cubics138), | 5240 TEST(cubics138), |
5251 TEST(cubics137), | 5241 TEST(cubics137), |
5252 TEST(cubicOp136a), | 5242 TEST(cubicOp136a), |
5253 TEST(cubicOp136), | 5243 TEST(cubicOp136), |
5254 TEST(cubicOp135), | 5244 TEST(cubicOp135), |
5255 TEST(cubicOp134), | 5245 TEST(cubicOp134), |
5256 TEST(cubicOp133), | 5246 TEST(cubicOp133), |
5257 TEST(loop16), | |
5258 TEST(loop15), | |
5259 TEST(loop12), | 5247 TEST(loop12), |
5260 TEST(cubicOp132), | 5248 TEST(cubicOp132), |
5261 TEST(loop11), | 5249 TEST(loop11), |
5262 TEST(loop10), | 5250 TEST(loop10), |
5263 TEST(circlesOp3), | 5251 TEST(circlesOp3), |
5264 TEST(loop9), | 5252 TEST(loop9), |
5265 TEST(loop8), | 5253 TEST(loop8), |
5266 TEST(rects5), | 5254 TEST(rects5), |
5267 TEST(loop7), | 5255 TEST(loop7), |
5268 TEST(cubicOp130a), | 5256 TEST(cubicOp130a), |
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5502 TEST(cubicOp6d), | 5490 TEST(cubicOp6d), |
5503 TEST(cubicOp5d), | 5491 TEST(cubicOp5d), |
5504 TEST(cubicOp3d), | 5492 TEST(cubicOp3d), |
5505 TEST(cubicOp2d), | 5493 TEST(cubicOp2d), |
5506 TEST(cubicOp1d), | 5494 TEST(cubicOp1d), |
5507 }; | 5495 }; |
5508 | 5496 |
5509 static const size_t testCount = SK_ARRAY_COUNT(tests); | 5497 static const size_t testCount = SK_ARRAY_COUNT(tests); |
5510 | 5498 |
5511 static struct TestDesc subTests[] = { | 5499 static struct TestDesc subTests[] = { |
5512 TEST(loops40i), | 5500 TEST(cubics45u), |
5513 TEST(loops39i), | 5501 TEST(loops61i), |
5514 TEST(loops38i), | 5502 TEST(loops62i), |
5515 TEST(loops37i), | |
5516 TEST(loops36i), | |
5517 TEST(loops35i), | |
5518 TEST(loops34i), | |
5519 TEST(loops33i), | |
5520 TEST(loops32i), | |
5521 TEST(loops31i), | |
5522 TEST(loops30i), | |
5523 TEST(loops29i), | |
5524 TEST(loops28i), | |
5525 TEST(loops27i), | |
5526 TEST(loops26i), | |
5527 TEST(loops25i), | |
5528 TEST(loops24i), | |
5529 TEST(loops23i), | |
5530 TEST(loops22i), | |
5531 TEST(loops21i), | |
5532 TEST(loops20i), | |
5533 TEST(cubics20d), | |
5534 TEST(cubics6d), | |
5535 TEST(cubics7d), | |
5536 TEST(cubics8d), | |
5537 TEST(cubics9d), | |
5538 TEST(cubics10u), | |
5539 TEST(cubics11i), | |
5540 TEST(cubics12d), | |
5541 TEST(cubics13d), | |
5542 TEST(cubics14d), | |
5543 TEST(cubics15d), | |
5544 TEST(cubics16i), | |
5545 TEST(cubics17d), | |
5546 TEST(cubics18d), | |
5547 TEST(cubics19d), | |
5548 TEST(cubicOp157), | |
5549 TEST(cubicOp142), | |
5550 TEST(loops4i), | |
5551 TEST(quadRect1), | |
5552 TEST(quadRect2), | |
5553 TEST(quadRect3), | |
5554 TEST(quadRect4), | |
5555 TEST(quadRect5), | |
5556 TEST(quadRect6), | |
5557 }; | 5503 }; |
5558 | 5504 |
5559 static const size_t subTestCount = SK_ARRAY_COUNT(subTests); | 5505 static const size_t subTestCount = SK_ARRAY_COUNT(subTests); |
5560 | 5506 |
5561 static void (*firstSubTest)(skiatest::Reporter* , const char* filename) = 0; | 5507 static void (*firstSubTest)(skiatest::Reporter* , const char* filename) = 0; |
5562 | 5508 |
5563 static bool runSubTests = false; | 5509 static bool runSubTests = true; |
5564 static bool runSubTestsFirst = true; | 5510 static bool runSubTestsFirst = true; |
5565 static bool runReverse = false; | 5511 static bool runReverse = false; |
5566 | 5512 |
5567 DEF_TEST(PathOpsOp, reporter) { | 5513 DEF_TEST(PathOpsOp, reporter) { |
5568 #if DEBUG_SHOW_TEST_NAME | 5514 #if DEBUG_SHOW_TEST_NAME |
5569 strncpy(DEBUG_FILENAME_STRING, "", DEBUG_FILENAME_STRING_LENGTH); | 5515 strncpy(DEBUG_FILENAME_STRING, "", DEBUG_FILENAME_STRING_LENGTH); |
5570 #endif | 5516 #endif |
5571 if (runSubTests && runSubTestsFirst) { | 5517 if (runSubTests && runSubTestsFirst) { |
5572 RunTestSet(reporter, subTests, subTestCount, firstSubTest, NULL, stopTes
t, runReverse); | 5518 RunTestSet(reporter, subTests, subTestCount, firstSubTest, NULL, stopTes
t, runReverse); |
5573 } | 5519 } |
5574 RunTestSet(reporter, tests, testCount, firstTest, skipTest, stopTest, runRev
erse); | 5520 RunTestSet(reporter, tests, testCount, firstTest, skipTest, stopTest, runRev
erse); |
5575 if (runSubTests && !runSubTestsFirst) { | 5521 if (runSubTests && !runSubTestsFirst) { |
5576 RunTestSet(reporter, subTests, subTestCount, firstSubTest, NULL, stopTes
t, runReverse); | 5522 RunTestSet(reporter, subTests, subTestCount, firstSubTest, NULL, stopTes
t, runReverse); |
5577 } | 5523 } |
5578 } | 5524 } |
5579 | 5525 |
5580 static void bufferOverflow(skiatest::Reporter* reporter, const char* filename) { | 5526 static void bufferOverflow(skiatest::Reporter* reporter, const char* filename) { |
5581 SkPath path; | 5527 SkPath path; |
5582 path.addRect(0,0, 300,170141183460469231731687303715884105728.f); | 5528 path.addRect(0,0, 300,170141183460469231731687303715884105728.f); |
5583 SkPath pathB; | 5529 SkPath pathB; |
5584 pathB.addRect(0,0, 300,16); | 5530 pathB.addRect(0,0, 300,16); |
5585 testPathOp(reporter, path, pathB, kUnion_SkPathOp, filename); | 5531 testPathOpFailCheck(reporter, path, pathB, kUnion_SkPathOp, filename); |
5586 } | 5532 } |
5587 | 5533 |
5588 // m 100,0 60,170 -160,-110 200,0 -170,11000000000 z | 5534 // m 100,0 60,170 -160,-110 200,0 -170,11000000000 z |
5589 static void fuzz433(skiatest::Reporter* reporter, const char* filename) { | 5535 static void fuzz433(skiatest::Reporter* reporter, const char* filename) { |
5590 SkPath path1, path2; | 5536 SkPath path1, path2; |
5591 path1.moveTo(100,0); | 5537 path1.moveTo(100,0); |
5592 path1.lineTo(60,170); | 5538 path1.lineTo(60,170); |
5593 path1.lineTo(-160,-110); | 5539 path1.lineTo(-160,-110); |
5594 path1.lineTo(200,0); | 5540 path1.lineTo(200,0); |
5595 path1.lineTo(-170,11000000000.0f); | 5541 path1.lineTo(-170,11000000000.0f); |
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5762 | 5708 |
5763 SkPath path1(path); | 5709 SkPath path1(path); |
5764 path.reset(); | 5710 path.reset(); |
5765 path.setFillType((SkPath::FillType) 0); | 5711 path.setFillType((SkPath::FillType) 0); |
5766 | 5712 |
5767 SkPath path2(path); | 5713 SkPath path2(path); |
5768 testPathFailOp(reporter, path1, path2, (SkPathOp) 2, filename); | 5714 testPathFailOp(reporter, path1, path2, (SkPathOp) 2, filename); |
5769 } | 5715 } |
5770 | 5716 |
5771 static struct TestDesc failTests[] = { | 5717 static struct TestDesc failTests[] = { |
| 5718 TEST(fuzz487a), |
5772 TEST(fuzz433), | 5719 TEST(fuzz433), |
5773 TEST(fuzz1), | 5720 TEST(fuzz1), |
5774 TEST(fuzz714), | 5721 TEST(fuzz714), |
5775 TEST(fuzz487a), | |
5776 TEST(fuzz487b), | 5722 TEST(fuzz487b), |
5777 TEST(fuzz433b), | 5723 TEST(fuzz433b), |
5778 TEST(bufferOverflow), | 5724 TEST(bufferOverflow), |
5779 }; | 5725 }; |
5780 | 5726 |
5781 static const size_t failTestCount = SK_ARRAY_COUNT(failTests); | 5727 static const size_t failTestCount = SK_ARRAY_COUNT(failTests); |
5782 | 5728 |
5783 DEF_TEST(PathOpsFailOp, reporter) { | 5729 DEF_TEST(PathOpsFailOp, reporter) { |
5784 #if DEBUG_SHOW_TEST_NAME | 5730 #if DEBUG_SHOW_TEST_NAME |
5785 strncpy(DEBUG_FILENAME_STRING, "", DEBUG_FILENAME_STRING_LENGTH); | 5731 strncpy(DEBUG_FILENAME_STRING, "", DEBUG_FILENAME_STRING_LENGTH); |
5786 #endif | 5732 #endif |
5787 RunTestSet(reporter, failTests, failTestCount, NULL, NULL, NULL, false); | 5733 RunTestSet(reporter, failTests, failTestCount, NULL, NULL, NULL, false); |
5788 } | 5734 } |
OLD | NEW |