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 2700 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2711 SkPath pathB; | 2711 SkPath pathB; |
2712 pathB.setFillType(SkPath::kWinding_FillType); | 2712 pathB.setFillType(SkPath::kWinding_FillType); |
2713 pathB.moveTo(575, 925); | 2713 pathB.moveTo(575, 925); |
2714 pathB.lineTo(693, 925); | 2714 pathB.lineTo(693, 925); |
2715 pathB.lineTo(693, 926); | 2715 pathB.lineTo(693, 926); |
2716 pathB.lineTo(575, 926); | 2716 pathB.lineTo(575, 926); |
2717 pathB.close(); | 2717 pathB.close(); |
2718 testPathOp(reporter, path, pathB, kIntersect_PathOp); | 2718 testPathOp(reporter, path, pathB, kIntersect_PathOp); |
2719 } | 2719 } |
2720 | 2720 |
2721 #define SKPS_WORKING 0 | |
2722 #if SKPS_WORKING | |
2723 static void skpcarpetplanet_ru22(skiatest::Reporter* reporter) { | 2721 static void skpcarpetplanet_ru22(skiatest::Reporter* reporter) { |
2724 SkPath path; | 2722 SkPath path; |
2725 path.setFillType(SkPath::kEvenOdd_FillType); | 2723 path.setFillType(SkPath::kEvenOdd_FillType); |
2726 path.moveTo(195, 785); | 2724 path.moveTo(195, 785); |
2727 path.cubicTo(124.307556f, 785, 67, 841.859863f, 67, 912); | 2725 path.cubicTo(124.307556f, 785, 67, 841.859863f, 67, 912); |
2728 path.lineTo(67, 913); | 2726 path.lineTo(67, 913); |
2729 path.cubicTo(67, 917.388916f, 67.2243805f, 921.725769f, 67.662384f, 926); | 2727 path.cubicTo(67, 917.388916f, 67.2243805f, 921.725769f, 67.662384f, 926); |
2730 path.lineTo(322, 926); | 2728 path.lineTo(322, 926); |
2731 path.lineTo(322, 896.048035f); | 2729 path.lineTo(322, 896.048035f); |
2732 path.cubicTo(314.09201f, 833.437622f, 260.247131f, 785, 195, 785); | 2730 path.cubicTo(314.09201f, 833.437622f, 260.247131f, 785, 195, 785); |
2733 path.close(); | 2731 path.close(); |
2734 SkPath pathB; | 2732 SkPath pathB; |
2735 pathB.setFillType(SkPath::kWinding_FillType); | 2733 pathB.setFillType(SkPath::kWinding_FillType); |
2736 pathB.moveTo(195, 785); | 2734 pathB.moveTo(195, 785); |
2737 pathB.cubicTo(265.140167f, 785, 322, 842.307556f, 322, 913); | 2735 pathB.cubicTo(265.140167f, 785, 322, 842.307556f, 322, 913); |
2738 pathB.cubicTo(322, 983.692444f, 265.140167f, 1041, 195, 1041); | 2736 pathB.cubicTo(322, 983.692444f, 265.140167f, 1041, 195, 1041); |
2739 pathB.lineTo(194, 1041); | 2737 pathB.lineTo(194, 1041); |
2740 pathB.cubicTo(123.85984f, 1041, 67, 983.692444f, 67, 913); | 2738 pathB.cubicTo(123.85984f, 1041, 67, 983.692444f, 67, 913); |
2741 pathB.cubicTo(67, 842.307556f, 123.85984f, 785, 194, 785); | 2739 pathB.cubicTo(67, 842.307556f, 123.85984f, 785, 194, 785); |
2742 pathB.lineTo(195, 785); | 2740 pathB.lineTo(195, 785); |
2743 pathB.close(); | 2741 pathB.close(); |
2744 testPathOp(reporter, path, pathB, kIntersect_PathOp); | 2742 testPathOp(reporter, path, pathB, kIntersect_PathOp); |
2745 } | 2743 } |
2746 | 2744 |
| 2745 #define SKPS_WORKING 0 |
| 2746 #if SKPS_WORKING |
2747 static void skpcarrot_is24(skiatest::Reporter* reporter) { | 2747 static void skpcarrot_is24(skiatest::Reporter* reporter) { |
2748 SkPath path; | 2748 SkPath path; |
2749 path.setFillType(SkPath::kEvenOdd_FillType); | 2749 path.setFillType(SkPath::kEvenOdd_FillType); |
2750 path.moveTo(945, 597); | 2750 path.moveTo(945, 597); |
2751 path.quadTo(913.93396f, 597, 891.96698f, 618.96698f); | 2751 path.quadTo(913.93396f, 597, 891.96698f, 618.96698f); |
2752 path.quadTo(870, 640.93396f, 870, 672); | 2752 path.quadTo(870, 640.93396f, 870, 672); |
2753 path.quadTo(870, 703.06604f, 891.96698f, 725.03302f); | 2753 path.quadTo(870, 703.06604f, 891.96698f, 725.03302f); |
2754 path.quadTo(913.93396f, 747, 945, 747); | 2754 path.quadTo(913.93396f, 747, 945, 747); |
2755 path.quadTo(976.06604f, 747, 998.03302f, 725.03302f); | 2755 path.quadTo(976.06604f, 747, 998.03302f, 725.03302f); |
2756 path.quadTo(1020, 703.06604f, 1020, 672); | 2756 path.quadTo(1020, 703.06604f, 1020, 672); |
(...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3003 path.moveTo(1, 6); | 3003 path.moveTo(1, 6); |
3004 path.cubicTo(0, 3, 6, 3, 5, 0); | 3004 path.cubicTo(0, 3, 6, 3, 5, 0); |
3005 path.close(); | 3005 path.close(); |
3006 pathB.setFillType(SkPath::kEvenOdd_FillType); | 3006 pathB.setFillType(SkPath::kEvenOdd_FillType); |
3007 pathB.moveTo(3, 6); | 3007 pathB.moveTo(3, 6); |
3008 pathB.cubicTo(0, 5, 6, 1, 3, 0); | 3008 pathB.cubicTo(0, 5, 6, 1, 3, 0); |
3009 pathB.close(); | 3009 pathB.close(); |
3010 testPathOp(reporter, path, pathB, kDifference_PathOp); | 3010 testPathOp(reporter, path, pathB, kDifference_PathOp); |
3011 } | 3011 } |
3012 | 3012 |
3013 static void (*firstTest)(skiatest::Reporter* ) = 0; | 3013 static void cubicOp97x(skiatest::Reporter* reporter) { |
| 3014 SkPath path, pathB; |
| 3015 path.setFillType(SkPath::kEvenOdd_FillType); |
| 3016 path.moveTo(0, 2); |
| 3017 path.cubicTo(0, 6, 2, 1, 2, 1); |
| 3018 path.close(); |
| 3019 pathB.setFillType(SkPath::kEvenOdd_FillType); |
| 3020 pathB.moveTo(1, 2); |
| 3021 pathB.cubicTo(1, 2, 2, 0, 6, 0); |
| 3022 pathB.close(); |
| 3023 testPathOp(reporter, path, pathB, kXOR_PathOp); |
| 3024 } |
| 3025 |
| 3026 static void cubicOp98x(skiatest::Reporter* reporter) { |
| 3027 SkPath path, pathB; |
| 3028 path.setFillType(SkPath::kEvenOdd_FillType); |
| 3029 path.moveTo(0, 3); |
| 3030 path.cubicTo(3, 6, 4, 1, 6, 3); |
| 3031 path.close(); |
| 3032 pathB.setFillType(SkPath::kEvenOdd_FillType); |
| 3033 pathB.moveTo(1, 4); |
| 3034 pathB.cubicTo(3, 6, 3, 0, 6, 3); |
| 3035 pathB.close(); |
| 3036 testPathOp(reporter, path, pathB, kXOR_PathOp); |
| 3037 } |
| 3038 |
| 3039 static void (*firstTest)(skiatest::Reporter* ) = bufferOverflow; |
3014 | 3040 |
3015 static struct TestDesc tests[] = { | 3041 static struct TestDesc tests[] = { |
3016 #if ISSUE_1435_WORKING | 3042 #if ISSUE_1435_WORKING |
3017 TEST(issue1435), | 3043 TEST(issue1435), |
3018 #endif | 3044 #endif |
3019 #if SKPS_WORKING | 3045 #if SKPS_WORKING |
3020 TEST(skpcarrot_is24), | 3046 TEST(skpcarrot_is24), |
3021 TEST(skpcarpetplanet_ru22), // cubic/cubic intersect detects unwanted coinc
idence | |
3022 #endif | 3047 #endif |
3023 #if ISSUE_1417_WORKING_ON_LINUX_32 | 3048 #if ISSUE_1417_WORKING_ON_LINUX_32 |
3024 TEST(issue1417), | 3049 TEST(issue1417), |
3025 #endif | 3050 #endif |
| 3051 TEST(cubicOp98x), |
| 3052 TEST(cubicOp97x), |
| 3053 TEST(skpcarpetplanet_ru22), // cubic/cubic intersect detects unwanted coinc
idence |
3026 TEST(cubicOp96d), | 3054 TEST(cubicOp96d), |
3027 TEST(cubicOp95u), | 3055 TEST(cubicOp95u), |
3028 TEST(skpadbox_lt15), | 3056 TEST(skpadbox_lt15), |
3029 TEST(skpagentxsites_com55), | 3057 TEST(skpagentxsites_com55), |
3030 TEST(skpadventistmission_org572), | 3058 TEST(skpadventistmission_org572), |
3031 TEST(skpadspert_net23), | 3059 TEST(skpadspert_net23), |
3032 TEST(skpadoption_org196), | 3060 TEST(skpadoption_org196), |
3033 TEST(skpbambootheme_com12), | 3061 TEST(skpbambootheme_com12), |
3034 TEST(skpbakosoft_com10), | 3062 TEST(skpbakosoft_com10), |
3035 TEST(skpakmmos_ru100), | 3063 TEST(skpakmmos_ru100), |
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3231 RunTestSet(reporter, subTests, subTestCount, firstSubTest, stopTest, run
Reverse); | 3259 RunTestSet(reporter, subTests, subTestCount, firstSubTest, stopTest, run
Reverse); |
3232 } | 3260 } |
3233 #ifdef SK_DEBUG | 3261 #ifdef SK_DEBUG |
3234 SkPathOpsDebug::gMaxWindSum = SK_MaxS32; | 3262 SkPathOpsDebug::gMaxWindSum = SK_MaxS32; |
3235 SkPathOpsDebug::gMaxWindValue = SK_MaxS32; | 3263 SkPathOpsDebug::gMaxWindValue = SK_MaxS32; |
3236 #endif | 3264 #endif |
3237 } | 3265 } |
3238 | 3266 |
3239 #include "TestClassDef.h" | 3267 #include "TestClassDef.h" |
3240 DEFINE_TESTCLASS_SHORT(PathOpsOpTest) | 3268 DEFINE_TESTCLASS_SHORT(PathOpsOpTest) |
OLD | NEW |