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" |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 REPORTER_ASSERT(reporter, 0); | 42 REPORTER_ASSERT(reporter, 0); |
43 } | 43 } |
44 if (order1 == 4 && order2 == 2) { | 44 if (order1 == 4 && order2 == 2) { |
45 SkIntersections i; | 45 SkIntersections i; |
46 int roots = i.intersect(cubic, line); | 46 int roots = i.intersect(cubic, line); |
47 REPORTER_ASSERT(reporter, roots == 0); | 47 REPORTER_ASSERT(reporter, roots == 0); |
48 } | 48 } |
49 } | 49 } |
50 | 50 |
51 static lineCubic lineCubicTests[] = { | 51 static lineCubic lineCubicTests[] = { |
52 {{{{0.468027353,4}, {1.06734705,1.33333337}, {1.36700678,0}, {3,0}}}, | |
53 {{{2,1}, {0,1}}}}, | |
54 | |
55 {{{{-634.60540771484375, -481.262939453125}, {266.2696533203125, -752.708679
19921875}, | 52 {{{{-634.60540771484375, -481.262939453125}, {266.2696533203125, -752.708679
19921875}, |
56 {-751.8370361328125, -317.37921142578125}, {-969.7427978515625, 824.
7255859375}}}, | 53 {-751.8370361328125, -317.37921142578125}, {-969.7427978515625, 824.
7255859375}}}, |
57 {{{-287.9506133720805678, -557.1376476615772617}, | 54 {{{-287.9506133720805678, -557.1376476615772617}, |
58 {-285.9506133720805678, -557.1376476615772617}}}}, | 55 {-285.9506133720805678, -557.1376476615772617}}}}, |
59 | 56 |
60 {{{{36.7184372,0.888650894}, {36.7184372,0.888650894}, {35.1233864,0.5540154
58}, | 57 {{{{36.7184372,0.888650894}, {36.7184372,0.888650894}, {35.1233864,0.5540154
58}, |
61 {34.5114098,-0.115255356}}}, {{{35.4531212,0}, {31.9375,0}}}}, | 58 {34.5114098,-0.115255356}}}, {{{35.4531212,0}, {31.9375,0}}}}, |
62 | 59 |
63 {{{{421, 378}, {421, 380.209137f}, {418.761414f, 382}, {416, 382}}}, | 60 {{{{421, 378}, {421, 380.209137f}, {418.761414f, 382}, {416, 382}}}, |
64 {{{320, 378}, {421, 378.000031f}}}}, | 61 {{{320, 378}, {421, 378.000031f}}}}, |
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
186 | 183 |
187 DEF_TEST(PathOpsCubicLineIntersectionOneOff, reporter) { | 184 DEF_TEST(PathOpsCubicLineIntersectionOneOff, reporter) { |
188 int iIndex = 0; | 185 int iIndex = 0; |
189 testOne(reporter, iIndex); | 186 testOne(reporter, iIndex); |
190 const SkDCubic& cubic = lineCubicTests[iIndex].cubic; | 187 const SkDCubic& cubic = lineCubicTests[iIndex].cubic; |
191 const SkDLine& line = lineCubicTests[iIndex].line; | 188 const SkDLine& line = lineCubicTests[iIndex].line; |
192 SkIntersections i; | 189 SkIntersections i; |
193 i.intersect(cubic, line); | 190 i.intersect(cubic, line); |
194 SkASSERT(i.used() == 1); | 191 SkASSERT(i.used() == 1); |
195 } | 192 } |
OLD | NEW |