| 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 {{{131.37418,11414.9825}, {130.28798,11415.9328}, {130.042755,11417.4131}}}, |
| 54 {{{130.585787,11418.4142}, {130.021447,11417.8498}, {130,11417}}}, |
| 55 |
| 56 {{{130.73167037963867, 11418.546386718750}, {131.26360225677490, 11418.98577
8808592}, |
| 57 {132, 11419 }}}, |
| 58 {{{132, 11419}, {131.15012693405151, 11418.978546142578}, |
| 59 {130.58578681945801, 11418.414184570313}}}, |
| 60 |
| 61 {{{132, 11419}, |
| 62 {130.73167037963867, 11418.546386718750}, {131.26360225677490, 11418
.985778808592}}}, |
| 63 {{{131.15012693405151, 11418.978546142578}, |
| 64 {130.58578681945801, 11418.414184570313}, {132, 11419}}}, |
| 65 |
| 53 {{{3.0774019473063863, 3.35198509346713}, {3.0757503498668397, 3.32732062394
5933}, | 66 {{{3.0774019473063863, 3.35198509346713}, {3.0757503498668397, 3.32732062394
5933}, |
| 54 {3.0744102085015879, 3.3025879417907196}}}, | 67 {3.0744102085015879, 3.3025879417907196}}}, |
| 55 {{{3.053913680774329, 3.3310471586283938}, {3.0758730889691694, 3.3273466070
370152}, | 68 {{{3.053913680774329, 3.3310471586283938}, {3.0758730889691694, 3.3273466070
370152}, |
| 56 {3.0975671980059394, 3.3235031316554351}}}, | 69 {3.0975671980059394, 3.3235031316554351}}}, |
| 57 | 70 |
| 58 {{{3.39068129, 4.44939202}, {3.03659239, 3.81843234}, {3.06844529, 3.0210092
2}}}, | 71 {{{3.39068129, 4.44939202}, {3.03659239, 3.81843234}, {3.06844529, 3.0210092
2}}}, |
| 59 {{{2.10714698, 3.44196686}, {3.12180288, 3.38575704}, {3.75968569, 3.1281838
}}}, | 72 {{{2.10714698, 3.44196686}, {3.12180288, 3.38575704}, {3.75968569, 3.1281838
}}}, |
| 60 | 73 |
| 61 {{{2.74792918, 4.77711896}, {2.82236867, 4.23882547}, {2.82848144, 3.6372934
1}}}, | 74 {{{2.74792918, 4.77711896}, {2.82236867, 4.23882547}, {2.82848144, 3.6372934
1}}}, |
| 62 {{{2.62772567, 3.64823958}, {3.46652495, 3.64258364}, {4.1425079, 3.48623815
}}}, | 75 {{{2.62772567, 3.64823958}, {3.46652495, 3.64258364}, {4.1425079, 3.48623815
}}}, |
| (...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 245 REPORTER_ASSERT(reporter, 0); | 258 REPORTER_ASSERT(reporter, 0); |
| 246 } | 259 } |
| 247 #if ONE_OFF_DEBUG | 260 #if ONE_OFF_DEBUG |
| 248 SkDebugf("%s [%d][%d] t1=%1.9g (%1.9g, %1.9g) t2=%1.9g\n", __FUNCTION__, | 261 SkDebugf("%s [%d][%d] t1=%1.9g (%1.9g, %1.9g) t2=%1.9g\n", __FUNCTION__, |
| 249 outer, inner, tt1, xy1.fX, xy1.fY, tt2); | 262 outer, inner, tt1, xy1.fX, xy1.fY, tt2); |
| 250 #endif | 263 #endif |
| 251 } | 264 } |
| 252 } | 265 } |
| 253 | 266 |
| 254 static void QuadraticIntersection_OneOffTest(skiatest::Reporter* reporter) { | 267 static void QuadraticIntersection_OneOffTest(skiatest::Reporter* reporter) { |
| 255 oneOffTest1(reporter, 43, 47); | 268 oneOffTest1(reporter, 0, 1); |
| 256 } | 269 } |
| 257 | 270 |
| 258 static void oneOffTests(skiatest::Reporter* reporter) { | 271 static void oneOffTests(skiatest::Reporter* reporter) { |
| 259 for (size_t outer = 0; outer < testSetCount - 1; ++outer) { | 272 for (size_t outer = 0; outer < testSetCount - 1; ++outer) { |
| 260 for (size_t inner = outer + 1; inner < testSetCount; ++inner) { | 273 for (size_t inner = outer + 1; inner < testSetCount; ++inner) { |
| 261 oneOffTest1(reporter, outer, inner); | 274 oneOffTest1(reporter, outer, inner); |
| 262 } | 275 } |
| 263 } | 276 } |
| 264 } | 277 } |
| 265 | 278 |
| (...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 458 standardTestCases(reporter); | 471 standardTestCases(reporter); |
| 459 if (false) QuadraticIntersection_IntersectionFinder(); | 472 if (false) QuadraticIntersection_IntersectionFinder(); |
| 460 if (false) QuadraticIntersection_PointFinder(); | 473 if (false) QuadraticIntersection_PointFinder(); |
| 461 if (false) QuadraticIntersection_OneOffTest(reporter); | 474 if (false) QuadraticIntersection_OneOffTest(reporter); |
| 462 } | 475 } |
| 463 | 476 |
| 464 | 477 |
| 465 #include "TestClassDef.h" | 478 #include "TestClassDef.h" |
| 466 DEFINE_TESTCLASS_SHORT(PathOpsQuadIntersectionTest) | 479 DEFINE_TESTCLASS_SHORT(PathOpsQuadIntersectionTest) |
| 467 DEFINE_TESTCLASS_SHORT(QuadraticIntersection_OneOffTest) | 480 DEFINE_TESTCLASS_SHORT(QuadraticIntersection_OneOffTest) |
| OLD | NEW |