| 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 testLine1(skiatest::Reporter* reporter) { | 12 static void testLine1(skiatest::Reporter* reporter) { |
| 12 SkPath path; | 13 SkPath path; |
| 13 path.moveTo(2,0); | 14 path.moveTo(2,0); |
| 14 path.lineTo(1,1); | 15 path.lineTo(1,1); |
| 15 path.lineTo(0,0); | 16 path.lineTo(0,0); |
| 16 path.close(); | 17 path.close(); |
| 17 testSimplify(reporter, path); | 18 testSimplify(reporter, path); |
| (...skipping 4312 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4330 }; | 4331 }; |
| 4331 | 4332 |
| 4332 static const size_t subTestCount = SK_ARRAY_COUNT(subTests); | 4333 static const size_t subTestCount = SK_ARRAY_COUNT(subTests); |
| 4333 | 4334 |
| 4334 static void (*firstSubTest)(skiatest::Reporter* ) = 0; | 4335 static void (*firstSubTest)(skiatest::Reporter* ) = 0; |
| 4335 | 4336 |
| 4336 static bool runSubTestsFirst = false; | 4337 static bool runSubTestsFirst = false; |
| 4337 static bool runReverse = false; | 4338 static bool runReverse = false; |
| 4338 static void (*stopTest)(skiatest::Reporter* ) = 0; | 4339 static void (*stopTest)(skiatest::Reporter* ) = 0; |
| 4339 | 4340 |
| 4340 static void PathOpsSimplifyTest(skiatest::Reporter* reporter) { | 4341 DEF_TEST(PathOpsSimplify, reporter) { |
| 4341 #ifdef SK_DEBUG | 4342 #ifdef SK_DEBUG |
| 4342 SkPathOpsDebug::gMaxWindSum = 4; | 4343 SkPathOpsDebug::gMaxWindSum = 4; |
| 4343 SkPathOpsDebug::gMaxWindValue = 4; | 4344 SkPathOpsDebug::gMaxWindValue = 4; |
| 4344 #endif | 4345 #endif |
| 4345 if (runSubTestsFirst) { | 4346 if (runSubTestsFirst) { |
| 4346 RunTestSet(reporter, subTests, subTestCount, firstSubTest, stopTest, run
Reverse); | 4347 RunTestSet(reporter, subTests, subTestCount, firstSubTest, stopTest, run
Reverse); |
| 4347 } | 4348 } |
| 4348 RunTestSet(reporter, tests, testCount, firstTest, stopTest, runReverse); | 4349 RunTestSet(reporter, tests, testCount, firstTest, stopTest, runReverse); |
| 4349 if (!runSubTestsFirst) { | 4350 if (!runSubTestsFirst) { |
| 4350 RunTestSet(reporter, subTests, subTestCount, firstSubTest, stopTest, run
Reverse); | 4351 RunTestSet(reporter, subTests, subTestCount, firstSubTest, stopTest, run
Reverse); |
| 4351 } | 4352 } |
| 4352 #ifdef SK_DEBUG | 4353 #ifdef SK_DEBUG |
| 4353 SkPathOpsDebug::gMaxWindSum = SK_MaxS32; | 4354 SkPathOpsDebug::gMaxWindSum = SK_MaxS32; |
| 4354 SkPathOpsDebug::gMaxWindValue = SK_MaxS32; | 4355 SkPathOpsDebug::gMaxWindValue = SK_MaxS32; |
| 4355 #endif | 4356 #endif |
| 4356 } | 4357 } |
| 4357 | |
| 4358 #include "TestClassDef.h" | |
| 4359 DEFINE_TESTCLASS_SHORT(PathOpsSimplifyTest) | |
| OLD | NEW |