| 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 "PathOpsCubicIntersectionTestData.h" | 7 #include "PathOpsCubicIntersectionTestData.h" |
| 8 #include "PathOpsTestCommon.h" | 8 #include "PathOpsTestCommon.h" |
| 9 #include "SkIntersections.h" | 9 #include "SkIntersections.h" |
| 10 #include "SkPathOpsRect.h" | 10 #include "SkPathOpsRect.h" |
| 11 #include "SkReduceOrder.h" | 11 #include "SkReduceOrder.h" |
| 12 #include "Test.h" | 12 #include "Test.h" |
| 13 | 13 |
| 14 const int firstCubicIntersectionTest = 9; | 14 const int firstCubicIntersectionTest = 9; |
| 15 | 15 |
| 16 static void standardTestCases(skiatest::Reporter* reporter) { | 16 static void standardTestCases(skiatest::Reporter* reporter) { |
| 17 for (size_t index = firstCubicIntersectionTest; index < tests_count; ++index
) { | 17 for (size_t index = firstCubicIntersectionTest; index < tests_count; ++index
) { |
| 18 int iIndex = static_cast<int>(index); | 18 int iIndex = static_cast<int>(index); |
| 19 const SkDCubic& cubic1 = tests[index][0]; | 19 const SkDCubic& cubic1 = tests[index][0]; |
| 20 const SkDCubic& cubic2 = tests[index][1]; | 20 const SkDCubic& cubic2 = tests[index][1]; |
| 21 SkReduceOrder reduce1, reduce2; | 21 SkReduceOrder reduce1, reduce2; |
| 22 int order1 = reduce1.reduce(cubic1, SkReduceOrder::kNo_Quadratics, | 22 int order1 = reduce1.reduce(cubic1, SkReduceOrder::kNo_Quadratics); |
| 23 SkReduceOrder::kFill_Style); | 23 int order2 = reduce2.reduce(cubic2, SkReduceOrder::kNo_Quadratics); |
| 24 int order2 = reduce2.reduce(cubic2, SkReduceOrder::kNo_Quadratics, | |
| 25 SkReduceOrder::kFill_Style); | |
| 26 const bool showSkipped = false; | 24 const bool showSkipped = false; |
| 27 if (order1 < 4) { | 25 if (order1 < 4) { |
| 28 if (showSkipped) { | 26 if (showSkipped) { |
| 29 SkDebugf("%s [%d] cubic1 order=%d\n", __FUNCTION__, iIndex, orde
r1); | 27 SkDebugf("%s [%d] cubic1 order=%d\n", __FUNCTION__, iIndex, orde
r1); |
| 30 } | 28 } |
| 31 continue; | 29 continue; |
| 32 } | 30 } |
| 33 if (order2 < 4) { | 31 if (order2 < 4) { |
| 34 if (showSkipped) { | 32 if (showSkipped) { |
| 35 SkDebugf("%s [%d] cubic2 order=%d\n", __FUNCTION__, iIndex, orde
r2); | 33 SkDebugf("%s [%d] cubic2 order=%d\n", __FUNCTION__, iIndex, orde
r2); |
| (...skipping 606 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 642 } | 640 } |
| 643 | 641 |
| 644 #include "TestClassDef.h" | 642 #include "TestClassDef.h" |
| 645 DEFINE_TESTCLASS_SHORT(PathOpsCubicIntersectionTest) | 643 DEFINE_TESTCLASS_SHORT(PathOpsCubicIntersectionTest) |
| 646 | 644 |
| 647 DEFINE_TESTCLASS_SHORT(PathOpsCubicIntersectionOneOffTest) | 645 DEFINE_TESTCLASS_SHORT(PathOpsCubicIntersectionOneOffTest) |
| 648 | 646 |
| 649 DEFINE_TESTCLASS_SHORT(PathOpsCubicSelfOneOffTest) | 647 DEFINE_TESTCLASS_SHORT(PathOpsCubicSelfOneOffTest) |
| 650 | 648 |
| 651 DEFINE_TESTCLASS_SHORT(PathOpsCubicCoinOneOffTest) | 649 DEFINE_TESTCLASS_SHORT(PathOpsCubicCoinOneOffTest) |
| OLD | NEW |