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 | 8 |
9 #define TEST(name) { name, #name } | 9 #define TEST(name) { name, #name } |
10 | 10 |
(...skipping 4659 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4670 static void testRect3(skiatest::Reporter* reporter, const char* filename) { | 4670 static void testRect3(skiatest::Reporter* reporter, const char* filename) { |
4671 SkPath path; | 4671 SkPath path; |
4672 path.setFillType(SkPath::kEvenOdd_FillType); | 4672 path.setFillType(SkPath::kEvenOdd_FillType); |
4673 path.addRect(0, 0, 60, 60, SkPath::kCCW_Direction); | 4673 path.addRect(0, 0, 60, 60, SkPath::kCCW_Direction); |
4674 path.addRect(10, 30, 40, 30, SkPath::kCCW_Direction); | 4674 path.addRect(10, 30, 40, 30, SkPath::kCCW_Direction); |
4675 path.addRect(24, 6, 36, 36, SkPath::kCCW_Direction); | 4675 path.addRect(24, 6, 36, 36, SkPath::kCCW_Direction); |
4676 path.addRect(32, 6, 36, 41, SkPath::kCCW_Direction); | 4676 path.addRect(32, 6, 36, 41, SkPath::kCCW_Direction); |
4677 testSimplify(reporter, path, filename); | 4677 testSimplify(reporter, path, filename); |
4678 } | 4678 } |
4679 | 4679 |
| 4680 static void testRect4(skiatest::Reporter* reporter, const char* filename) { |
| 4681 SkPath path; |
| 4682 path.setFillType(SkPath::kEvenOdd_FillType); |
| 4683 path.addRect(0, 0, 30, 60, SkPath::kCCW_Direction); |
| 4684 path.addRect(10, 0, 40, 30, SkPath::kCCW_Direction); |
| 4685 path.addRect(20, 0, 30, 40, SkPath::kCCW_Direction); |
| 4686 path.addRect(32, 0, 36, 41, SkPath::kCCW_Direction); |
| 4687 testSimplify(reporter, path, filename); |
| 4688 } |
| 4689 |
| 4690 static void testQuads62(skiatest::Reporter* reporter, const char* filename) { |
| 4691 SkPath path; |
| 4692 path.moveTo(3, 2); |
| 4693 path.quadTo(1, 3, 3, 3); |
| 4694 path.lineTo(3, 3); |
| 4695 path.close(); |
| 4696 path.moveTo(0, 0); |
| 4697 path.lineTo(2, 0); |
| 4698 path.quadTo(1, 3, 3, 3); |
| 4699 path.close(); |
| 4700 testSimplify(reporter, path, filename); |
| 4701 } |
| 4702 |
| 4703 static void testQuads63(skiatest::Reporter* reporter,const char* filename) { |
| 4704 SkPath path; |
| 4705 path.moveTo(3, 0); |
| 4706 path.quadTo(0, 1, 1, 2); |
| 4707 path.lineTo(3, 3); |
| 4708 path.close(); |
| 4709 path.moveTo(0, 0); |
| 4710 path.lineTo(1, 1); |
| 4711 path.quadTo(0, 2, 3, 3); |
| 4712 path.close(); |
| 4713 testSimplify(reporter, path, filename); |
| 4714 } |
| 4715 |
| 4716 static void testQuads64(skiatest::Reporter* reporter,const char* filename) { |
| 4717 SkPath path; |
| 4718 path.moveTo(3, 0); |
| 4719 path.quadTo(0, 1, 1, 2); |
| 4720 path.lineTo(2, 2); |
| 4721 path.close(); |
| 4722 path.moveTo(1, 0); |
| 4723 path.lineTo(1, 1); |
| 4724 path.quadTo(0, 2, 3, 3); |
| 4725 path.close(); |
| 4726 testSimplify(reporter, path, filename); |
| 4727 } |
| 4728 |
4680 static void (*skipTest)(skiatest::Reporter* , const char* filename) = 0; | 4729 static void (*skipTest)(skiatest::Reporter* , const char* filename) = 0; |
4681 static void (*firstTest)(skiatest::Reporter* , const char* filename) = testCubic
2; | 4730 static void (*firstTest)(skiatest::Reporter* , const char* filename) = 0; |
4682 static void (*stopTest)(skiatest::Reporter* , const char* filename) = 0; | 4731 static void (*stopTest)(skiatest::Reporter* , const char* filename) = 0; |
4683 | 4732 |
4684 static TestDesc tests[] = { | 4733 static TestDesc tests[] = { |
| 4734 TEST(testQuads64), |
| 4735 TEST(testQuads63), |
| 4736 TEST(testQuads62), |
| 4737 TEST(testRect4), |
4685 TEST(testRect3), | 4738 TEST(testRect3), |
4686 TEST(testQuadralateral10), | 4739 TEST(testQuadralateral10), |
4687 TEST(testQuads61), | 4740 TEST(testQuads61), |
4688 TEST(testQuads60), | 4741 TEST(testQuads60), |
4689 TEST(testQuads59), | 4742 TEST(testQuads59), |
4690 TEST(testQuads58), | 4743 TEST(testQuads58), |
4691 TEST(testQuads57), | 4744 TEST(testQuads57), |
4692 TEST(testQuads56), | 4745 TEST(testQuads56), |
4693 TEST(testQuads54), | 4746 TEST(testQuads54), |
4694 TEST(testQuads53), | 4747 TEST(testQuads53), |
(...skipping 419 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5114 | 5167 |
5115 DEF_TEST(PathOpsSimplify, reporter) { | 5168 DEF_TEST(PathOpsSimplify, reporter) { |
5116 if (runSubTests && runSubTestsFirst) { | 5169 if (runSubTests && runSubTestsFirst) { |
5117 RunTestSet(reporter, subTests, subTestCount, firstSubTest, NULL, stopTes
t, runReverse); | 5170 RunTestSet(reporter, subTests, subTestCount, firstSubTest, NULL, stopTes
t, runReverse); |
5118 } | 5171 } |
5119 RunTestSet(reporter, tests, testCount, firstTest, skipTest, stopTest, runRev
erse); | 5172 RunTestSet(reporter, tests, testCount, firstTest, skipTest, stopTest, runRev
erse); |
5120 if (runSubTests && !runSubTestsFirst) { | 5173 if (runSubTests && !runSubTestsFirst) { |
5121 RunTestSet(reporter, subTests, subTestCount, firstSubTest, NULL, stopTes
t, runReverse); | 5174 RunTestSet(reporter, subTests, subTestCount, firstSubTest, NULL, stopTes
t, runReverse); |
5122 } | 5175 } |
5123 } | 5176 } |
OLD | NEW |