| 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 "SkGeometry.h" | 9 #include "SkGeometry.h" |
| 10 #include "SkIntersections.h" | 10 #include "SkIntersections.h" |
| 11 #include "SkPathOpsRect.h" | 11 #include "SkPathOpsRect.h" |
| 12 #include "SkReduceOrder.h" | 12 #include "SkReduceOrder.h" |
| 13 #include "Test.h" | 13 #include "Test.h" |
| 14 | 14 |
| 15 #include <stdlib.h> |
| 16 |
| 15 const int firstCubicIntersectionTest = 9; | 17 const int firstCubicIntersectionTest = 9; |
| 16 | 18 |
| 17 static void standardTestCases(skiatest::Reporter* reporter) { | 19 static void standardTestCases(skiatest::Reporter* reporter) { |
| 18 for (size_t index = firstCubicIntersectionTest; index < tests_count; ++index
) { | 20 for (size_t index = firstCubicIntersectionTest; index < tests_count; ++index
) { |
| 19 int iIndex = static_cast<int>(index); | 21 int iIndex = static_cast<int>(index); |
| 20 const SkDCubic& cubic1 = tests[index][0]; | 22 const SkDCubic& cubic1 = tests[index][0]; |
| 21 const SkDCubic& cubic2 = tests[index][1]; | 23 const SkDCubic& cubic2 = tests[index][1]; |
| 22 SkReduceOrder reduce1, reduce2; | 24 SkReduceOrder reduce1, reduce2; |
| 23 int order1 = reduce1.reduce(cubic1, SkReduceOrder::kNo_Quadratics); | 25 int order1 = reduce1.reduce(cubic1, SkReduceOrder::kNo_Quadratics); |
| 24 int order2 = reduce2.reduce(cubic2, SkReduceOrder::kNo_Quadratics); | 26 int order2 = reduce2.reduce(cubic2, SkReduceOrder::kNo_Quadratics); |
| (...skipping 669 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 694 } | 696 } |
| 695 | 697 |
| 696 DEF_TEST(PathOpsCubicIntersection, reporter) { | 698 DEF_TEST(PathOpsCubicIntersection, reporter) { |
| 697 oneOffTests(reporter); | 699 oneOffTests(reporter); |
| 698 cubicIntersectionSelfTest(reporter); | 700 cubicIntersectionSelfTest(reporter); |
| 699 cubicIntersectionCoinTest(reporter); | 701 cubicIntersectionCoinTest(reporter); |
| 700 standardTestCases(reporter); | 702 standardTestCases(reporter); |
| 701 if (false) CubicIntersection_IntersectionFinder(); | 703 if (false) CubicIntersection_IntersectionFinder(); |
| 702 if (false) CubicIntersection_RandTest(reporter); | 704 if (false) CubicIntersection_RandTest(reporter); |
| 703 } | 705 } |
| OLD | NEW |