| 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 | 9 |
| 9 #define TEST(name) { name, #name } | 10 #define TEST(name) { name, #name } |
| 10 | 11 |
| 11 static void cubicOp1d(skiatest::Reporter* reporter, const char* filename) { | 12 static void cubicOp1d(skiatest::Reporter* reporter, const char* filename) { |
| 12 SkPath path, pathB; | 13 SkPath path, pathB; |
| 13 path.setFillType(SkPath::kWinding_FillType); | 14 path.setFillType(SkPath::kWinding_FillType); |
| 14 path.moveTo(0,1); | 15 path.moveTo(0,1); |
| 15 path.cubicTo(0,2, 1,0, 1,0); | 16 path.cubicTo(0,2, 1,0, 1,0); |
| 16 path.close(); | 17 path.close(); |
| 17 pathB.setFillType(SkPath::kWinding_FillType); | 18 pathB.setFillType(SkPath::kWinding_FillType); |
| (...skipping 1807 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1825 pathB.cubicTo(263, 286.761414f, 260.761414f, 289, 258, 289); | 1826 pathB.cubicTo(263, 286.761414f, 260.761414f, 289, 258, 289); |
| 1826 pathB.lineTo(96, 289); | 1827 pathB.lineTo(96, 289); |
| 1827 pathB.cubicTo(93.2385788f, 289, 91, 286.761414f, 91, 284); | 1828 pathB.cubicTo(93.2385788f, 289, 91, 286.761414f, 91, 284); |
| 1828 pathB.lineTo(91, 127); | 1829 pathB.lineTo(91, 127); |
| 1829 pathB.cubicTo(91, 124.238579f, 93.2385788f, 122, 96, 122); | 1830 pathB.cubicTo(91, 124.238579f, 93.2385788f, 122, 96, 122); |
| 1830 pathB.lineTo(258, 122); | 1831 pathB.lineTo(258, 122); |
| 1831 pathB.close(); | 1832 pathB.close(); |
| 1832 testPathOp(reporter, path, pathB, kIntersect_PathOp, filename); | 1833 testPathOp(reporter, path, pathB, kIntersect_PathOp, filename); |
| 1833 } | 1834 } |
| 1834 | 1835 |
| 1835 #define ISSUE_1417_WORKING_ON_LINUX_32 0 // fails only in release linux skia_ar
ch_width=32 | |
| 1836 #if ISSUE_1417_WORKING_ON_LINUX_32 | |
| 1837 static void issue1417(skiatest::Reporter* reporter, const char* filename) { | 1836 static void issue1417(skiatest::Reporter* reporter, const char* filename) { |
| 1838 SkPath path1; | 1837 SkPath path1; |
| 1839 path1.moveTo(122.58908843994140625f, 82.2836456298828125f); | 1838 path1.moveTo(122.58908843994140625f, 82.2836456298828125f); |
| 1840 path1.quadTo(129.8215789794921875f, 80, 138, 80); | 1839 path1.quadTo(129.8215789794921875f, 80, 138, 80); |
| 1841 path1.quadTo(147.15692138671875f, 80, 155.1280364990234375f, 82.86279296875f
); | 1840 path1.quadTo(147.15692138671875f, 80, 155.1280364990234375f, 82.86279296875f
); |
| 1842 path1.lineTo(161.1764678955078125f, 100); | 1841 path1.lineTo(161.1764678955078125f, 100); |
| 1843 path1.lineTo(161.1764678955078125f, 100); | 1842 path1.lineTo(161.1764678955078125f, 100); |
| 1844 path1.lineTo(115.29412078857421875f, 100); | 1843 path1.lineTo(115.29412078857421875f, 100); |
| 1845 path1.lineTo(115.29412078857421875f, 100); | 1844 path1.lineTo(115.29412078857421875f, 100); |
| 1846 path1.lineTo(122.58908843994140625f, 82.2836456298828125f); | 1845 path1.lineTo(122.58908843994140625f, 82.2836456298828125f); |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1938 path2.lineTo(132.2864990234375f, 169.6969757080078125f); | 1937 path2.lineTo(132.2864990234375f, 169.6969757080078125f); |
| 1939 path2.lineTo(132.2864990234375f, 169.6969757080078125f); | 1938 path2.lineTo(132.2864990234375f, 169.6969757080078125f); |
| 1940 path2.lineTo(118.68194580078125f, 160.343841552734375f); | 1939 path2.lineTo(118.68194580078125f, 160.343841552734375f); |
| 1941 path2.lineTo(118.68194580078125f, 160.343841552734375f); | 1940 path2.lineTo(118.68194580078125f, 160.343841552734375f); |
| 1942 path2.lineTo(113.232177734375f, 173.5789947509765625f); | 1941 path2.lineTo(113.232177734375f, 173.5789947509765625f); |
| 1943 path2.lineTo(113.232177734375f, 173.5789947509765625f); | 1942 path2.lineTo(113.232177734375f, 173.5789947509765625f); |
| 1944 path2.close(); | 1943 path2.close(); |
| 1945 | 1944 |
| 1946 testPathOp(reporter, path1, path2, kUnion_PathOp, filename); | 1945 testPathOp(reporter, path1, path2, kUnion_PathOp, filename); |
| 1947 } | 1946 } |
| 1948 #endif | |
| 1949 | 1947 |
| 1950 static void issue1418(skiatest::Reporter* reporter, const char* filename) { | 1948 static void issue1418(skiatest::Reporter* reporter, const char* filename) { |
| 1951 SkPath path1; | 1949 SkPath path1; |
| 1952 path1.moveTo(0, 0); | 1950 path1.moveTo(0, 0); |
| 1953 path1.lineTo(1, 0); | 1951 path1.lineTo(1, 0); |
| 1954 path1.lineTo(1, 0); | 1952 path1.lineTo(1, 0); |
| 1955 path1.lineTo(1, 1); | 1953 path1.lineTo(1, 1); |
| 1956 path1.lineTo(1, 1); | 1954 path1.lineTo(1, 1); |
| 1957 path1.lineTo(0, 1); | 1955 path1.lineTo(0, 1); |
| 1958 path1.lineTo(0, 1); | 1956 path1.lineTo(0, 1); |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2058 pathB.lineTo(1, 3); | 2056 pathB.lineTo(1, 3); |
| 2059 pathB.close(); | 2057 pathB.close(); |
| 2060 pathB.moveTo(2, 2); | 2058 pathB.moveTo(2, 2); |
| 2061 pathB.lineTo(3, 2); | 2059 pathB.lineTo(3, 2); |
| 2062 pathB.lineTo(3, 3); | 2060 pathB.lineTo(3, 3); |
| 2063 pathB.lineTo(2, 3); | 2061 pathB.lineTo(2, 3); |
| 2064 pathB.close(); | 2062 pathB.close(); |
| 2065 testPathOp(reporter, path, pathB, kXOR_PathOp, filename); | 2063 testPathOp(reporter, path, pathB, kXOR_PathOp, filename); |
| 2066 } | 2064 } |
| 2067 | 2065 |
| 2068 #define ISSUE_1435_FIXED 0 | |
| 2069 #if ISSUE_1435_FIXED | |
| 2070 // this fails to generate two interior line segments | 2066 // this fails to generate two interior line segments |
| 2071 // an earlier pathops succeeded, but still failed to generate one interior line
segment | 2067 // an earlier pathops succeeded, but still failed to generate one interior line
segment |
| 2072 // (but was saved by assemble, which works around a single line missing segment) | 2068 // (but was saved by assemble, which works around a single line missing segment) |
| 2073 static void issue1435(skiatest::Reporter* reporter, const char* filename) { | 2069 static void issue1435(skiatest::Reporter* reporter, const char* filename) { |
| 2074 SkPath path1; | 2070 SkPath path1; |
| 2075 path1.moveTo(160, 60); | 2071 path1.moveTo(160, 60); |
| 2076 path1.lineTo(220, 230); | 2072 path1.lineTo(220, 230); |
| 2077 path1.lineTo(60, 120); | 2073 path1.lineTo(60, 120); |
| 2078 path1.lineTo(260, 120); | 2074 path1.lineTo(260, 120); |
| 2079 path1.lineTo(90, 230); | 2075 path1.lineTo(90, 230); |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2113 path2.moveTo(195.830978f, 161.521133f); | 2109 path2.moveTo(195.830978f, 161.521133f); |
| 2114 path2.lineTo(207.878281f, 153.725815f); | 2110 path2.lineTo(207.878281f, 153.725815f); |
| 2115 path2.quadTo(208, 151.888062f, 208, 150); | 2111 path2.quadTo(208, 151.888062f, 208, 150); |
| 2116 path2.quadTo(208, 132.942657f, 198.066238f, 120); | 2112 path2.quadTo(208, 132.942657f, 198.066238f, 120); |
| 2117 path2.lineTo(181.176468f, 120); | 2113 path2.lineTo(181.176468f, 120); |
| 2118 path2.lineTo(195.830978f, 161.521133f); | 2114 path2.lineTo(195.830978f, 161.521133f); |
| 2119 path2.close(); | 2115 path2.close(); |
| 2120 path2.setFillType(SkPath::kEvenOdd_FillType); | 2116 path2.setFillType(SkPath::kEvenOdd_FillType); |
| 2121 testPathOp(reporter, path1, path2, kIntersect_PathOp, filename); | 2117 testPathOp(reporter, path1, path2, kIntersect_PathOp, filename); |
| 2122 } | 2118 } |
| 2123 #endif | |
| 2124 | 2119 |
| 2125 static void skpkkiste_to716(skiatest::Reporter* reporter, const char* filename)
{ | 2120 static void skpkkiste_to716(skiatest::Reporter* reporter, const char* filename)
{ |
| 2126 SkPath path; | 2121 SkPath path; |
| 2127 path.setFillType(SkPath::kEvenOdd_FillType); | 2122 path.setFillType(SkPath::kEvenOdd_FillType); |
| 2128 path.moveTo(1173, 284); | 2123 path.moveTo(1173, 284); |
| 2129 path.cubicTo(1173, 285.125824f, 1173.37207f, 286.164734f, 1174, 287.000488f)
; | 2124 path.cubicTo(1173, 285.125824f, 1173.37207f, 286.164734f, 1174, 287.000488f)
; |
| 2130 path.lineTo(1174, 123.999496f); | 2125 path.lineTo(1174, 123.999496f); |
| 2131 path.cubicTo(1173.37207f, 124.835243f, 1173, 125.874168f, 1173, 127); | 2126 path.cubicTo(1173.37207f, 124.835243f, 1173, 125.874168f, 1173, 127); |
| 2132 path.lineTo(1173, 284); | 2127 path.lineTo(1173, 284); |
| 2133 path.close(); | 2128 path.close(); |
| (...skipping 595 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2729 pathB.cubicTo(265.140167f, 785, 322, 842.307556f, 322, 913); | 2724 pathB.cubicTo(265.140167f, 785, 322, 842.307556f, 322, 913); |
| 2730 pathB.cubicTo(322, 983.692444f, 265.140167f, 1041, 195, 1041); | 2725 pathB.cubicTo(322, 983.692444f, 265.140167f, 1041, 195, 1041); |
| 2731 pathB.lineTo(194, 1041); | 2726 pathB.lineTo(194, 1041); |
| 2732 pathB.cubicTo(123.85984f, 1041, 67, 983.692444f, 67, 913); | 2727 pathB.cubicTo(123.85984f, 1041, 67, 983.692444f, 67, 913); |
| 2733 pathB.cubicTo(67, 842.307556f, 123.85984f, 785, 194, 785); | 2728 pathB.cubicTo(67, 842.307556f, 123.85984f, 785, 194, 785); |
| 2734 pathB.lineTo(195, 785); | 2729 pathB.lineTo(195, 785); |
| 2735 pathB.close(); | 2730 pathB.close(); |
| 2736 testPathOp(reporter, path, pathB, kIntersect_PathOp, filename); | 2731 testPathOp(reporter, path, pathB, kIntersect_PathOp, filename); |
| 2737 } | 2732 } |
| 2738 | 2733 |
| 2739 #define SKPS_WORKING 0 | 2734 #define QUAD_CUBIC_FAILS_TO_FIND_INTERSECTION 0 |
| 2740 #if SKPS_WORKING | 2735 #if QUAD_CUBIC_FAILS_TO_FIND_INTERSECTION |
| 2741 // this fails because cubic/quad misses an intersection (failure is isolated in
c/q int test) | 2736 // this fails because cubic/quad misses an intersection (failure is isolated in
c/q int test) |
| 2742 static void skpcarrot_is24(skiatest::Reporter* reporter, const char* filename) { | 2737 static void skpcarrot_is24(skiatest::Reporter* reporter, const char* filename) { |
| 2743 SkPath path; | 2738 SkPath path; |
| 2744 path.setFillType(SkPath::kEvenOdd_FillType); | 2739 path.setFillType(SkPath::kEvenOdd_FillType); |
| 2745 path.moveTo(945, 597); | 2740 path.moveTo(945, 597); |
| 2746 path.quadTo(913.93396f, 597, 891.96698f, 618.96698f); | 2741 path.quadTo(913.93396f, 597, 891.96698f, 618.96698f); |
| 2747 path.quadTo(870, 640.93396f, 870, 672); | 2742 path.quadTo(870, 640.93396f, 870, 672); |
| 2748 path.quadTo(870, 703.06604f, 891.96698f, 725.03302f); | 2743 path.quadTo(870, 703.06604f, 891.96698f, 725.03302f); |
| 2749 path.quadTo(913.93396f, 747, 945, 747); | 2744 path.quadTo(913.93396f, 747, 945, 747); |
| 2750 path.quadTo(976.06604f, 747, 998.03302f, 725.03302f); | 2745 path.quadTo(976.06604f, 747, 998.03302f, 725.03302f); |
| (...skipping 519 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3270 path.moveTo(2,4); | 3265 path.moveTo(2,4); |
| 3271 path.cubicTo(2,3, 6,4, 1,0); | 3266 path.cubicTo(2,3, 6,4, 1,0); |
| 3272 path.close(); | 3267 path.close(); |
| 3273 pathB.setFillType(SkPath::kWinding_FillType); | 3268 pathB.setFillType(SkPath::kWinding_FillType); |
| 3274 pathB.moveTo(4,6); | 3269 pathB.moveTo(4,6); |
| 3275 pathB.cubicTo(0,1, 4,2, 3,2); | 3270 pathB.cubicTo(0,1, 4,2, 3,2); |
| 3276 pathB.close(); | 3271 pathB.close(); |
| 3277 testPathOp(reporter, path, pathB, kDifference_PathOp, filename); | 3272 testPathOp(reporter, path, pathB, kDifference_PathOp, filename); |
| 3278 } | 3273 } |
| 3279 | 3274 |
| 3280 // triggers untested calcLoopSpanCount code path | |
| 3281 #if 0 | |
| 3282 static void cubicOp113(skiatest::Reporter* reporter, const char* filename) { | 3275 static void cubicOp113(skiatest::Reporter* reporter, const char* filename) { |
| 3283 SkPath path, pathB; | 3276 SkPath path, pathB; |
| 3284 path.moveTo(2,4); | 3277 path.moveTo(2,4); |
| 3285 path.cubicTo(3,5, 2.33333325f,4.33333349f, 3.83333325f,3.83333349f); | 3278 path.cubicTo(3,5, 2.33333325f,4.33333349f, 3.83333325f,3.83333349f); |
| 3286 path.close(); | 3279 path.close(); |
| 3287 pathB.moveTo(3,5); | 3280 pathB.moveTo(3,5); |
| 3288 pathB.cubicTo(2.33333325f,4.33333349f, 3.83333325f,3.83333349f, 2,4); | 3281 pathB.cubicTo(2.33333325f,4.33333349f, 3.83333325f,3.83333349f, 2,4); |
| 3289 pathB.close(); | 3282 pathB.close(); |
| 3290 testPathOp(reporter, path, pathB, kDifference_PathOp, filename); | 3283 testPathOp(reporter, path, pathB, kDifference_PathOp, filename); |
| 3291 } | 3284 } |
| 3292 #endif | |
| 3293 | 3285 |
| 3286 #define CUBIC_OP_114 0 |
| 3287 #if CUBIC_OP_114 |
| 3294 static void cubicOp114(skiatest::Reporter* reporter, const char* filename) { | 3288 static void cubicOp114(skiatest::Reporter* reporter, const char* filename) { |
| 3295 SkPath path, pathB; | 3289 SkPath path, pathB; |
| 3296 path.setFillType(SkPath::kWinding_FillType); | 3290 path.setFillType(SkPath::kWinding_FillType); |
| 3297 path.moveTo(0, 1); | 3291 path.moveTo(0, 1); |
| 3298 path.cubicTo(1, 3, -1, 2, 3.5f, 1.33333337f); | 3292 path.cubicTo(1, 3, -1, 2, 3.5f, 1.33333337f); |
| 3299 path.close(); | 3293 path.close(); |
| 3300 pathB.setFillType(SkPath::kWinding_FillType); | 3294 pathB.setFillType(SkPath::kWinding_FillType); |
| 3301 pathB.moveTo(1, 3); | 3295 pathB.moveTo(1, 3); |
| 3302 pathB.cubicTo(-1, 2, 3.5f, 1.33333337f, 0, 1); | 3296 pathB.cubicTo(-1, 2, 3.5f, 1.33333337f, 0, 1); |
| 3303 pathB.close(); | 3297 pathB.close(); |
| 3304 testPathOp(reporter, path, pathB, kIntersect_PathOp, filename); | 3298 testPathOp(reporter, path, pathB, kIntersect_PathOp, filename); |
| 3305 } | 3299 } |
| 3300 #endif |
| 3301 |
| 3302 static void cubicOp114asQuad(skiatest::Reporter* reporter, const char* filename)
{ |
| 3303 SkPath path, pathB; |
| 3304 path.setFillType(SkPath::kWinding_FillType); |
| 3305 path.moveTo(0, 1); |
| 3306 path.cubicTo(1, 3, -1, 2, 3.5f, 1.33333337f); |
| 3307 path.close(); |
| 3308 pathB.setFillType(SkPath::kWinding_FillType); |
| 3309 pathB.moveTo(1, 3); |
| 3310 pathB.cubicTo(-1, 2, 3.5f, 1.33333337f, 0, 1); |
| 3311 pathB.close(); |
| 3312 SkPath qPath, qPathB; |
| 3313 CubicPathToQuads(path, &qPath); |
| 3314 CubicPathToQuads(pathB, &qPathB); |
| 3315 testPathOp(reporter, qPath, qPathB, kIntersect_PathOp, filename); |
| 3316 } |
| 3306 | 3317 |
| 3307 static void quadOp10i(skiatest::Reporter* reporter, const char* filename) { | 3318 static void quadOp10i(skiatest::Reporter* reporter, const char* filename) { |
| 3308 SkPath path, pathB; | 3319 SkPath path, pathB; |
| 3309 path.moveTo(0, 0); | 3320 path.moveTo(0, 0); |
| 3310 path.quadTo(1, 8, 3, 5); | 3321 path.quadTo(1, 8, 3, 5); |
| 3311 path.lineTo(8, 1); | 3322 path.lineTo(8, 1); |
| 3312 path.close(); | 3323 path.close(); |
| 3313 pathB.moveTo(0, 0); | 3324 pathB.moveTo(0, 0); |
| 3314 pathB.quadTo(8, 1, 4, 8); | 3325 pathB.quadTo(8, 1, 4, 8); |
| 3315 pathB.close(); | 3326 pathB.close(); |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3347 path2.cubicTo(36.71843719482421875, 0.8886508941650390625, | 3358 path2.cubicTo(36.71843719482421875, 0.8886508941650390625, |
| 3348 35.123386383056640625, 0.554015457630157470703125, | 3359 35.123386383056640625, 0.554015457630157470703125, |
| 3349 34.511409759521484375, -0.1152553558349609375); | 3360 34.511409759521484375, -0.1152553558349609375); |
| 3350 path2.cubicTo(33.899425506591796875, -0.7845261096954345703125, | 3361 path2.cubicTo(33.899425506591796875, -0.7845261096954345703125, |
| 3351 34.53484344482421875, -5.6777553558349609375, | 3362 34.53484344482421875, -5.6777553558349609375, |
| 3352 34.53484344482421875, -5.6777553558349609375); | 3363 34.53484344482421875, -5.6777553558349609375); |
| 3353 path2.close(); | 3364 path2.close(); |
| 3354 testPathOp(reporter, path1, path2, kUnion_PathOp, filename); | 3365 testPathOp(reporter, path1, path2, kUnion_PathOp, filename); |
| 3355 } | 3366 } |
| 3356 | 3367 |
| 3357 #define TEST_2540 0 | |
| 3358 #if TEST_2540 // FIXME: extends cubic arm for sorting, marks extension with wro
ng winding? | |
| 3359 static void issue2540(skiatest::Reporter* reporter, const char* filename) { | 3368 static void issue2540(skiatest::Reporter* reporter, const char* filename) { |
| 3360 SkPath path1; | 3369 SkPath path1; |
| 3361 path1.moveTo(26.5054988861083984375, 85.73960113525390625); | 3370 path1.moveTo(26.5054988861083984375, 85.73960113525390625); |
| 3362 path1.cubicTo(84.19739532470703125, 17.77140045166015625, 16.939201354980468
75, 101.86199951171875, 12.631000518798828125, 105.24700164794921875); | 3371 path1.cubicTo(84.19739532470703125, 17.77140045166015625, 16.939201354980468
75, 101.86199951171875, 12.631000518798828125, 105.24700164794921875); |
| 3363 path1.cubicTo(11.0819997787475585937500000, 106.46399688720703125, 11.526000
0228881835937500000, 104.464996337890625, 11.5260000228881835937500000, 104.4649
96337890625); | 3372 path1.cubicTo(11.0819997787475585937500000, 106.46399688720703125, 11.526000
0228881835937500000, 104.464996337890625, 11.5260000228881835937500000, 104.4649
96337890625); |
| 3364 path1.lineTo(23.1654987335205078125, 89.72879791259765625); | 3373 path1.lineTo(23.1654987335205078125, 89.72879791259765625); |
| 3365 path1.cubicTo(23.1654987335205078125, 89.72879791259765625, -10.171300888061
5234375, 119.9160003662109375, -17.1620006561279296875, 120.8249969482421875); | 3374 path1.cubicTo(23.1654987335205078125, 89.72879791259765625, -10.171300888061
5234375, 119.9160003662109375, -17.1620006561279296875, 120.8249969482421875); |
| 3366 path1.cubicTo(-19.1149997711181640625, 121.07900238037109375, -18.0380001068
115234375, 119.79299163818359375, -18.0380001068115234375, 119.79299163818359375
); | 3375 path1.cubicTo(-19.1149997711181640625, 121.07900238037109375, -18.0380001068
115234375, 119.79299163818359375, -18.0380001068115234375, 119.79299163818359375
); |
| 3367 path1.cubicTo(-18.0380001068115234375, 119.79299163818359375, 14.22100067138
671875, 90.60700225830078125, 26.5054988861083984375, 85.73960113525390625); | 3376 path1.cubicTo(-18.0380001068115234375, 119.79299163818359375, 14.22100067138
671875, 90.60700225830078125, 26.5054988861083984375, 85.73960113525390625); |
| 3368 path1.close(); | 3377 path1.close(); |
| 3369 | 3378 |
| 3370 SkPath path2; | 3379 SkPath path2; |
| 3371 path2.moveTo(-25.077999114990234375, 124.9120025634765625); | 3380 path2.moveTo(-25.077999114990234375, 124.9120025634765625); |
| 3372 path2.cubicTo(-25.077999114990234375, 124.9120025634765625, -25.950998306274
4140625, 125.95400238037109375, -24.368999481201171875, 125.7480010986328125); | 3381 path2.cubicTo(-25.077999114990234375, 124.9120025634765625, -25.950998306274
4140625, 125.95400238037109375, -24.368999481201171875, 125.7480010986328125); |
| 3373 path2.cubicTo(-16.06999969482421875, 124.66899871826171875, 1.26800000667572
02148437500, 91.23999786376953125, 37.264003753662109375, 95.35400390625); | 3382 path2.cubicTo(-16.06999969482421875, 124.66899871826171875, 1.26800000667572
02148437500, 91.23999786376953125, 37.264003753662109375, 95.35400390625); |
| 3374 path2.cubicTo(37.264003753662109375, 95.35400390625, 11.3710002899169921875,
83.7339935302734375, -25.077999114990234375, 124.9120025634765625); | 3383 path2.cubicTo(37.264003753662109375, 95.35400390625, 11.3710002899169921875,
83.7339935302734375, -25.077999114990234375, 124.9120025634765625); |
| 3375 path2.close(); | 3384 path2.close(); |
| 3376 testPathOp(reporter, path1, path2, kUnion_PathOp, filename); | 3385 testPathOp(reporter, path1, path2, kUnion_PathOp, filename); |
| 3377 } | 3386 } |
| 3378 #endif | |
| 3379 | 3387 |
| 3380 static void rects1(skiatest::Reporter* reporter, const char* filename) { | 3388 static void rects1(skiatest::Reporter* reporter, const char* filename) { |
| 3381 SkPath path, pathB; | 3389 SkPath path, pathB; |
| 3382 path.setFillType(SkPath::kEvenOdd_FillType); | 3390 path.setFillType(SkPath::kEvenOdd_FillType); |
| 3383 path.moveTo(0, 0); | 3391 path.moveTo(0, 0); |
| 3384 path.lineTo(1, 0); | 3392 path.lineTo(1, 0); |
| 3385 path.lineTo(1, 1); | 3393 path.lineTo(1, 1); |
| 3386 path.lineTo(0, 1); | 3394 path.lineTo(0, 1); |
| 3387 path.close(); | 3395 path.close(); |
| 3388 path.moveTo(0, 0); | 3396 path.moveTo(0, 0); |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3450 pathB.setFillType(SkPath::kWinding_FillType); | 3458 pathB.setFillType(SkPath::kWinding_FillType); |
| 3451 pathB.addRect(0, 0, 2, 2, SkPath::kCW_Direction); | 3459 pathB.addRect(0, 0, 2, 2, SkPath::kCW_Direction); |
| 3452 pathB.addRect(0, 0, 3, 3, SkPath::kCW_Direction); | 3460 pathB.addRect(0, 0, 3, 3, SkPath::kCW_Direction); |
| 3453 testPathOp(reporter, path, pathB, kDifference_PathOp, filename); | 3461 testPathOp(reporter, path, pathB, kDifference_PathOp, filename); |
| 3454 } | 3462 } |
| 3455 | 3463 |
| 3456 static void (*firstTest)(skiatest::Reporter* , const char* filename) = 0; | 3464 static void (*firstTest)(skiatest::Reporter* , const char* filename) = 0; |
| 3457 static void (*stopTest)(skiatest::Reporter* , const char* filename) = 0; | 3465 static void (*stopTest)(skiatest::Reporter* , const char* filename) = 0; |
| 3458 | 3466 |
| 3459 static struct TestDesc tests[] = { | 3467 static struct TestDesc tests[] = { |
| 3468 #if CUBIC_OP_114 // FIXME: curve with inflection is ordered the wrong way |
| 3469 TEST(cubicOp114), |
| 3470 #endif |
| 3471 TEST(cubicOp114asQuad), |
| 3460 TEST(rects4), | 3472 TEST(rects4), |
| 3461 TEST(rects3), | 3473 TEST(rects3), |
| 3462 TEST(rects2), | 3474 TEST(rects2), |
| 3463 TEST(rects1), | 3475 TEST(rects1), |
| 3464 #if TEST_2540 // FIXME: extends cubic arm for sorting, marks extension with wro
ng winding? | |
| 3465 TEST(issue2540), | 3476 TEST(issue2540), |
| 3466 #endif | |
| 3467 TEST(issue2504), | 3477 TEST(issue2504), |
| 3468 TEST(kari1), | 3478 TEST(kari1), |
| 3469 TEST(quadOp10i), | 3479 TEST(quadOp10i), |
| 3470 #if 0 // FIXME: serpentine curve is ordered the wrong way | |
| 3471 TEST(cubicOp114), | |
| 3472 #endif | |
| 3473 #if 0 // FIXME: currently failing | |
| 3474 TEST(cubicOp113), | 3480 TEST(cubicOp113), |
| 3475 #endif | 3481 #if QUAD_CUBIC_FAILS_TO_FIND_INTERSECTION |
| 3476 #if SKPS_WORKING | |
| 3477 // fails because a cubic/quadratic intersection is missed | 3482 // fails because a cubic/quadratic intersection is missed |
| 3478 // the internal quad/quad is far enough away from the real cubic/quad that i
t is rejected | 3483 // the internal quad/quad is far enough away from the real cubic/quad that i
t is rejected |
| 3479 TEST(skpcarrot_is24), | 3484 TEST(skpcarrot_is24), |
| 3480 #endif | 3485 #endif |
| 3481 #if ISSUE_1417_WORKING_ON_LINUX_32 | |
| 3482 TEST(issue1417), | 3486 TEST(issue1417), |
| 3483 #endif | |
| 3484 TEST(cubicOp112), | 3487 TEST(cubicOp112), |
| 3485 TEST(skpadspert_net23), | 3488 TEST(skpadspert_net23), |
| 3486 TEST(skpadspert_de11), | 3489 TEST(skpadspert_de11), |
| 3487 TEST(findFirst1), | 3490 TEST(findFirst1), |
| 3488 TEST(xOp2i), | 3491 TEST(xOp2i), |
| 3489 TEST(xOp3i), | 3492 TEST(xOp3i), |
| 3490 TEST(xOp1u), | 3493 TEST(xOp1u), |
| 3491 TEST(xOp1i), | 3494 TEST(xOp1i), |
| 3492 TEST(cubicOp111), | 3495 TEST(cubicOp111), |
| 3493 TEST(cubicOp110), | 3496 TEST(cubicOp110), |
| 3494 TEST(cubicOp109), | 3497 TEST(cubicOp109), |
| 3495 TEST(cubicOp108), | 3498 TEST(cubicOp108), |
| 3496 TEST(cubicOp107), | 3499 TEST(cubicOp107), |
| 3497 TEST(cubicOp106), | 3500 TEST(cubicOp106), |
| 3498 TEST(cubicOp105), | 3501 TEST(cubicOp105), |
| 3499 TEST(cubicOp104), | 3502 TEST(cubicOp104), |
| 3500 TEST(cubicOp103), | 3503 TEST(cubicOp103), |
| 3501 TEST(cubicOp102), | 3504 TEST(cubicOp102), |
| 3502 TEST(cubicOp101), | 3505 TEST(cubicOp101), |
| 3503 TEST(cubicOp100), | 3506 TEST(cubicOp100), |
| 3504 TEST(cubicOp99), | 3507 TEST(cubicOp99), |
| 3505 #if ISSUE_1435_FIXED | |
| 3506 TEST(issue1435), | 3508 TEST(issue1435), |
| 3507 #endif | |
| 3508 TEST(cubicOp98x), | 3509 TEST(cubicOp98x), |
| 3509 TEST(cubicOp97x), | 3510 TEST(cubicOp97x), |
| 3510 TEST(skpcarpetplanet_ru22), // cubic/cubic intersect detects unwanted coinc
idence | 3511 TEST(skpcarpetplanet_ru22), // cubic/cubic intersect detects unwanted coinc
idence |
| 3511 TEST(cubicOp96d), | 3512 TEST(cubicOp96d), |
| 3512 TEST(cubicOp95u), | 3513 TEST(cubicOp95u), |
| 3513 TEST(skpadbox_lt15), | 3514 TEST(skpadbox_lt15), |
| 3514 TEST(skpagentxsites_com55), | 3515 TEST(skpagentxsites_com55), |
| 3515 TEST(skpadventistmission_org572), | 3516 TEST(skpadventistmission_org572), |
| 3516 TEST(skpadoption_org196), | 3517 TEST(skpadoption_org196), |
| 3517 TEST(skpbambootheme_com12), | 3518 TEST(skpbambootheme_com12), |
| (...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3675 TEST(cubicOp6d), | 3676 TEST(cubicOp6d), |
| 3676 TEST(cubicOp5d), | 3677 TEST(cubicOp5d), |
| 3677 TEST(cubicOp3d), | 3678 TEST(cubicOp3d), |
| 3678 TEST(cubicOp2d), | 3679 TEST(cubicOp2d), |
| 3679 TEST(cubicOp1d), | 3680 TEST(cubicOp1d), |
| 3680 }; | 3681 }; |
| 3681 | 3682 |
| 3682 static const size_t testCount = SK_ARRAY_COUNT(tests); | 3683 static const size_t testCount = SK_ARRAY_COUNT(tests); |
| 3683 | 3684 |
| 3684 static struct TestDesc subTests[] = { | 3685 static struct TestDesc subTests[] = { |
| 3685 TEST(cubicOp114), | |
| 3686 TEST(cubicOp58d), | 3686 TEST(cubicOp58d), |
| 3687 TEST(cubicOp53d), | 3687 TEST(cubicOp53d), |
| 3688 }; | 3688 }; |
| 3689 | 3689 |
| 3690 static const size_t subTestCount = SK_ARRAY_COUNT(subTests); | 3690 static const size_t subTestCount = SK_ARRAY_COUNT(subTests); |
| 3691 | 3691 |
| 3692 static void (*firstSubTest)(skiatest::Reporter* , const char* filename) = 0; | 3692 static void (*firstSubTest)(skiatest::Reporter* , const char* filename) = 0; |
| 3693 | 3693 |
| 3694 static bool runSubTests = false; | 3694 static bool runSubTests = false; |
| 3695 static bool runSubTestsFirst = false; | 3695 static bool runSubTestsFirst = false; |
| (...skipping 25 matching lines...) Expand all Loading... |
| 3721 }; | 3721 }; |
| 3722 | 3722 |
| 3723 static const size_t failTestCount = SK_ARRAY_COUNT(failTests); | 3723 static const size_t failTestCount = SK_ARRAY_COUNT(failTests); |
| 3724 | 3724 |
| 3725 DEF_TEST(PathOpsFailOp, reporter) { | 3725 DEF_TEST(PathOpsFailOp, reporter) { |
| 3726 #if DEBUG_SHOW_TEST_NAME | 3726 #if DEBUG_SHOW_TEST_NAME |
| 3727 strncpy(DEBUG_FILENAME_STRING, "", DEBUG_FILENAME_STRING_LENGTH); | 3727 strncpy(DEBUG_FILENAME_STRING, "", DEBUG_FILENAME_STRING_LENGTH); |
| 3728 #endif | 3728 #endif |
| 3729 RunTestSet(reporter, failTests, failTestCount, 0, 0, false); | 3729 RunTestSet(reporter, failTests, failTestCount, 0, 0, false); |
| 3730 } | 3730 } |
| OLD | NEW |