| 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 "PathOpsQuadIntersectionTestData.h" | 7 #include "PathOpsQuadIntersectionTestData.h" |
| 8 #include "SkIntersections.h" | 8 #include "SkIntersections.h" |
| 9 #include "SkPathOpsRect.h" | 9 #include "SkPathOpsRect.h" |
| 10 #include "SkReduceOrder.h" | 10 #include "SkReduceOrder.h" |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 tt2, xy2.fX, xy2.fY); | 43 tt2, xy2.fX, xy2.fY); |
| 44 REPORTER_ASSERT(reporter, 0); | 44 REPORTER_ASSERT(reporter, 0); |
| 45 } | 45 } |
| 46 } | 46 } |
| 47 } | 47 } |
| 48 } | 48 } |
| 49 } | 49 } |
| 50 } | 50 } |
| 51 | 51 |
| 52 static const SkDQuad testSet[] = { | 52 static const SkDQuad testSet[] = { |
| 53 {{{0.647069409,2.97691634}, {0.946860918,3.17625612}, {1.46875407,2.65105457
}}}, |
| 54 {{{0,1}, {0.723699095,2.82756208}, {1.08907197,2.97497449}}}, |
| 55 |
| 53 {{{131.37418,11414.9825}, {130.28798,11415.9328}, {130.042755,11417.4131}}}, | 56 {{{131.37418,11414.9825}, {130.28798,11415.9328}, {130.042755,11417.4131}}}, |
| 54 {{{130.585787,11418.4142}, {130.021447,11417.8498}, {130,11417}}}, | 57 {{{130.585787,11418.4142}, {130.021447,11417.8498}, {130,11417}}}, |
| 55 | 58 |
| 56 {{{130.73167037963867, 11418.546386718750}, {131.26360225677490, 11418.98577
8808592}, | 59 {{{130.73167037963867, 11418.546386718750}, {131.26360225677490, 11418.98577
8808592}, |
| 57 {132, 11419 }}}, | 60 {132, 11419 }}}, |
| 58 {{{132, 11419}, {131.15012693405151, 11418.978546142578}, | 61 {{{132, 11419}, {131.15012693405151, 11418.978546142578}, |
| 59 {130.58578681945801, 11418.414184570313}}}, | 62 {130.58578681945801, 11418.414184570313}}}, |
| 60 | 63 |
| 61 {{{132, 11419}, | 64 {{{132, 11419}, |
| 62 {130.73167037963867, 11418.546386718750}, {131.26360225677490, 11418
.985778808592}}}, | 65 {130.73167037963867, 11418.546386718750}, {131.26360225677490, 11418
.985778808592}}}, |
| (...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 257 tt1, xy1.fX, xy1.fY, tt2, xy2.fX, xy2.fY); | 260 tt1, xy1.fX, xy1.fY, tt2, xy2.fX, xy2.fY); |
| 258 REPORTER_ASSERT(reporter, 0); | 261 REPORTER_ASSERT(reporter, 0); |
| 259 } | 262 } |
| 260 #if ONE_OFF_DEBUG | 263 #if ONE_OFF_DEBUG |
| 261 SkDebugf("%s [%d][%d] t1=%1.9g (%1.9g, %1.9g) t2=%1.9g\n", __FUNCTION__, | 264 SkDebugf("%s [%d][%d] t1=%1.9g (%1.9g, %1.9g) t2=%1.9g\n", __FUNCTION__, |
| 262 outer, inner, tt1, xy1.fX, xy1.fY, tt2); | 265 outer, inner, tt1, xy1.fX, xy1.fY, tt2); |
| 263 #endif | 266 #endif |
| 264 } | 267 } |
| 265 } | 268 } |
| 266 | 269 |
| 267 static void QuadraticIntersection_OneOffTest(skiatest::Reporter* reporter) { | 270 static void PathOpsQuadIntersectionOneOffTest(skiatest::Reporter* reporter) { |
| 268 oneOffTest1(reporter, 0, 1); | 271 oneOffTest1(reporter, 0, 1); |
| 269 } | 272 } |
| 270 | 273 |
| 271 static void oneOffTests(skiatest::Reporter* reporter) { | 274 static void oneOffTests(skiatest::Reporter* reporter) { |
| 272 for (size_t outer = 0; outer < testSetCount - 1; ++outer) { | 275 for (size_t outer = 0; outer < testSetCount - 1; ++outer) { |
| 273 for (size_t inner = outer + 1; inner < testSetCount; ++inner) { | 276 for (size_t inner = outer + 1; inner < testSetCount; ++inner) { |
| 274 oneOffTest1(reporter, outer, inner); | 277 oneOffTest1(reporter, outer, inner); |
| 275 } | 278 } |
| 276 } | 279 } |
| 277 } | 280 } |
| (...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 464 static void QuadraticIntersection_IntersectionFinder() { | 467 static void QuadraticIntersection_IntersectionFinder() { |
| 465 intersectionFinder(0, 1); | 468 intersectionFinder(0, 1); |
| 466 } | 469 } |
| 467 | 470 |
| 468 static void PathOpsQuadIntersectionTest(skiatest::Reporter* reporter) { | 471 static void PathOpsQuadIntersectionTest(skiatest::Reporter* reporter) { |
| 469 oneOffTests(reporter); | 472 oneOffTests(reporter); |
| 470 coincidentTest(reporter); | 473 coincidentTest(reporter); |
| 471 standardTestCases(reporter); | 474 standardTestCases(reporter); |
| 472 if (false) QuadraticIntersection_IntersectionFinder(); | 475 if (false) QuadraticIntersection_IntersectionFinder(); |
| 473 if (false) QuadraticIntersection_PointFinder(); | 476 if (false) QuadraticIntersection_PointFinder(); |
| 474 if (false) QuadraticIntersection_OneOffTest(reporter); | |
| 475 } | 477 } |
| 476 | 478 |
| 477 | 479 |
| 478 #include "TestClassDef.h" | 480 #include "TestClassDef.h" |
| 479 DEFINE_TESTCLASS_SHORT(PathOpsQuadIntersectionTest) | 481 DEFINE_TESTCLASS_SHORT(PathOpsQuadIntersectionTest) |
| 480 DEFINE_TESTCLASS_SHORT(QuadraticIntersection_OneOffTest) | 482 |
| 483 DEFINE_TESTCLASS_SHORT(PathOpsQuadIntersectionOneOffTest) |
| OLD | NEW |