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 3018 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3029 path.moveTo(0, 3); | 3029 path.moveTo(0, 3); |
3030 path.cubicTo(3, 6, 4, 1, 6, 3); | 3030 path.cubicTo(3, 6, 4, 1, 6, 3); |
3031 path.close(); | 3031 path.close(); |
3032 pathB.setFillType(SkPath::kEvenOdd_FillType); | 3032 pathB.setFillType(SkPath::kEvenOdd_FillType); |
3033 pathB.moveTo(1, 4); | 3033 pathB.moveTo(1, 4); |
3034 pathB.cubicTo(3, 6, 3, 0, 6, 3); | 3034 pathB.cubicTo(3, 6, 3, 0, 6, 3); |
3035 pathB.close(); | 3035 pathB.close(); |
3036 testPathOp(reporter, path, pathB, kXOR_PathOp); | 3036 testPathOp(reporter, path, pathB, kXOR_PathOp); |
3037 } | 3037 } |
3038 | 3038 |
3039 static void (*firstTest)(skiatest::Reporter* ) = bufferOverflow; | 3039 static void cubicOp99(skiatest::Reporter* reporter) { |
| 3040 SkPath path, pathB; |
| 3041 path.setFillType(SkPath::kWinding_FillType); |
| 3042 path.moveTo(3,6); |
| 3043 path.cubicTo(0,3, 6,5, 5,4); |
| 3044 path.close(); |
| 3045 pathB.setFillType(SkPath::kWinding_FillType); |
| 3046 pathB.moveTo(5,6); |
| 3047 pathB.cubicTo(4,5, 6,3, 3,0); |
| 3048 pathB.close(); |
| 3049 testPathOp(reporter, path, pathB, kIntersect_PathOp); |
| 3050 } |
| 3051 |
| 3052 static void cubicOp100(skiatest::Reporter* reporter) { |
| 3053 SkPath path, pathB; |
| 3054 path.setFillType(SkPath::kWinding_FillType); |
| 3055 path.moveTo(0,1); |
| 3056 path.cubicTo(0,2, 2,1, 4,2); |
| 3057 path.close(); |
| 3058 pathB.setFillType(SkPath::kWinding_FillType); |
| 3059 pathB.moveTo(1,2); |
| 3060 pathB.cubicTo(2,4, 1,0, 2,0); |
| 3061 pathB.close(); |
| 3062 testPathOp(reporter, path, pathB, kDifference_PathOp); |
| 3063 } |
| 3064 |
| 3065 static void cubicOp101(skiatest::Reporter* reporter) { |
| 3066 SkPath path, pathB; |
| 3067 path.setFillType(SkPath::kWinding_FillType); |
| 3068 path.moveTo(0, 1); |
| 3069 path.cubicTo(2, 3, 2, 1, 5, 3); |
| 3070 path.close(); |
| 3071 pathB.setFillType(SkPath::kWinding_FillType); |
| 3072 pathB.moveTo(1, 2); |
| 3073 pathB.cubicTo(3, 5, 1, 0, 3, 2); |
| 3074 pathB.close(); |
| 3075 testPathOp(reporter, path, pathB, kIntersect_PathOp); |
| 3076 } |
| 3077 |
| 3078 static void (*firstTest)(skiatest::Reporter* ) = 0; |
3040 | 3079 |
3041 static struct TestDesc tests[] = { | 3080 static struct TestDesc tests[] = { |
| 3081 TEST(cubicOp101), |
| 3082 TEST(cubicOp100), |
| 3083 TEST(cubicOp99), |
3042 #if ISSUE_1435_WORKING | 3084 #if ISSUE_1435_WORKING |
3043 TEST(issue1435), | 3085 TEST(issue1435), |
3044 #endif | 3086 #endif |
3045 #if SKPS_WORKING | 3087 #if SKPS_WORKING |
3046 TEST(skpcarrot_is24), | 3088 TEST(skpcarrot_is24), |
3047 #endif | 3089 #endif |
3048 #if ISSUE_1417_WORKING_ON_LINUX_32 | 3090 #if ISSUE_1417_WORKING_ON_LINUX_32 |
3049 TEST(issue1417), | 3091 TEST(issue1417), |
3050 #endif | 3092 #endif |
3051 TEST(cubicOp98x), | 3093 TEST(cubicOp98x), |
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3259 RunTestSet(reporter, subTests, subTestCount, firstSubTest, stopTest, run
Reverse); | 3301 RunTestSet(reporter, subTests, subTestCount, firstSubTest, stopTest, run
Reverse); |
3260 } | 3302 } |
3261 #ifdef SK_DEBUG | 3303 #ifdef SK_DEBUG |
3262 SkPathOpsDebug::gMaxWindSum = SK_MaxS32; | 3304 SkPathOpsDebug::gMaxWindSum = SK_MaxS32; |
3263 SkPathOpsDebug::gMaxWindValue = SK_MaxS32; | 3305 SkPathOpsDebug::gMaxWindValue = SK_MaxS32; |
3264 #endif | 3306 #endif |
3265 } | 3307 } |
3266 | 3308 |
3267 #include "TestClassDef.h" | 3309 #include "TestClassDef.h" |
3268 DEFINE_TESTCLASS_SHORT(PathOpsOpTest) | 3310 DEFINE_TESTCLASS_SHORT(PathOpsOpTest) |
OLD | NEW |