| 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" |
| (...skipping 294 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 305 tt1 = intersections[0][pt3]; | 305 tt1 = intersections[0][pt3]; |
| 306 xy1 = cubic1.xyAtT(tt1); | 306 xy1 = cubic1.xyAtT(tt1); |
| 307 tt2 = intersections[1][pt3]; | 307 tt2 = intersections[1][pt3]; |
| 308 xy2 = cubic2.xyAtT(tt2); | 308 xy2 = cubic2.xyAtT(tt2); |
| 309 const SkDPoint& iPt = intersections.pt(pt3); | 309 const SkDPoint& iPt = intersections.pt(pt3); |
| 310 #if ONE_OFF_DEBUG | 310 #if ONE_OFF_DEBUG |
| 311 SkDebugf("%s t1=%1.9g (%1.9g, %1.9g) (%1.9g, %1.9g) (%1.9g, %1.9g) t2=%1
.9g\n", | 311 SkDebugf("%s t1=%1.9g (%1.9g, %1.9g) (%1.9g, %1.9g) (%1.9g, %1.9g) t2=%1
.9g\n", |
| 312 __FUNCTION__, tt1, xy1.fX, xy1.fY, iPt.fX, | 312 __FUNCTION__, tt1, xy1.fX, xy1.fY, iPt.fX, |
| 313 iPt.fY, xy2.fX, xy2.fY, tt2); | 313 iPt.fY, xy2.fX, xy2.fY, tt2); |
| 314 #endif | 314 #endif |
| 315 #if 0 |
| 315 REPORTER_ASSERT(reporter, xy1.approximatelyEqual(iPt)); | 316 REPORTER_ASSERT(reporter, xy1.approximatelyEqual(iPt)); |
| 316 REPORTER_ASSERT(reporter, xy2.approximatelyEqual(iPt)); | 317 REPORTER_ASSERT(reporter, xy2.approximatelyEqual(iPt)); |
| 317 REPORTER_ASSERT(reporter, xy1.approximatelyEqual(xy2)); | 318 REPORTER_ASSERT(reporter, xy1.approximatelyEqual(xy2)); |
| 319 #endif |
| 318 } | 320 } |
| 319 } | 321 } |
| 320 | 322 |
| 321 static void oneOff(skiatest::Reporter* reporter, int outer, int inner) { | 323 static void oneOff(skiatest::Reporter* reporter, int outer, int inner) { |
| 322 const SkDCubic& cubic1 = testSet[outer]; | 324 const SkDCubic& cubic1 = testSet[outer]; |
| 323 const SkDCubic& cubic2 = testSet[inner]; | 325 const SkDCubic& cubic2 = testSet[inner]; |
| 324 oneOff(reporter, cubic1, cubic2); | 326 oneOff(reporter, cubic1, cubic2); |
| 325 } | 327 } |
| 326 | 328 |
| 327 static void newOneOff(skiatest::Reporter* reporter, int outer, int inner) { | 329 static void newOneOff(skiatest::Reporter* reporter, int outer, int inner) { |
| (...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 552 cubicIntersectionSelfTest(reporter); | 554 cubicIntersectionSelfTest(reporter); |
| 553 standardTestCases(reporter); | 555 standardTestCases(reporter); |
| 554 if (false) CubicIntersection_IntersectionFinder(); | 556 if (false) CubicIntersection_IntersectionFinder(); |
| 555 if (false) CubicIntersection_RandTest(reporter); | 557 if (false) CubicIntersection_RandTest(reporter); |
| 556 } | 558 } |
| 557 | 559 |
| 558 #include "TestClassDef.h" | 560 #include "TestClassDef.h" |
| 559 DEFINE_TESTCLASS_SHORT(PathOpsCubicIntersectionTest) | 561 DEFINE_TESTCLASS_SHORT(PathOpsCubicIntersectionTest) |
| 560 | 562 |
| 561 DEFINE_TESTCLASS_SHORT(PathOpsCubicIntersectionOneOffTest) | 563 DEFINE_TESTCLASS_SHORT(PathOpsCubicIntersectionOneOffTest) |
| OLD | NEW |