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 "TestClassDef.h" |
8 | 9 |
9 #define TEST(name) { name, #name } | 10 #define TEST(name) { name, #name } |
10 | 11 |
11 static void cubicOp1d(skiatest::Reporter* reporter) { | 12 static void cubicOp1d(skiatest::Reporter* reporter) { |
12 SkPath path, pathB; | 13 SkPath path, pathB; |
13 path.setFillType(SkPath::kWinding_FillType); | 14 path.setFillType(SkPath::kWinding_FillType); |
14 path.moveTo(0,1); | 15 path.moveTo(0,1); |
15 path.cubicTo(0,2, 1,0, 1,0); | 16 path.cubicTo(0,2, 1,0, 1,0); |
16 path.close(); | 17 path.close(); |
17 pathB.setFillType(SkPath::kWinding_FillType); | 18 pathB.setFillType(SkPath::kWinding_FillType); |
(...skipping 3260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3278 }; | 3279 }; |
3279 | 3280 |
3280 static const size_t subTestCount = SK_ARRAY_COUNT(subTests); | 3281 static const size_t subTestCount = SK_ARRAY_COUNT(subTests); |
3281 | 3282 |
3282 static void (*firstSubTest)(skiatest::Reporter* ) = 0; | 3283 static void (*firstSubTest)(skiatest::Reporter* ) = 0; |
3283 | 3284 |
3284 static bool runSubTestsFirst = false; | 3285 static bool runSubTestsFirst = false; |
3285 static bool runReverse = false; | 3286 static bool runReverse = false; |
3286 static void (*stopTest)(skiatest::Reporter* ) = 0; | 3287 static void (*stopTest)(skiatest::Reporter* ) = 0; |
3287 | 3288 |
3288 static void PathOpsOpTest(skiatest::Reporter* reporter) { | 3289 DEF_TEST(PathOpsOp, reporter) { |
3289 #ifdef SK_DEBUG | 3290 #ifdef SK_DEBUG |
3290 SkPathOpsDebug::gMaxWindSum = 4; | 3291 SkPathOpsDebug::gMaxWindSum = 4; |
3291 SkPathOpsDebug::gMaxWindValue = 4; | 3292 SkPathOpsDebug::gMaxWindValue = 4; |
3292 #endif | 3293 #endif |
3293 #if DEBUG_SHOW_TEST_NAME | 3294 #if DEBUG_SHOW_TEST_NAME |
3294 strncpy(DEBUG_FILENAME_STRING, "", DEBUG_FILENAME_STRING_LENGTH); | 3295 strncpy(DEBUG_FILENAME_STRING, "", DEBUG_FILENAME_STRING_LENGTH); |
3295 #endif | 3296 #endif |
3296 if (runSubTestsFirst) { | 3297 if (runSubTestsFirst) { |
3297 RunTestSet(reporter, subTests, subTestCount, firstSubTest, stopTest, run
Reverse); | 3298 RunTestSet(reporter, subTests, subTestCount, firstSubTest, stopTest, run
Reverse); |
3298 } | 3299 } |
3299 RunTestSet(reporter, tests, testCount, firstTest, stopTest, runReverse); | 3300 RunTestSet(reporter, tests, testCount, firstTest, stopTest, runReverse); |
3300 if (!runSubTestsFirst) { | 3301 if (!runSubTestsFirst) { |
3301 RunTestSet(reporter, subTests, subTestCount, firstSubTest, stopTest, run
Reverse); | 3302 RunTestSet(reporter, subTests, subTestCount, firstSubTest, stopTest, run
Reverse); |
3302 } | 3303 } |
3303 #ifdef SK_DEBUG | 3304 #ifdef SK_DEBUG |
3304 SkPathOpsDebug::gMaxWindSum = SK_MaxS32; | 3305 SkPathOpsDebug::gMaxWindSum = SK_MaxS32; |
3305 SkPathOpsDebug::gMaxWindValue = SK_MaxS32; | 3306 SkPathOpsDebug::gMaxWindValue = SK_MaxS32; |
3306 #endif | 3307 #endif |
3307 } | 3308 } |
3308 | |
3309 #include "TestClassDef.h" | |
3310 DEFINE_TESTCLASS_SHORT(PathOpsOpTest) | |
OLD | NEW |