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, 6}, {1.0851458311080933, 4.3722810745239258}, {1.5815209150314331, 3.
038947582244873}, {1.9683018922805786, 1.9999997615814209}}}, |
| 53 {{{3,2}, {1,2}}}}, |
| 54 |
52 {{{{0.468027353,4}, {1.06734705,1.33333337}, {1.36700678,0}, {3,0}}}, | 55 {{{{0.468027353,4}, {1.06734705,1.33333337}, {1.36700678,0}, {3,0}}}, |
53 {{{2,1}, {0,1}}}}, | 56 {{{2,1}, {0,1}}}}, |
54 | 57 |
55 {{{{-634.60540771484375, -481.262939453125}, {266.2696533203125, -752.708679
19921875}, | 58 {{{{-634.60540771484375, -481.262939453125}, {266.2696533203125, -752.708679
19921875}, |
56 {-751.8370361328125, -317.37921142578125}, {-969.7427978515625, 824.
7255859375}}}, | 59 {-751.8370361328125, -317.37921142578125}, {-969.7427978515625, 824.
7255859375}}}, |
57 {{{-287.9506133720805678, -557.1376476615772617}, | 60 {{{-287.9506133720805678, -557.1376476615772617}, |
58 {-285.9506133720805678, -557.1376476615772617}}}}, | 61 {-285.9506133720805678, -557.1376476615772617}}}}, |
59 | 62 |
60 {{{{36.7184372,0.888650894}, {36.7184372,0.888650894}, {35.1233864,0.5540154
58}, | 63 {{{{36.7184372,0.888650894}, {36.7184372,0.888650894}, {35.1233864,0.5540154
58}, |
61 {34.5114098,-0.115255356}}}, {{{35.4531212,0}, {31.9375,0}}}}, | 64 {34.5114098,-0.115255356}}}, {{{35.4531212,0}, {31.9375,0}}}}, |
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
186 | 189 |
187 DEF_TEST(PathOpsCubicLineIntersectionOneOff, reporter) { | 190 DEF_TEST(PathOpsCubicLineIntersectionOneOff, reporter) { |
188 int iIndex = 0; | 191 int iIndex = 0; |
189 testOne(reporter, iIndex); | 192 testOne(reporter, iIndex); |
190 const SkDCubic& cubic = lineCubicTests[iIndex].cubic; | 193 const SkDCubic& cubic = lineCubicTests[iIndex].cubic; |
191 const SkDLine& line = lineCubicTests[iIndex].line; | 194 const SkDLine& line = lineCubicTests[iIndex].line; |
192 SkIntersections i; | 195 SkIntersections i; |
193 i.intersect(cubic, line); | 196 i.intersect(cubic, line); |
194 SkASSERT(i.used() == 1); | 197 SkASSERT(i.used() == 1); |
195 } | 198 } |
OLD | NEW |