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 3754 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3765 path.quadTo(0, 1, 1, 1); | 3765 path.quadTo(0, 1, 1, 1); |
3766 path.lineTo(1, 3); | 3766 path.lineTo(1, 3); |
3767 path.close(); | 3767 path.close(); |
3768 path.moveTo(1, 0); | 3768 path.moveTo(1, 0); |
3769 path.lineTo(3, 0); | 3769 path.lineTo(3, 0); |
3770 path.quadTo(0, 1, 1, 2); | 3770 path.quadTo(0, 1, 1, 2); |
3771 path.close(); | 3771 path.close(); |
3772 testSimplify(reporter, path); | 3772 testSimplify(reporter, path); |
3773 } | 3773 } |
3774 | 3774 |
3775 static void (*firstTest)(skiatest::Reporter* ) = testQuadratic85; | 3775 static void testQuadLineIntersect1(skiatest::Reporter* reporter) { |
| 3776 SkPath path; |
| 3777 path.moveTo(0, 0); |
| 3778 path.quadTo(3, 1, 0, 3); |
| 3779 path.lineTo(2, 3); |
| 3780 path.close(); |
| 3781 path.moveTo(2, 0); |
| 3782 path.lineTo(0, 1); |
| 3783 path.quadTo(3, 1, 0, 2); |
| 3784 path.close(); |
| 3785 testSimplify(reporter, path); |
| 3786 } |
| 3787 |
| 3788 static void testQuadLineIntersect2(skiatest::Reporter* reporter) { |
| 3789 SkPath path; |
| 3790 path.moveTo(0, 0); |
| 3791 path.quadTo(3, 1, 0, 3); |
| 3792 path.lineTo(0, 3); |
| 3793 path.close(); |
| 3794 path.moveTo(2, 0); |
| 3795 path.lineTo(0, 1); |
| 3796 path.quadTo(3, 1, 0, 2); |
| 3797 path.close(); |
| 3798 testSimplify(reporter, path); |
| 3799 } |
| 3800 |
| 3801 static void testQuadLineIntersect3(skiatest::Reporter* reporter) { |
| 3802 SkPath path; |
| 3803 path.moveTo(0, 0); |
| 3804 path.quadTo(3, 1, 0, 3); |
| 3805 path.lineTo(1, 3); |
| 3806 path.close(); |
| 3807 path.moveTo(2, 0); |
| 3808 path.lineTo(0, 1); |
| 3809 path.quadTo(3, 1, 0, 2); |
| 3810 path.close(); |
| 3811 testSimplify(reporter, path); |
| 3812 } |
| 3813 |
| 3814 static void (*firstTest)(skiatest::Reporter* ) = 0; |
3776 | 3815 |
3777 static TestDesc tests[] = { | 3816 static TestDesc tests[] = { |
| 3817 TEST(testQuadLineIntersect1), |
| 3818 TEST(testQuadLineIntersect2), |
| 3819 TEST(testQuadLineIntersect3), |
3778 TEST(testQuad7), | 3820 TEST(testQuad7), |
3779 TEST(testQuad6), | 3821 TEST(testQuad6), |
3780 TEST(testQuad5), | 3822 TEST(testQuad5), |
3781 TEST(testQuad4), | 3823 TEST(testQuad4), |
3782 TEST(testQuad3), | 3824 TEST(testQuad3), |
3783 TEST(testQuad2), | 3825 TEST(testQuad2), |
3784 TEST(testAddTCoincident2), | 3826 TEST(testAddTCoincident2), |
3785 TEST(testAddTCoincident1), | 3827 TEST(testAddTCoincident1), |
3786 TEST(testTriangles2), | 3828 TEST(testTriangles2), |
3787 TEST(testTriangles1), | 3829 TEST(testTriangles1), |
(...skipping 362 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4150 RunTestSet(reporter, subTests, subTestCount, firstSubTest, stopTest, run
Reverse); | 4192 RunTestSet(reporter, subTests, subTestCount, firstSubTest, stopTest, run
Reverse); |
4151 } | 4193 } |
4152 #ifdef SK_DEBUG | 4194 #ifdef SK_DEBUG |
4153 gDebugMaxWindSum = SK_MaxS32; | 4195 gDebugMaxWindSum = SK_MaxS32; |
4154 gDebugMaxWindValue = SK_MaxS32; | 4196 gDebugMaxWindValue = SK_MaxS32; |
4155 #endif | 4197 #endif |
4156 } | 4198 } |
4157 | 4199 |
4158 #include "TestClassDef.h" | 4200 #include "TestClassDef.h" |
4159 DEFINE_TESTCLASS_SHORT(PathOpsSimplifyTest) | 4201 DEFINE_TESTCLASS_SHORT(PathOpsSimplifyTest) |
OLD | NEW |