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 "PathOpsCubicIntersectionTestData.h" | 7 #include "PathOpsCubicIntersectionTestData.h" |
8 #include <limits> | 8 #include <limits> |
9 | 9 |
10 static const double D = FLT_EPSILON / 2; | 10 static const double D = FLT_EPSILON / 2; |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 {{{1, 6.5}, {12.5, 1}, {-4, 1}, {.5, 6}}} | 90 {{{1, 6.5}, {12.5, 1}, {-4, 1}, {.5, 6}}} |
91 }, { | 91 }, { |
92 {{{315.748, 312.84}, {312.644, 318.134}, {305.836, 319.909}, {300.542, 3
16.804}}}, | 92 {{{315.748, 312.84}, {312.644, 318.134}, {305.836, 319.909}, {300.542, 3
16.804}}}, |
93 {{{317.122, 309.05}, {316.112, 315.102}, {310.385, 319.19}, {304.332, 3
18.179}}} | 93 {{{317.122, 309.05}, {316.112, 315.102}, {310.385, 319.19}, {304.332, 3
18.179}}} |
94 }, { | 94 }, { |
95 {{{1046.604051, 172.937967}, {1046.604051, 178.9763059}, {1041.76745,
183.9279165}, {1035.703842, 184.0432409}}}, | 95 {{{1046.604051, 172.937967}, {1046.604051, 178.9763059}, {1041.76745,
183.9279165}, {1035.703842, 184.0432409}}}, |
96 {{{1046.452235, 174.7640504}, {1045.544872, 180.1973817}, {1040.837966,
184.0469882}, {1035.505925, 184.0469882}}} | 96 {{{1046.452235, 174.7640504}, {1045.544872, 180.1973817}, {1040.837966,
184.0469882}, {1035.505925, 184.0469882}}} |
97 }, { | 97 }, { |
98 {{{125.79356, 199.57382}, {51.16556, 128.93575}, {87.494, 16.67848}, {1
67.29361, 16.67848}}}, | 98 {{{125.79356, 199.57382}, {51.16556, 128.93575}, {87.494, 16.67848}, {1
67.29361, 16.67848}}}, |
99 {{{167.29361, 55.81876}, {100.36128, 55.81876}, {68.64099, 145.4755}, {1
25.7942, 199.57309}}} | 99 {{{167.29361, 55.81876}, {100.36128, 55.81876}, {68.64099, 145.4755}, {1
25.7942, 199.57309}}} |
| 100 }, { |
| 101 {{{104.11546583642826, 370.21352558595504}, {122.96968232592344, 404.544
89231839295}, |
| 102 {169.90881005384728, 425.00067000000007}, {221.33045999999999, 425.000
67000000001}}}, |
| 103 {{{116.32365976159625, 381.71048540582598}, {103.86096590870899, 381.710
48540581626}, |
| 104 {91.394188003200725, 377.17917781762833}, {82.622283093355179, 368.116
83661930334}}} |
100 } | 105 } |
101 }; | 106 }; |
102 | 107 |
103 const size_t tests_count = sizeof(tests) / sizeof(tests[0]); | 108 const size_t tests_count = sizeof(tests) / sizeof(tests[0]); |
104 | 109 |
105 SkDCubic hexTests[][2] = { | |
106 { | |
107 // placeholder for hex converted below | |
108 {{{0, 0}, {0, 0}, {0, 0}, {0, 0}}}, {{{0, 0}, {0, 0}, {0, 0}, {0, 0}}} | |
109 } | |
110 }; | |
111 | |
112 const size_t hexTests_count = sizeof(hexTests) / sizeof(hexTests[0]); | |
113 | |
114 static const uint64_t testx[2][8] = { | |
115 { | |
116 0xf0d0d1ca63075a40LLU, 0x9408ce996a237740LLU, 0x6d5675460fbe5e40LLU, 0x6
ef501e1b7487940LLU, | |
117 0x9a71d2f8143d6540LLU, 0x6bc18bbe02907a40LLU, 0x5b94d92093aa6b40LLU, 0x6
ac18bbe02907a40LLU | |
118 }, | |
119 { | |
120 0x92c56ed7b6145d40LLU, 0xede4f1255edb7740LLU, 0x1138c1101af75940LLU, 0x4
2e4f1255edb7740LLU, | |
121 0x408e51603ad95640LLU, 0x1e2e8fe9dd927740LLU, 0x1cb4777cd3a75440LLU, 0x2
12e1390de017740LLU | |
122 } | |
123 }; | |
124 | |
125 void convert_testx() { | |
126 const uint64_t* inPtr = testx[0]; | |
127 double* outPtr = &hexTests[sizeof(tests) / sizeof(tests[0]) - 1][0][0].fX; | |
128 for (unsigned index = 0; index < sizeof(testx) / sizeof(testx[0][0]); ++inde
x) { | |
129 uint64_t input = *inPtr++; | |
130 unsigned char* output = (unsigned char*) outPtr++; | |
131 for (unsigned byte = 0; byte < sizeof(input); ++byte) { | |
132 output[byte] = input >> (7 - byte) * 8; | |
133 } | |
134 } | |
135 } | |
136 | |
137 const SkDCubic lines[] = { | 110 const SkDCubic lines[] = { |
138 {{{0, 0}, {0, 0}, {0, 0}, {1, 0}}}, // 0: horizontal | 111 {{{0, 0}, {0, 0}, {0, 0}, {1, 0}}}, // 0: horizontal |
139 {{{1, 0}, {0, 0}, {0, 0}, {0, 0}}}, | 112 {{{1, 0}, {0, 0}, {0, 0}, {0, 0}}}, |
140 {{{1, 0}, {2, 0}, {3, 0}, {4, 0}}}, | 113 {{{1, 0}, {2, 0}, {3, 0}, {4, 0}}}, |
141 {{{0, 0}, {0, 0}, {0, 0}, {0, 1}}}, // 5: vertical | 114 {{{0, 0}, {0, 0}, {0, 0}, {0, 1}}}, // 5: vertical |
142 {{{0, 1}, {0, 0}, {0, 0}, {0, 0}}}, | 115 {{{0, 1}, {0, 0}, {0, 0}, {0, 0}}}, |
143 {{{0, 1}, {0, 2}, {0, 3}, {0, 4}}}, | 116 {{{0, 1}, {0, 2}, {0, 3}, {0, 4}}}, |
144 {{{0, 0}, {0, 0}, {0, 0}, {1, 1}}}, // 10: 3 coincident | 117 {{{0, 0}, {0, 0}, {0, 0}, {1, 1}}}, // 10: 3 coincident |
145 {{{1, 1}, {0, 0}, {0, 0}, {0, 0}}}, | 118 {{{1, 1}, {0, 0}, {0, 0}, {0, 0}}}, |
146 {{{0, 0}, {0, 0}, {1, 1}, {2, 2}}}, // 14: 2 coincident | 119 {{{0, 0}, {0, 0}, {1, 1}, {2, 2}}}, // 14: 2 coincident |
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
291 {{{1, 1}, {4, 4}, {3, 3}, {2+M, 2}}}, // INVESTIGATE: why the epsilon is sm
aller | 264 {{{1, 1}, {4, 4}, {3, 3}, {2+M, 2}}}, // INVESTIGATE: why the epsilon is sm
aller |
292 {{{2, 2}, {1, 1}, {3+N, 3}, {4, 4}}}, | 265 {{{2, 2}, {1, 1}, {3+N, 3}, {4, 4}}}, |
293 {{{2, 2}, {1+N, 1}, {4, 4}, {3, 3}}}, | 266 {{{2, 2}, {1+N, 1}, {4, 4}, {3, 3}}}, |
294 {{{2, 2+N}, {3, 3}, {1, 1}, {4, 4}}}, | 267 {{{2, 2+N}, {3, 3}, {1, 1}, {4, 4}}}, |
295 {{{2+M, 2}, {3, 3}, {4, 4}, {1, 1}}}, // INVESTIGATE: why the epsilon is sm
aller | 268 {{{2+M, 2}, {3, 3}, {4, 4}, {1, 1}}}, // INVESTIGATE: why the epsilon is sm
aller |
296 {{{2, 2}, {4+N, 4}, {1, 1}, {3, 3}}}, | 269 {{{2, 2}, {4+N, 4}, {1, 1}, {3, 3}}}, |
297 {{{2, 2}, {4, 4}, {3, 3}, {1, 1+N}}}, | 270 {{{2, 2}, {4, 4}, {3, 3}, {1, 1+N}}}, |
298 }; | 271 }; |
299 | 272 |
300 const size_t negEpsilonLines_count = sizeof(negEpsilonLines) / sizeof(negEpsilon
Lines[0]); | 273 const size_t negEpsilonLines_count = sizeof(negEpsilonLines) / sizeof(negEpsilon
Lines[0]); |
OLD | NEW |