| 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 class PathTest_Private { | 10 class PathTest_Private { |
| (...skipping 5357 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5368 path.moveTo(0,1); | 5368 path.moveTo(0,1); |
| 5369 path.cubicTo(2,4, 2,0, 2,0); | 5369 path.cubicTo(2,4, 2,0, 2,0); |
| 5370 path.close(); | 5370 path.close(); |
| 5371 pathB.setFillType(SkPath::kWinding_FillType); | 5371 pathB.setFillType(SkPath::kWinding_FillType); |
| 5372 pathB.moveTo(0,2); | 5372 pathB.moveTo(0,2); |
| 5373 pathB.cubicTo(0,2, 1,0, 4,2); | 5373 pathB.cubicTo(0,2, 1,0, 4,2); |
| 5374 pathB.close(); | 5374 pathB.close(); |
| 5375 testPathOp(reporter, path, pathB, kDifference_SkPathOp, filename); | 5375 testPathOp(reporter, path, pathB, kDifference_SkPathOp, filename); |
| 5376 } | 5376 } |
| 5377 | 5377 |
| 5378 static void loop17(skiatest::Reporter* reporter, const char* filename) { |
| 5379 SkPath path, pathB; |
| 5380 path.moveTo(1, 2); |
| 5381 path.cubicTo(0, 3, -0.333333343f, 3.33333325f, 0.833333373f, 3.5f); |
| 5382 path.close(); |
| 5383 pathB.moveTo(0, 3); |
| 5384 pathB.cubicTo(-0.333333343f, 3.33333325f, 0.833333373f, 3.5f, 1, 2); |
| 5385 pathB.close(); |
| 5386 testPathOp(reporter, path, pathB, kIntersect_SkPathOp, filename); |
| 5387 } |
| 5388 |
| 5389 static void circlesOp4(skiatest::Reporter* reporter, const char* filename) { |
| 5390 SkPath path, pathB; |
| 5391 path.setFillType(SkPath::kWinding_FillType); |
| 5392 path.addCircle(0, 1, 5, SkPath::kCW_Direction); |
| 5393 pathB.setFillType(SkPath::kWinding_FillType); |
| 5394 pathB.addCircle(0, 1, 0, SkPath::kCW_Direction); |
| 5395 testPathOp(reporter, path, pathB, kDifference_SkPathOp, filename); |
| 5396 } |
| 5397 |
| 5378 static void (*skipTest)(skiatest::Reporter* , const char* filename) = 0; | 5398 static void (*skipTest)(skiatest::Reporter* , const char* filename) = 0; |
| 5379 static void (*firstTest)(skiatest::Reporter* , const char* filename) = 0; | 5399 static void (*firstTest)(skiatest::Reporter* , const char* filename) = 0; |
| 5380 static void (*stopTest)(skiatest::Reporter* , const char* filename) = 0; | 5400 static void (*stopTest)(skiatest::Reporter* , const char* filename) = 0; |
| 5381 | 5401 |
| 5382 #define TEST(name) { name, #name } | 5402 #define TEST(name) { name, #name } |
| 5383 | 5403 |
| 5384 static struct TestDesc tests[] = { | 5404 static struct TestDesc tests[] = { |
| 5405 TEST(circlesOp4), |
| 5406 TEST(loop17), |
| 5385 TEST(cubicOp158), | 5407 TEST(cubicOp158), |
| 5386 TEST(loops_i1), | 5408 TEST(loops_i1), |
| 5387 TEST(loops_i2), | 5409 TEST(loops_i2), |
| 5388 TEST(loops_i3), | 5410 TEST(loops_i3), |
| 5389 TEST(loops_i4), | 5411 TEST(loops_i4), |
| 5390 TEST(loops_i5), | 5412 TEST(loops_i5), |
| 5391 TEST(loops_i6), | 5413 TEST(loops_i6), |
| 5392 TEST(cubics_d3), | 5414 TEST(cubics_d3), |
| 5393 TEST(cubics_o), | 5415 TEST(cubics_o), |
| 5394 TEST(cubics_d2), | 5416 TEST(cubics_d2), |
| (...skipping 2506 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7901 static struct TestDesc repTests[] = { | 7923 static struct TestDesc repTests[] = { |
| 7902 TEST(loops44i), | 7924 TEST(loops44i), |
| 7903 TEST(loops45i), | 7925 TEST(loops45i), |
| 7904 TEST(loops46i), | 7926 TEST(loops46i), |
| 7905 }; | 7927 }; |
| 7906 | 7928 |
| 7907 DEF_TEST(PathOpsRepOp, reporter) { | 7929 DEF_TEST(PathOpsRepOp, reporter) { |
| 7908 for (int index = 0; index < 2; ++index) | 7930 for (int index = 0; index < 2; ++index) |
| 7909 RunTestSet(reporter, repTests, SK_ARRAY_COUNT(repTests), nullptr, nullptr, n
ullptr, false); | 7931 RunTestSet(reporter, repTests, SK_ARRAY_COUNT(repTests), nullptr, nullptr, n
ullptr, false); |
| 7910 } | 7932 } |
| OLD | NEW |