| 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 "PathOpsTestCommon.h" | 7 #include "PathOpsTestCommon.h" |
| 8 #include "SkLineParameters.h" | 8 #include "SkLineParameters.h" |
| 9 #include "Test.h" | 9 #include "Test.h" |
| 10 #include "TestClassDef.h" | |
| 11 | 10 |
| 12 // tests to verify that distance calculations are coded correctly | 11 // tests to verify that distance calculations are coded correctly |
| 13 static const SkDCubic tests[] = { | 12 static const SkDCubic tests[] = { |
| 14 {{{0, 0}, {1, 1}, {2, 2}, {0, 3}}}, | 13 {{{0, 0}, {1, 1}, {2, 2}, {0, 3}}}, |
| 15 {{{0, 0}, {1, 1}, {2, 2}, {3, 0}}}, | 14 {{{0, 0}, {1, 1}, {2, 2}, {3, 0}}}, |
| 16 {{{0, 0}, {5, 0}, {-2, 4}, {3, 4}}}, | 15 {{{0, 0}, {5, 0}, {-2, 4}, {3, 4}}}, |
| 17 {{{0, 2}, {1, 0}, {2, 0}, {3, 0}}}, | 16 {{{0, 2}, {1, 0}, {2, 0}, {3, 0}}}, |
| 18 {{{0, .2}, {1, 0}, {2, 0}, {3, 0}}}, | 17 {{{0, .2}, {1, 0}, {2, 0}, {3, 0}}}, |
| 19 {{{0, .02}, {1, 0}, {2, 0}, {3, 0}}}, | 18 {{{0, .02}, {1, 0}, {2, 0}, {3, 0}}}, |
| 20 {{{0, .002}, {1, 0}, {2, 0}, {3, 0}}}, | 19 {{{0, .002}, {1, 0}, {2, 0}, {3, 0}}}, |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 71 if (AlmostEqualUlps(fabs(normalizedDistance[inner]), answers[index][
inner])) { | 70 if (AlmostEqualUlps(fabs(normalizedDistance[inner]), answers[index][
inner])) { |
| 72 continue; | 71 continue; |
| 73 } | 72 } |
| 74 SkDebugf("%s [%d,%d] normalizedDistance:%1.9g != answer:%g\n", | 73 SkDebugf("%s [%d,%d] normalizedDistance:%1.9g != answer:%g\n", |
| 75 __FUNCTION__, static_cast<int>(index), (int)inner, | 74 __FUNCTION__, static_cast<int>(index), (int)inner, |
| 76 normalizedDistance[inner], answers[index][inner]); | 75 normalizedDistance[inner], answers[index][inner]); |
| 77 REPORTER_ASSERT(reporter, 0); | 76 REPORTER_ASSERT(reporter, 0); |
| 78 } | 77 } |
| 79 } | 78 } |
| 80 } | 79 } |
| OLD | NEW |