| 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 "SkIntersections.h" | 8 #include "SkIntersections.h" |
| 9 #include "SkPathOpsCubic.h" | 9 #include "SkPathOpsCubic.h" |
| 10 #include "SkPathOpsLine.h" | 10 #include "SkPathOpsLine.h" |
| 11 #include "SkReduceOrder.h" | 11 #include "SkReduceOrder.h" |
| 12 #include "Test.h" | 12 #include "Test.h" |
| 13 | 13 |
| 14 static struct lineCubic { | 14 static struct lineCubic { |
| 15 SkDCubic cubic; | 15 SkDCubic cubic; |
| 16 SkDLine line; | 16 SkDLine line; |
| 17 } lineCubicTests[] = { | 17 } lineCubicTests[] = { |
| 18 {{{{0,4}, {3,4}, {6,2}, {5,2}}}, |
| 19 {{{4,3}, {2,6}}}}, |
| 18 #if 0 | 20 #if 0 |
| 19 {{{{258, 122}, {260.761414, 122}, { 263, 124.238579}, {263, 127}}}, | 21 {{{{258, 122}, {260.761414, 122}, { 263, 124.238579}, {263, 127}}}, |
| 20 {{{259.82843, 125.17157}, {261.535522, 123.46447}}}}, | 22 {{{259.82843, 125.17157}, {261.535522, 123.46447}}}}, |
| 21 #endif | 23 #endif |
| 22 {{{{1006.6951293945312,291}, {1023.263671875,291}, {1033.8402099609375,304.4
3145751953125}, | 24 {{{{1006.6951293945312,291}, {1023.263671875,291}, {1033.8402099609375,304.4
3145751953125}, |
| 23 {1030.318359375,321}}}, | 25 {1030.318359375,321}}}, |
| 24 {{{979.30487060546875,561}, {1036.695068359375,291}}}}, | 26 {{{979.30487060546875,561}, {1036.695068359375,291}}}}, |
| 25 {{{{259.30487060546875,561}, {242.73631286621094,561}, {232.15980529785156,5
47.56854248046875}, | 27 {{{{259.30487060546875,561}, {242.73631286621094,561}, {232.15980529785156,5
47.56854248046875}, |
| 26 {235.68154907226562,531}}}, | 28 {235.68154907226562,531}}}, |
| 27 {{{286.69512939453125,291}, {229.30485534667969,561}}}}, | 29 {{{286.69512939453125,291}, {229.30485534667969,561}}}}, |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 96 SkDebugf("{{%1.9g,%1.9g}, {%1.9g,%1.9g}},\n", i.pt(0).fX, i.pt(0).fY, nextL.
fX, nextL.fY); | 98 SkDebugf("{{%1.9g,%1.9g}, {%1.9g,%1.9g}},\n", i.pt(0).fX, i.pt(0).fY, nextL.
fX, nextL.fY); |
| 97 SkDebugf("prevD=%1.9g dist=%1.9g nextD=%1.9g\n", prev.distance(nextL), | 99 SkDebugf("prevD=%1.9g dist=%1.9g nextD=%1.9g\n", prev.distance(nextL), |
| 98 sect.distance(i.pt(0)), cubic[3].distance(prevL)); | 100 sect.distance(i.pt(0)), cubic[3].distance(prevL)); |
| 99 #endif | 101 #endif |
| 100 } | 102 } |
| 101 | 103 |
| 102 #include "TestClassDef.h" | 104 #include "TestClassDef.h" |
| 103 DEFINE_TESTCLASS_SHORT(PathOpsCubicLineIntersectionTest) | 105 DEFINE_TESTCLASS_SHORT(PathOpsCubicLineIntersectionTest) |
| 104 | 106 |
| 105 DEFINE_TESTCLASS_SHORT(PathOpsCubicLineIntersectionOneOffTest) | 107 DEFINE_TESTCLASS_SHORT(PathOpsCubicLineIntersectionOneOffTest) |
| OLD | NEW |