caryclark@google.com | 32546db | 2012-08-31 20:55:07 +0000 | [diff] [blame] | 1 | <!-- path visualizer --> |
caryclark@google.com | 752b60e | 2012-03-22 21:11:17 +0000 | [diff] [blame] | 2 | <html> |
| 3 | <head> |
| 4 | <div style="height:0"> |
caryclark@google.com | fa0588f | 2012-04-26 21:01:06 +0000 | [diff] [blame] | 5 | |
| 6 | <div id="testSimplifyQuadratic1"> |
| 7 | SkPath path, out; |
| 8 | path.moveTo(0, 0); |
| 9 | path.quadTo(1, 0, 1, 1); |
| 10 | path.close(); |
| 11 | path.moveTo(1, 0); |
| 12 | path.quadTo(0, 0, 0, 1); |
| 13 | path.close(); |
| 14 | testSimplify(path, true, out, bitmap); |
| 15 | } |
caryclark@google.com | 752b60e | 2012-03-22 21:11:17 +0000 | [diff] [blame] | 16 | </div> |
caryclark@google.com | fa0588f | 2012-04-26 21:01:06 +0000 | [diff] [blame] | 17 | |
| 18 | <div id="testSimplifyQuadratic2"> |
| 19 | SkPath path, out; |
| 20 | path.moveTo(0, 0); |
| 21 | path.quadTo(20, 0, 20, 20); |
| 22 | path.close(); |
| 23 | path.moveTo(20, 0); |
| 24 | path.quadTo(0, 0, 0, 20); |
| 25 | path.close(); |
| 26 | testSimplify(path, true, out, bitmap); |
| 27 | } |
caryclark@google.com | d88e089 | 2012-03-27 13:23:51 +0000 | [diff] [blame] | 28 | </div> |
caryclark@google.com | fa0588f | 2012-04-26 21:01:06 +0000 | [diff] [blame] | 29 | |
| 30 | <div id="testSimplifyQuadratic3"> |
| 31 | SkPath path, out; |
| 32 | path.moveTo(0, 0); |
| 33 | path.quadTo(20, 0, 20, 20); |
| 34 | path.close(); |
| 35 | path.moveTo(0, 20); |
| 36 | path.quadTo(0, 0, 20, 0); |
| 37 | path.close(); |
| 38 | testSimplify(path, true, out, bitmap); |
| 39 | } |
caryclark@google.com | d88e089 | 2012-03-27 13:23:51 +0000 | [diff] [blame] | 40 | </div> |
caryclark@google.com | fa0588f | 2012-04-26 21:01:06 +0000 | [diff] [blame] | 41 | |
| 42 | <div id="testSimplifyQuadratic4"> |
| 43 | SkPath path, out; |
| 44 | path.moveTo(0, 20); |
| 45 | path.quadTo(20, 0, 40, 20); |
| 46 | path.close(); |
| 47 | path.moveTo(40, 10); |
| 48 | path.quadTo(20, 30, 0, 10); |
| 49 | path.close(); |
| 50 | testSimplify(path, true, out, bitmap); |
| 51 | drawAsciiPaths(path, out, true); |
| 52 | } |
caryclark@google.com | d88e089 | 2012-03-27 13:23:51 +0000 | [diff] [blame] | 53 | </div> |
caryclark@google.com | fa0588f | 2012-04-26 21:01:06 +0000 | [diff] [blame] | 54 | |
| 55 | <div id="testSimplifyQuadratic5"> |
| 56 | SkPath path, out; |
| 57 | path.moveTo(0, 0); |
| 58 | path.quadTo(0, 0, 0, 0); |
| 59 | path.lineTo(0, 0); |
| 60 | path.close(); |
| 61 | path.moveTo(0, 0); |
| 62 | path.lineTo(0, 0); |
| 63 | path.quadTo(0, 0, 0, 1); |
| 64 | path.close(); |
| 65 | testSimplify(path, true, out, bitmap); |
| 66 | drawAsciiPaths(path, out, true); |
| 67 | } |
caryclark@google.com | fb17342 | 2012-04-10 18:28:55 +0000 | [diff] [blame] | 68 | </div> |
caryclark@google.com | fa0588f | 2012-04-26 21:01:06 +0000 | [diff] [blame] | 69 | |
| 70 | <div id="testSimplifyQuadratic6"> |
| 71 | SkPath path, out; |
| 72 | path.moveTo(0, 0); |
| 73 | path.quadTo(0, 0, 0, 0); |
| 74 | path.lineTo(1, 0); |
| 75 | path.close(); |
| 76 | path.moveTo(0, 0); |
| 77 | path.lineTo(0, 0); |
| 78 | path.quadTo(1, 0, 0, 1); |
| 79 | path.close(); |
| 80 | testSimplify(path, true, out, bitmap); |
| 81 | drawAsciiPaths(path, out, true); |
| 82 | } |
caryclark@google.com | fb17342 | 2012-04-10 18:28:55 +0000 | [diff] [blame] | 83 | </div> |
caryclark@google.com | fa0588f | 2012-04-26 21:01:06 +0000 | [diff] [blame] | 84 | |
| 85 | <div id="testSimplifyQuadratic7"> |
| 86 | SkPath path, out; |
| 87 | path.moveTo(0, 0); |
| 88 | path.quadTo(0, 0, 0, 0); |
| 89 | path.lineTo(0, 1); |
| 90 | path.close(); |
| 91 | path.moveTo(0, 0); |
| 92 | path.lineTo(0, 0); |
| 93 | path.quadTo(1, 0, 0, 2); |
| 94 | path.close(); |
| 95 | testSimplify(path, true, out, bitmap); |
| 96 | drawAsciiPaths(path, out, true); |
| 97 | } |
| 98 | </div> |
| 99 | |
| 100 | <div id="testSimplifyQuadratic8"> |
| 101 | SkPath path, out; |
| 102 | path.moveTo(0, 0); |
| 103 | path.quadTo(0, 0, 0, 0); |
| 104 | path.lineTo(0, 0); |
| 105 | path.close(); |
| 106 | path.moveTo(0, 0); |
| 107 | path.lineTo(0, 0); |
| 108 | path.quadTo(1, 0, 0, 2); |
| 109 | path.close(); |
| 110 | testSimplify(path, true, out, bitmap); |
| 111 | drawAsciiPaths(path, out, true); |
| 112 | } |
| 113 | </div> |
| 114 | |
| 115 | <div id="testSimplifyQuadratic9"> |
| 116 | SkPath path, out; |
| 117 | path.moveTo(0, 0); |
| 118 | path.quadTo(0, 0, 0, 0); |
| 119 | path.lineTo(1, 1); |
| 120 | path.close(); |
| 121 | path.moveTo(0, 0); |
| 122 | path.lineTo(0, 0); |
| 123 | path.quadTo(1, 0, 2, 2); |
| 124 | path.close(); |
| 125 | testSimplify(path, true, out, bitmap); |
| 126 | drawAsciiPaths(path, out, true); |
| 127 | } |
| 128 | </div> |
| 129 | |
| 130 | <div id="testSimplifyQuadratic10"> |
| 131 | SkPath path, out; |
caryclark@google.com | 78e1713 | 2012-04-17 11:40:34 +0000 | [diff] [blame] | 132 | path.moveTo(0, 0); |
| 133 | path.quadTo(0, 0, 0, 0); |
| 134 | path.lineTo(0, 0); |
| 135 | path.close(); |
| 136 | path.moveTo(0, 0); |
| 137 | path.lineTo(0, 1); |
| 138 | path.quadTo(1, 1, 1, 2); |
caryclark@google.com | 78e1713 | 2012-04-17 11:40:34 +0000 | [diff] [blame] | 139 | path.close(); |
caryclark@google.com | fa0588f | 2012-04-26 21:01:06 +0000 | [diff] [blame] | 140 | testSimplify(path, true, out, bitmap); |
| 141 | drawAsciiPaths(path, out, true); |
| 142 | } |
caryclark@google.com | 78e1713 | 2012-04-17 11:40:34 +0000 | [diff] [blame] | 143 | </div> |
| 144 | |
caryclark@google.com | fa0588f | 2012-04-26 21:01:06 +0000 | [diff] [blame] | 145 | <div id="testSimplifyQuadratic11"> |
| 146 | SkPath path, out; |
caryclark@google.com | 78e1713 | 2012-04-17 11:40:34 +0000 | [diff] [blame] | 147 | path.moveTo(0, 0); |
| 148 | path.quadTo(0, 0, 0, 0); |
| 149 | path.lineTo(0, 2); |
caryclark@google.com | 78e1713 | 2012-04-17 11:40:34 +0000 | [diff] [blame] | 150 | path.close(); |
| 151 | path.moveTo(0, 0); |
| 152 | path.lineTo(2, 1); |
| 153 | path.quadTo(2, 2, 3, 3); |
caryclark@google.com | fa0588f | 2012-04-26 21:01:06 +0000 | [diff] [blame] | 154 | path.close(); |
| 155 | testSimplify(path, true, out, bitmap); |
| 156 | drawAsciiPaths(path, out, true); |
| 157 | } |
| 158 | </div> |
| 159 | |
| 160 | <div id="testSimplifyQuadratic12"> |
| 161 | SkPath path, out; |
| 162 | path.moveTo(0, 0); |
| 163 | path.lineTo(0, 2); |
caryclark@google.com | 78e1713 | 2012-04-17 11:40:34 +0000 | [diff] [blame] | 164 | path.lineTo(0, 0); |
| 165 | path.close(); |
caryclark@google.com | fa0588f | 2012-04-26 21:01:06 +0000 | [diff] [blame] | 166 | path.moveTo(3, 0); |
| 167 | path.quadTo(1, 1, 0, 2); |
| 168 | path.lineTo(3, 0); |
| 169 | path.close(); |
| 170 | testSimplify(path, true, out, bitmap); |
| 171 | drawAsciiPaths(path, out, true); |
| 172 | } |
caryclark@google.com | 78e1713 | 2012-04-17 11:40:34 +0000 | [diff] [blame] | 173 | </div> |
| 174 | |
caryclark@google.com | fa0588f | 2012-04-26 21:01:06 +0000 | [diff] [blame] | 175 | <div id="testSimplifyQuadratic13"> |
| 176 | SkPath path, out; |
caryclark@google.com | 78e1713 | 2012-04-17 11:40:34 +0000 | [diff] [blame] | 177 | path.moveTo(0, 0); |
| 178 | path.quadTo(0, 0, 1, 0); |
| 179 | path.lineTo(1, 1); |
| 180 | path.lineTo(0, 0); |
| 181 | path.close(); |
| 182 | path.moveTo(0, 0); |
| 183 | path.quadTo(3, 0, 1, 1); |
| 184 | path.lineTo(0, 0); |
| 185 | path.close(); |
caryclark@google.com | fa0588f | 2012-04-26 21:01:06 +0000 | [diff] [blame] | 186 | testSimplify(path, true, out, bitmap); |
| 187 | drawAsciiPaths(path, out, true); |
| 188 | } |
caryclark@google.com | 78e1713 | 2012-04-17 11:40:34 +0000 | [diff] [blame] | 189 | </div> |
| 190 | |
caryclark@google.com | fa0588f | 2012-04-26 21:01:06 +0000 | [diff] [blame] | 191 | <div id="testSimplifyQuadratic14"> |
| 192 | SkPath path, out; |
caryclark@google.com | 78e1713 | 2012-04-17 11:40:34 +0000 | [diff] [blame] | 193 | path.moveTo(0, 0); |
| 194 | path.quadTo(0, 0, 0, 0); |
| 195 | path.lineTo(1, 1); |
caryclark@google.com | 78e1713 | 2012-04-17 11:40:34 +0000 | [diff] [blame] | 196 | path.close(); |
| 197 | path.moveTo(0, 0); |
| 198 | path.lineTo(0, 0); |
| 199 | path.quadTo(0, 1, 2, 1); |
caryclark@google.com | 78e1713 | 2012-04-17 11:40:34 +0000 | [diff] [blame] | 200 | path.close(); |
caryclark@google.com | fa0588f | 2012-04-26 21:01:06 +0000 | [diff] [blame] | 201 | testSimplify(path, true, out, bitmap); |
| 202 | drawAsciiPaths(path, out, true); |
| 203 | } |
caryclark@google.com | 78e1713 | 2012-04-17 11:40:34 +0000 | [diff] [blame] | 204 | </div> |
| 205 | |
caryclark@google.com | fa0588f | 2012-04-26 21:01:06 +0000 | [diff] [blame] | 206 | <div id="testSimplifyQuadratic15"> |
| 207 | SkPath path, out; |
| 208 | path.moveTo(0, 0); |
| 209 | path.quadTo(0, 0, 1, 3); |
| 210 | path.lineTo(3, 3); |
| 211 | path.close(); |
| 212 | path.moveTo(0, 1); |
| 213 | path.lineTo(1, 1); |
| 214 | path.quadTo(0, 3, 3, 3); |
| 215 | path.close(); |
| 216 | testSimplify(path, true, out, bitmap); |
| 217 | drawAsciiPaths(path, out, true); |
| 218 | } |
| 219 | </div> |
| 220 | |
| 221 | <div id="testSimplifyQuadratic16"> |
| 222 | SkPath path, out; |
| 223 | path.moveTo(0, 0); |
| 224 | path.quadTo(0, 0, 0, 0); |
| 225 | path.lineTo(0, 1); |
| 226 | path.close(); |
| 227 | path.moveTo(0, 0); |
| 228 | path.lineTo(0, 0); |
| 229 | path.quadTo(1, 0, 0, 1); |
| 230 | path.close(); |
| 231 | testSimplify(path, true, out, bitmap); |
| 232 | drawAsciiPaths(path, out, true); |
| 233 | } |
| 234 | </div> |
| 235 | |
| 236 | <div id="testSimplifyQuadratic17"> |
| 237 | SkPath path, out; |
caryclark@google.com | b45a1b4 | 2012-05-18 20:50:33 +0000 | [diff] [blame] | 238 | path.moveTo(8, 8); |
| 239 | path.quadTo(10, 10, 8, -10); |
caryclark@google.com | fa0588f | 2012-04-26 21:01:06 +0000 | [diff] [blame] | 240 | path.close(); |
caryclark@google.com | b45a1b4 | 2012-05-18 20:50:33 +0000 | [diff] [blame] | 241 | path.moveTo(8, 8); |
| 242 | path.quadTo(12, 12, 14, 4); |
| 243 | path.close(); |
| 244 | path.moveTo(8, 8); |
| 245 | path.quadTo(9, 9, 10, 8); |
caryclark@google.com | fa0588f | 2012-04-26 21:01:06 +0000 | [diff] [blame] | 246 | path.close(); |
| 247 | testSimplify(path, true, out, bitmap); |
| 248 | drawAsciiPaths(path, out, true); |
| 249 | } |
caryclark@google.com | 78e1713 | 2012-04-17 11:40:34 +0000 | [diff] [blame] | 250 | </div> |
caryclark@google.com | fb17342 | 2012-04-10 18:28:55 +0000 | [diff] [blame] | 251 | |
caryclark@google.com | b45a1b4 | 2012-05-18 20:50:33 +0000 | [diff] [blame] | 252 | <div id="testSimplifyQuadratic18"> |
| 253 | SkPath path, out; |
| 254 | path.moveTo(8.0000000000000071, 8.0000000000000071); |
| 255 | path.quadTo(8.7289570079366854, 8.7289570079366889, 9.3914917259458743, 9.0593802763083691); |
| 256 | path.close(); |
| 257 | path.moveTo(8.0000000000000142, 8.0000000000000142); |
| 258 | path.quadTo(8.1250000000000107, 8.1250000000000071, 8.2500000000000071, 8.2187500000000053); |
| 259 | path.close(); |
| 260 | testSimplify(path, true, out, bitmap); |
| 261 | drawAsciiPaths(path, out, true); |
| 262 | </div> |
caryclark@google.com | 8dcf114 | 2012-07-02 20:27:02 +0000 | [diff] [blame] | 263 | |
| 264 | <div id="testSimplifyQuadratic19"> |
| 265 | SkPath path, simple; |
| 266 | path.moveTo(0,4); |
| 267 | path.lineTo(6,4); |
| 268 | path.lineTo(3,1); |
| 269 | path.close(); |
| 270 | path.moveTo(2,3); |
| 271 | path.lineTo(3,2); |
| 272 | path.lineTo(4,3); |
| 273 | path.close(); |
| 274 | testSimplifyx(path); |
| 275 | </div> |
| 276 | |
| 277 | <div id="testSimplifyQuadratic20"> |
| 278 | SkPath path, simple; |
| 279 | path.moveTo(0,4); |
| 280 | path.lineTo(6,4); |
| 281 | path.lineTo(3,1); |
| 282 | path.close(); |
| 283 | path.moveTo(2,3); |
| 284 | path.lineTo(4,3); |
| 285 | path.lineTo(3,2); |
| 286 | path.close(); |
| 287 | testSimplifyx(path); |
| 288 | </div> |
| 289 | |
| 290 | <div id="testSimplifyQuadratic21"> |
| 291 | SkPath path, simple; |
| 292 | path.moveTo(0,4); |
| 293 | path.lineTo(8,4); |
| 294 | path.lineTo(4,0); |
| 295 | path.close(); |
| 296 | path.moveTo(2,2); |
| 297 | path.lineTo(3,3); |
| 298 | path.lineTo(4,2); |
| 299 | path.close(); |
| 300 | testSimplifyx(path); |
| 301 | </div> |
| 302 | |
| 303 | <div id="testLine6"> |
| 304 | SkPath path, simple; |
| 305 | path.moveTo(0,0); |
| 306 | path.lineTo(4,0); |
| 307 | path.lineTo(2,2); |
| 308 | path.close(); |
| 309 | path.moveTo(2,0); |
| 310 | path.lineTo(6,0); |
| 311 | path.lineTo(4,2); |
| 312 | path.close(); |
| 313 | testSimplifyx(path); |
| 314 | </div> |
| 315 | |
caryclark@google.com | fa4a6e9 | 2012-07-11 17:52:32 +0000 | [diff] [blame] | 316 | <div id="testLine7"> |
| 317 | SkPath path, simple; |
| 318 | path.moveTo(0,0); |
| 319 | path.lineTo(4,0); |
| 320 | path.lineTo(2,2); |
| 321 | path.close(); |
| 322 | path.moveTo(6,0); |
| 323 | path.lineTo(2,0); |
| 324 | path.lineTo(4,2); |
| 325 | path.close(); |
| 326 | testSimplifyx(path); |
| 327 | </div> |
| 328 | |
caryclark@google.com | cc90505 | 2012-07-25 20:59:42 +0000 | [diff] [blame] | 329 | <div id="testLine7b"> |
| 330 | path.moveTo(0,0); |
| 331 | path.lineTo(4,0); |
| 332 | path.close(); |
| 333 | path.moveTo(6,0); |
| 334 | path.lineTo(2,0); |
| 335 | path.lineTo(4,2); |
| 336 | path.close(); |
| 337 | </div> |
| 338 | |
caryclark@google.com | fa4a6e9 | 2012-07-11 17:52:32 +0000 | [diff] [blame] | 339 | <div id="testLine9"> |
| 340 | SkPath path, simple; |
| 341 | path.moveTo(0,4); |
| 342 | path.lineTo(4,4); |
| 343 | path.lineTo(2,2); |
| 344 | path.close(); |
| 345 | path.moveTo(6,4); |
| 346 | path.lineTo(2,4); |
| 347 | path.lineTo(4,2); |
| 348 | path.close(); |
| 349 | testSimplifyx(path); |
| 350 | </div> |
| 351 | |
caryclark@google.com | e21cb18 | 2012-07-23 21:26:31 +0000 | [diff] [blame] | 352 | <div id="testLine12"> |
| 353 | path.moveTo(0,4); |
| 354 | path.lineTo(6,4); |
| 355 | path.lineTo(3,1); |
| 356 | path.close(); |
| 357 | path.moveTo(2,3); |
| 358 | path.lineTo(3,2); |
| 359 | path.lineTo(4,3); |
| 360 | path.close(); |
| 361 | </div> |
| 362 | |
| 363 | <div id="testLine13"> |
| 364 | path.moveTo(6,4); |
| 365 | path.lineTo(0,4); |
| 366 | path.lineTo(3,1); |
| 367 | path.close(); |
| 368 | path.moveTo(3,2); |
| 369 | path.lineTo(2,3); |
| 370 | path.lineTo(4,3); |
| 371 | path.close(); |
| 372 | </div> |
| 373 | |
caryclark@google.com | 8dcf114 | 2012-07-02 20:27:02 +0000 | [diff] [blame] | 374 | <div id="testLine17"> |
| 375 | SkPath path, simple; |
| 376 | path.addRect(0, 0, 12, 12, (SkPath::Direction) 0); |
| 377 | path.addRect(4, 12, 13, 13, (SkPath::Direction) 0); |
| 378 | testSimplifyx(path); |
| 379 | </div> |
| 380 | |
caryclark@google.com | 4758069 | 2012-07-23 12:14:49 +0000 | [diff] [blame] | 381 | <div id="testLine19"> |
| 382 | SkPath path, simple; |
| 383 | path.addRect(0, 0, 12, 12, (SkPath::Direction) 0); |
| 384 | path.addRect(12, 16, 21, 21, (SkPath::Direction) 0); |
| 385 | testSimplifyx(path); |
| 386 | </div> |
| 387 | |
caryclark@google.com | cc90505 | 2012-07-25 20:59:42 +0000 | [diff] [blame] | 388 | <div id="testLine22"> |
| 389 | path.addRect(0, 12, 12, 12, (SkPath::Direction) 0); |
| 390 | path.addRect(4, 12, 13, 13, (SkPath::Direction) 0); |
| 391 | </div> |
| 392 | |
caryclark@google.com | 4758069 | 2012-07-23 12:14:49 +0000 | [diff] [blame] | 393 | <div id="testLine24"> |
| 394 | path.addRect(0, 18, 12, 12, (SkPath::Direction) 0); |
| 395 | path.addRect(4, 12, 13, 13, (SkPath::Direction) 0); |
| 396 | </div> |
| 397 | |
caryclark@google.com | fa4a6e9 | 2012-07-11 17:52:32 +0000 | [diff] [blame] | 398 | <div id="testLine28"> |
| 399 | SkPath path, simple; |
| 400 | path.addRect(0, 6, 12, 12, (SkPath::Direction) 0); |
| 401 | path.addRect(0, 0, 9, 9, (SkPath::Direction) 0); |
| 402 | testSimplifyx(path); |
| 403 | </div> |
| 404 | |
| 405 | <div id="testLine29"> |
| 406 | SkPath path, simple; |
| 407 | path.addRect(0, 18, 12, 12, (SkPath::Direction) 0); |
| 408 | path.addRect(12, 12, 21, 21, (SkPath::Direction) 0); |
| 409 | testSimplifyx(path); |
| 410 | </div> |
| 411 | |
| 412 | <div id="testLine30"> |
| 413 | path.addRect(0, 0, 20, 20, (SkPath::Direction) 0); |
| 414 | path.addRect(0, 0, 12, 12, (SkPath::Direction) 0); |
| 415 | path.addRect(4, 4, 13, 13, (SkPath::Direction) 0); |
| 416 | </div> |
| 417 | |
| 418 | <div id="testLine31"> |
| 419 | path.addRect(0, 0, 20, 20, (SkPath::Direction) 0); |
| 420 | path.addRect(0, 0, 12, 12, (SkPath::Direction) 0); |
| 421 | path.addRect(0, 4, 9, 9, (SkPath::Direction) 0); |
| 422 | </div> |
| 423 | |
| 424 | <div id="testLine32"> |
| 425 | path.addRect(0, 0, 20, 20, (SkPath::Direction) 0); |
| 426 | path.addRect(0, 0, 12, 12, (SkPath::Direction) 0); |
| 427 | path.addRect(4, 12, 13, 13, (SkPath::Direction) 0); |
| 428 | </div> |
| 429 | |
caryclark@google.com | 9764cc6 | 2012-07-12 19:29:45 +0000 | [diff] [blame] | 430 | <div id="testLine33"> |
| 431 | path.addRect(0, 0, 20, 20, (SkPath::Direction) 0); |
| 432 | path.addRect(0, 0, 12, 12, (SkPath::Direction) 0); |
| 433 | path.addRect(4, 16, 13, 13, (SkPath::Direction) 0); |
| 434 | </div> |
| 435 | |
caryclark@google.com | 210acaf | 2012-07-12 21:05:13 +0000 | [diff] [blame] | 436 | <div id="testLine34"> |
| 437 | path.addRect(0, 0, 20, 20, (SkPath::Direction) 0); |
| 438 | path.addRect(0, 6, 12, 12, (SkPath::Direction) 0); |
| 439 | path.addRect(4, 12, 13, 13, (SkPath::Direction) 0); |
| 440 | </div> |
| 441 | |
| 442 | <div id="testLine35"> |
| 443 | path.addRect(0, 0, 20, 20, (SkPath::Direction) 0); |
| 444 | path.addRect(6, 0, 18, 18, (SkPath::Direction) 0); |
| 445 | path.addRect(4, 16, 13, 13, (SkPath::Direction) 0); |
| 446 | </div> |
| 447 | |
caryclark@google.com | 0e08a19 | 2012-07-13 21:07:52 +0000 | [diff] [blame] | 448 | <div id="testLine36"> |
| 449 | path.addRect(0, 10, 20, 20, (SkPath::Direction) 0); |
| 450 | path.addRect(6, 12, 18, 18, (SkPath::Direction) 0); |
| 451 | path.addRect(4, 16, 13, 13, (SkPath::Direction) 0); |
| 452 | </div> |
| 453 | |
caryclark@google.com | 4758069 | 2012-07-23 12:14:49 +0000 | [diff] [blame] | 454 | <div id="testLine37"> |
| 455 | path.addRect(0, 20, 20, 20, (SkPath::Direction) 0); |
| 456 | path.addRect(18, 24, 30, 30, (SkPath::Direction) 0); |
| 457 | path.addRect(0, 0, 9, 9, (SkPath::Direction) 0); |
| 458 | </div> |
| 459 | |
| 460 | <div id="testLine38"> |
| 461 | path.addRect(10, 0, 30, 30, (SkPath::Direction) 0); |
| 462 | path.addRect(6, 12, 18, 18, (SkPath::Direction) 0); |
| 463 | path.addRect(12, 12, 21, 21, (SkPath::Direction) 0); |
| 464 | </div> |
| 465 | |
| 466 | <div id="testLine39"> |
| 467 | path.addRect(10, 0, 30, 30, (SkPath::Direction) 0); |
| 468 | path.addRect(12, 6, 24, 24, (SkPath::Direction) 0); |
| 469 | path.addRect(12, 4, 21, 21, (SkPath::Direction) 0); |
| 470 | </div> |
| 471 | |
| 472 | <div id="testLine40"> |
| 473 | path.addRect(10, 0, 30, 30, (SkPath::Direction) 0); |
| 474 | path.addRect(12, 18, 24, 24, (SkPath::Direction) 0); |
| 475 | path.addRect(4, 16, 13, 13, (SkPath::Direction) 0); |
| 476 | </div> |
| 477 | |
| 478 | <div id="testLine41"> |
| 479 | path.addRect(0, 0, 20, 20, (SkPath::Direction) 0); |
| 480 | path.addRect(18, 24, 30, 30, (SkPath::Direction) 0); |
| 481 | path.addRect(12, 0, 21, 21, (SkPath::Direction) 0); |
| 482 | </div> |
| 483 | |
| 484 | <div id="testLine42"> |
| 485 | path.addRect(0, 0, 20, 20, (SkPath::Direction) 0); |
| 486 | path.addRect(0, 0, 12, 12, (SkPath::Direction) 0); |
| 487 | path.addRect(8, 16, 17, 17, (SkPath::Direction) 0); |
| 488 | </div> |
| 489 | |
| 490 | <div id="testLine43"> |
| 491 | path.addRect(0, 0, 20, 20, (SkPath::Direction) 0); |
| 492 | path.addRect(6, 24, 18, 18, (SkPath::Direction) 0); |
| 493 | path.addRect(0, 32, 9, 36, (SkPath::Direction) 1); |
| 494 | </div> |
| 495 | |
| 496 | <div id="testLine44"> |
| 497 | path.addRect(10, 40, 30, 30, (SkPath::Direction) 0); |
| 498 | path.addRect(18, 0, 30, 30, (SkPath::Direction) 0); |
| 499 | path.addRect(18, 32, 27, 36, (SkPath::Direction) 1); |
| 500 | </div> |
| 501 | |
| 502 | <div id="testLine45"> |
| 503 | path.addRect(10, 0, 30, 30, (SkPath::Direction) 0); |
| 504 | path.addRect(18, 0, 30, 30, (SkPath::Direction) 0); |
| 505 | path.addRect(24, 32, 33, 36, (SkPath::Direction) 0); |
| 506 | </div> |
| 507 | |
| 508 | <div id="testLine46"> |
| 509 | path.addRect(10, 40, 30, 30, (SkPath::Direction) 0); |
| 510 | path.addRect(24, 0, 36, 36, (SkPath::Direction) 0); |
| 511 | path.addRect(24, 32, 33, 36, (SkPath::Direction) 0); |
| 512 | </div> |
| 513 | |
| 514 | <div id="testLine47"> |
| 515 | path.addRect(0, 0, 20, 20, (SkPath::Direction) 0); |
| 516 | path.addRect(0, 0, 12, 12, (SkPath::Direction) 0); |
| 517 | path.addRect(0, 0, 9, 9, (SkPath::Direction) 1); |
| 518 | </div> |
| 519 | |
| 520 | <div id="testLine48"> |
| 521 | path.addRect(0, 0, 20, 20, (SkPath::Direction) 0); |
| 522 | path.addRect(0, 6, 12, 12, (SkPath::Direction) 0); |
| 523 | path.addRect(0, 0, 9, 9, (SkPath::Direction) 1); |
| 524 | </div> |
| 525 | |
| 526 | <div id="testLine49"> |
| 527 | path.addRect(0, 0, 20, 20, (SkPath::Direction) 0); |
| 528 | path.addRect(0, 0, 12, 12, (SkPath::Direction) 0); |
| 529 | path.addRect(0, 0, 9, 9, (SkPath::Direction) 0); |
| 530 | </div> |
| 531 | |
| 532 | <div id="testLine50"> |
| 533 | path.addRect(10, 30, 30, 30, (SkPath::Direction) 0); |
| 534 | path.addRect(24, 20, 36, 30, (SkPath::Direction) 0); |
| 535 | </div> |
| 536 | |
| 537 | <div id="testLine51"> |
| 538 | path.addRect(0, 0, 20, 20, (SkPath::Direction) 0); |
| 539 | path.addRect(0, 12, 12, 12, (SkPath::Direction) 0); |
| 540 | path.addRect(4, 12, 13, 13, (SkPath::Direction) 1); |
| 541 | </div> |
| 542 | |
caryclark@google.com | e21cb18 | 2012-07-23 21:26:31 +0000 | [diff] [blame] | 543 | <div id="testLine52"> |
| 544 | path.addRect(0, 30, 20, 20, (SkPath::Direction) 0); |
| 545 | path.addRect(6, 20, 18, 30, (SkPath::Direction) 0); |
| 546 | path.addRect(32, 0, 36, 41, (SkPath::Direction) 0); |
| 547 | </div> |
| 548 | |
| 549 | <div id="testLine53"> |
| 550 | path.addRect(10, 30, 30, 30, (SkPath::Direction) 0); |
| 551 | path.addRect(12, 20, 24, 30, (SkPath::Direction) 0); |
| 552 | path.addRect(12, 32, 21, 36, (SkPath::Direction) 1); |
| 553 | </div> |
| 554 | |
| 555 | <div id="testLine54"> |
| 556 | path.addRect(0, 0, 20, 20, (SkPath::Direction) 0); |
| 557 | path.addRect(6, 0, 18, 18, (SkPath::Direction) 0); |
| 558 | path.addRect(8, 4, 17, 17, (SkPath::Direction) 1); |
| 559 | </div> |
| 560 | |
| 561 | <div id="testLine55"> |
| 562 | path.addRect(0, 0, 20, 20, (SkPath::Direction) 0); |
| 563 | path.addRect(6, 6, 18, 18, (SkPath::Direction) 0); |
| 564 | path.addRect(4, 4, 13, 13, (SkPath::Direction) 1); |
| 565 | </div> |
| 566 | |
caryclark@google.com | 1806344 | 2012-07-25 12:05:18 +0000 | [diff] [blame] | 567 | <div id="testLine56"> |
| 568 | path.addRect(0, 20, 20, 20, (SkPath::Direction) 0); |
| 569 | path.addRect(18, 20, 30, 30, (SkPath::Direction) 0); |
| 570 | path.addRect(12, 0, 21, 21, (SkPath::Direction) 1); |
| 571 | </div> |
| 572 | |
| 573 | <div id="testLine57"> |
| 574 | path.addRect(20, 0, 40, 40, (SkPath::Direction) 0); |
| 575 | path.addRect(20, 0, 30, 40, (SkPath::Direction) 0); |
| 576 | path.addRect(12, 0, 21, 21, (SkPath::Direction) 1); |
| 577 | </div> |
| 578 | |
caryclark@google.com | cc90505 | 2012-07-25 20:59:42 +0000 | [diff] [blame] | 579 | <div id="testLine58"> |
| 580 | path.addRect(0, 0, 20, 20, (SkPath::Direction) 0); |
| 581 | path.addRect(0, 0, 12, 12, (SkPath::Direction) 1); |
| 582 | path.addRect(0, 12, 9, 9, (SkPath::Direction) 1); |
| 583 | </div> |
| 584 | |
| 585 | <div id="testLine59"> |
| 586 | path.addRect(0, 0, 20, 20, (SkPath::Direction) 0); |
| 587 | path.addRect(6, 6, 18, 18, (SkPath::Direction) 1); |
| 588 | path.addRect(4, 4, 13, 13, (SkPath::Direction) 1); |
| 589 | </div> |
| 590 | |
caryclark@google.com | 27c449a | 2012-07-27 18:26:38 +0000 | [diff] [blame] | 591 | <div id="testLine60"> |
| 592 | path.addRect(0, 0, 20, 20, (SkPath::Direction) 0); |
| 593 | path.addRect(6, 12, 18, 18, (SkPath::Direction) 1); |
| 594 | path.addRect(4, 12, 13, 13, (SkPath::Direction) 1); |
| 595 | </div> |
| 596 | |
| 597 | <div id="testLine61"> |
| 598 | path.addRect(0, 0, 20, 20, (SkPath::Direction) 0); |
| 599 | path.addRect(12, 0, 24, 24, (SkPath::Direction) 1); |
| 600 | path.addRect(12, 0, 21, 21, (SkPath::Direction) 1); |
| 601 | </div> |
| 602 | |
| 603 | <div id="testLine62"> |
| 604 | path.addRect(0, 0, 60, 60, (SkPath::Direction) 0); |
| 605 | path.addRect(0, 0, 20, 20, (SkPath::Direction) 0); |
| 606 | path.addRect(0, 12, 12, 12, (SkPath::Direction) 0); |
| 607 | path.addRect(4, 12, 13, 13, (SkPath::Direction) 1); |
| 608 | </div> |
| 609 | |
| 610 | <div id="testLine63"> |
| 611 | path.addRect(0, 0, 60, 60, (SkPath::Direction) 0); |
| 612 | path.addRect(0, 10, 20, 20, (SkPath::Direction) 0); |
| 613 | path.addRect(0, 6, 12, 12, (SkPath::Direction) 1); |
| 614 | path.addRect(0, 32, 9, 36, (SkPath::Direction) 1); |
| 615 | </div> |
| 616 | |
| 617 | <div id="testLine64"> |
| 618 | path.addRect(0, 0, 60, 60, (SkPath::Direction) 0); |
| 619 | path.addRect(10, 40, 30, 30, (SkPath::Direction) 0); |
| 620 | path.addRect(18, 6, 30, 30, (SkPath::Direction) 0); |
| 621 | </div> |
| 622 | |
| 623 | <div id="testLine65"> |
| 624 | path.addRect(0, 0, 60, 60, (SkPath::Direction) 0); |
| 625 | path.addRect(10, 0, 30, 30, (SkPath::Direction) 0); |
| 626 | path.addRect(24, 0, 36, 36, (SkPath::Direction) 0); |
| 627 | path.addRect(32, 6, 36, 41, (SkPath::Direction) 1); |
| 628 | </div> |
| 629 | |
| 630 | <div id="testLine66"> |
| 631 | path.addRect(0, 0, 60, 60, (SkPath::Direction) 0); |
| 632 | path.addRect(0, 30, 20, 20, (SkPath::Direction) 0); |
| 633 | path.addRect(12, 20, 24, 30, (SkPath::Direction) 0); |
| 634 | </div> |
| 635 | |
caryclark@google.com | 534aa5b | 2012-08-02 20:08:21 +0000 | [diff] [blame] | 636 | <div id="testLine67"> |
| 637 | path.addRect(0, 0, 60, 60, (SkPath::Direction) 0); |
| 638 | path.addRect(10, 40, 30, 30, (SkPath::Direction) 0); |
| 639 | path.addRect(24, 20, 36, 30, (SkPath::Direction) 0); |
| 640 | path.addRect(32, 0, 36, 41, (SkPath::Direction) 0); |
| 641 | </div> |
| 642 | |
| 643 | <div id="testLine68a"> |
| 644 | path.addRect(0, 0, 8, 8, (SkPath::Direction) 0); |
| 645 | path.addRect(2, 2, 6, 6, (SkPath::Direction) 0); |
| 646 | path.addRect(1, 2, 4, 2, (SkPath::Direction) 0); |
| 647 | </div> |
| 648 | |
| 649 | <div id="testLine68b"> |
| 650 | path.addRect(0, 0, 8, 8, (SkPath::Direction) 0); |
| 651 | path.addRect(2, 2, 6, 6, (SkPath::Direction) 1); |
| 652 | path.addRect(1, 2, 4, 2, (SkPath::Direction) 0); |
| 653 | </div> |
| 654 | |
| 655 | <div id="testLine68c"> |
| 656 | path.addRect(0, 0, 8, 8, (SkPath::Direction) 1); |
| 657 | path.addRect(2, 2, 6, 6, (SkPath::Direction) 0); |
| 658 | path.addRect(1, 2, 4, 2, (SkPath::Direction) 0); |
| 659 | </div> |
| 660 | |
| 661 | <div id="testLine68d"> |
| 662 | path.addRect(0, 0, 8, 8, (SkPath::Direction) 1); |
| 663 | path.addRect(2, 2, 6, 6, (SkPath::Direction) 1); |
| 664 | path.addRect(1, 2, 4, 2, (SkPath::Direction) 0); |
| 665 | </div> |
| 666 | |
| 667 | <div id="testLine68e"> |
| 668 | path.addRect(0, 0, 8, 8, (SkPath::Direction) 0); |
| 669 | path.addRect(0, 0, 8, 8, (SkPath::Direction) 0); |
| 670 | path.addRect(2, 2, 6, 6, (SkPath::Direction) 1); |
| 671 | path.addRect(1, 2, 2, 2, (SkPath::Direction) 0); |
| 672 | </div> |
| 673 | |
| 674 | <div id="testLine68f"> |
| 675 | path.addRect(0, 0, 8, 8, (SkPath::Direction) 0); |
| 676 | path.addRect(2, 2, 6, 6, (SkPath::Direction) 1); |
| 677 | path.addRect(2, 2, 6, 6, (SkPath::Direction) 1); |
| 678 | path.addRect(1, 2, 2, 2, (SkPath::Direction) 0); |
| 679 | </div> |
| 680 | |
| 681 | <div id="testLine69"> |
| 682 | path.addRect(0, 20, 20, 20, (SkPath::Direction) 0); |
| 683 | path.addRect(0, 20, 12, 30, (SkPath::Direction) 0); |
| 684 | path.addRect(12, 32, 21, 36, (SkPath::Direction) 0); |
| 685 | </div> |
| 686 | |
| 687 | <div id="testLine70"> |
| 688 | path.addRect(0, 0, 20, 20, (SkPath::Direction) 0); |
| 689 | path.addRect(0, 24, 12, 12, (SkPath::Direction) 0); |
| 690 | path.addRect(12, 32, 21, 36, (SkPath::Direction) 1); |
| 691 | </div> |
| 692 | |
| 693 | <div id="testLine71"> |
| 694 | path.addRect(0, 0, 20, 20, (SkPath::Direction) 0); |
| 695 | path.addRect(12, 0, 24, 24, (SkPath::Direction) 0); |
| 696 | path.addRect(12, 32, 21, 36, (SkPath::Direction) 0); |
| 697 | </div> |
| 698 | |
caryclark@google.com | 200c211 | 2012-08-03 15:05:04 +0000 | [diff] [blame] | 699 | <div id="testLine72"> |
| 700 | path.addRect(0, 0, 60, 60, (SkPath::Direction) 0); |
| 701 | path.addRect(10, 40, 30, 30, (SkPath::Direction) 0); |
| 702 | path.addRect(6, 20, 18, 30, (SkPath::Direction) 0); |
| 703 | </div> |
| 704 | |
| 705 | <div id="testLine73"> |
| 706 | path.addRect(0, 0, 60, 60, (SkPath::Direction) 0); |
| 707 | path.addRect(0, 40, 20, 20, (SkPath::Direction) 0); |
| 708 | path.addRect(0, 20, 12, 30, (SkPath::Direction) 0); |
| 709 | path.addRect(0, 0, 9, 9, (SkPath::Direction) 1); |
| 710 | </div> |
| 711 | |
caryclark@google.com | 0c803d0 | 2012-08-06 11:15:47 +0000 | [diff] [blame] | 712 | <div id="testLine74"> |
| 713 | path.addRect(20, 30, 40, 40, (SkPath::Direction) 0); |
| 714 | path.addRect(24, 20, 36, 30, (SkPath::Direction) 1); |
| 715 | path.addRect(32, 24, 36, 41, (SkPath::Direction) 1); |
| 716 | </div> |
| 717 | |
caryclark@google.com | 2ddff93 | 2012-08-07 21:25:27 +0000 | [diff] [blame] | 718 | <div id="testLine75"> |
| 719 | path.addRect(0, 0, 60, 60, (SkPath::Direction) 0); |
| 720 | path.addRect(10, 0, 30, 30, (SkPath::Direction) 1); |
| 721 | path.addRect(18, 0, 30, 30, (SkPath::Direction) 1); |
| 722 | path.addRect(12, 0, 21, 21, (SkPath::Direction) 1); |
| 723 | </div> |
| 724 | |
| 725 | <div id="testLine76"> |
| 726 | path.addRect(36, 0, 66, 60, (SkPath::Direction) 0); |
| 727 | path.addRect(10, 20, 40, 30, (SkPath::Direction) 0); |
| 728 | path.addRect(24, 20, 36, 30, (SkPath::Direction) 1); |
| 729 | path.addRect(32, 6, 36, 41, (SkPath::Direction) 1); |
| 730 | </div> |
| 731 | |
| 732 | <div id="testLine77"> |
| 733 | path.addRect(20, 0, 40, 40, (SkPath::Direction) 0); |
| 734 | path.addRect(24, 6, 36, 36, (SkPath::Direction) 1); |
| 735 | path.addRect(24, 32, 33, 36, (SkPath::Direction) 1); |
| 736 | </div> |
| 737 | |
| 738 | <div id="testLine78"> |
| 739 | path.addRect(0, 0, 30, 60, (SkPath::Direction) 0); |
| 740 | path.addRect(10, 20, 30, 30, (SkPath::Direction) 1); |
| 741 | path.addRect(18, 20, 30, 30, (SkPath::Direction) 1); |
| 742 | path.addRect(32, 0, 36, 41, (SkPath::Direction) 1); |
| 743 | </div> |
| 744 | |
| 745 | <div id="testLine79"> |
| 746 | path.addRect(0, 36, 60, 30, (SkPath::Direction) 0); |
| 747 | path.addRect(10, 30, 40, 30, (SkPath::Direction) 0); |
| 748 | path.addRect(0, 20, 12, 30, (SkPath::Direction) 1); |
| 749 | path.addRect(0, 32, 9, 36, (SkPath::Direction) 1); |
| 750 | </div> |
| 751 | |
caryclark@google.com | 59823f7 | 2012-08-09 18:17:47 +0000 | [diff] [blame] | 752 | <div id="testDegenerate1"> |
| 753 | path.moveTo(0, 0); |
| 754 | path.lineTo(0, 0); |
| 755 | path.lineTo(2, 0); |
| 756 | path.close(); |
| 757 | path.moveTo(0, 0); |
| 758 | path.lineTo(1, 0); |
| 759 | path.lineTo(2, 0); |
| 760 | path.close(); |
| 761 | </div> |
| 762 | |
| 763 | <div id="testDegenerate2"> |
| 764 | path.moveTo(0, 0); |
| 765 | path.lineTo(0, 0); |
| 766 | path.lineTo(0, 0); |
| 767 | path.close(); |
| 768 | path.moveTo(0, 0); |
| 769 | path.lineTo(1, 0); |
| 770 | path.lineTo(0, 1); |
| 771 | path.close(); |
| 772 | </div> |
| 773 | |
| 774 | <div id="testDegenerate3"> |
| 775 | path.moveTo(0, 0); |
| 776 | path.lineTo(2, 0); |
| 777 | path.lineTo(1, 0); |
| 778 | path.close(); |
| 779 | path.moveTo(0, 0); |
| 780 | path.lineTo(0, 0); |
| 781 | path.lineTo(3, 0); |
| 782 | path.close(); |
| 783 | </div> |
| 784 | |
| 785 | <div id="testDegenerate4"> |
| 786 | path.moveTo(0, 0); |
| 787 | path.lineTo(1, 0); |
| 788 | path.lineTo(1, 3); |
| 789 | path.close(); |
| 790 | path.moveTo(1, 0); |
| 791 | path.lineTo(1, 1); |
| 792 | path.lineTo(1, 2); |
| 793 | path.close(); |
| 794 | </div> |
| 795 | |
| 796 | <div id="testNondegenerate1"> |
| 797 | path.moveTo(0, 0); |
| 798 | path.lineTo(3, 0); |
| 799 | path.lineTo(1, 3); |
| 800 | path.close(); |
| 801 | path.moveTo(1, 1); |
| 802 | path.lineTo(2, 1); |
| 803 | path.lineTo(1, 2); |
| 804 | path.close(); |
| 805 | </div> |
| 806 | |
| 807 | <div id="testNondegenerate2"> |
| 808 | path.moveTo(1, 0); |
| 809 | path.lineTo(0, 1); |
| 810 | path.lineTo(1, 1); |
| 811 | path.close(); |
| 812 | path.moveTo(0, 2); |
| 813 | path.lineTo(0, 3); |
| 814 | path.lineTo(1, 2); |
| 815 | path.close(); |
| 816 | </div> |
| 817 | |
| 818 | <div id="testNondegenerate3"> |
| 819 | path.moveTo(0, 0); |
| 820 | path.lineTo(1, 0); |
| 821 | path.lineTo(2, 1); |
| 822 | path.close(); |
| 823 | path.moveTo(0, 1); |
| 824 | path.lineTo(1, 1); |
| 825 | path.lineTo(0, 2); |
| 826 | path.close(); |
| 827 | </div> |
| 828 | |
| 829 | <div id="testNondegenerate4"> |
| 830 | path.moveTo(1, 0); |
| 831 | path.lineTo(0, 1); |
| 832 | path.lineTo(1, 2); |
| 833 | path.close(); |
| 834 | path.moveTo(0, 2); |
| 835 | path.lineTo(0, 3); |
| 836 | path.lineTo(1, 3); |
| 837 | path.close(); |
| 838 | </div> |
| 839 | |
| 840 | <div id="testQuadralateral5"> |
| 841 | path.moveTo(0, 0); |
| 842 | path.lineTo(0, 0); |
| 843 | path.lineTo(1, 0); |
| 844 | path.lineTo(1, 1); |
| 845 | path.close(); |
| 846 | path.moveTo(0, 0); |
| 847 | path.lineTo(2, 2); |
| 848 | path.lineTo(3, 2); |
| 849 | path.lineTo(3, 3); |
| 850 | path.close(); |
| 851 | </div> |
| 852 | |
| 853 | <div id="testQuadralateral6"> |
| 854 | path.moveTo(0, 0); |
| 855 | path.lineTo(0, 0); |
| 856 | path.lineTo(1, 0); |
| 857 | path.lineTo(1, 1); |
| 858 | path.close(); |
| 859 | path.moveTo(1, 0); |
| 860 | path.lineTo(2, 0); |
| 861 | path.lineTo(0, 2); |
| 862 | path.lineTo(2, 2); |
| 863 | path.close(); |
| 864 | </div> |
| 865 | |
caryclark@google.com | 24bec79 | 2012-08-20 12:43:57 +0000 | [diff] [blame] | 866 | <div id="testFauxQuadralateral6"> |
| 867 | path.moveTo(0, 0); |
| 868 | path.lineTo(1, 0); |
| 869 | path.lineTo(1, 1); |
| 870 | path.close(); |
| 871 | path.moveTo(1, 0); |
| 872 | path.lineTo(2, 0); |
| 873 | path.lineTo(1.333, 0.667); |
| 874 | path.close(); |
| 875 | path.moveTo(1.333, 0.667); |
| 876 | path.lineTo(0, 2); |
| 877 | path.lineTo(2, 2); |
| 878 | path.close(); |
| 879 | </div> |
| 880 | |
| 881 | <div id="testFauxQuadralateral6a"> |
| 882 | path.moveTo(0, 0); |
| 883 | path.lineTo(3, 0); |
| 884 | path.lineTo(3, 3); |
| 885 | path.close(); |
| 886 | path.moveTo(3, 0); |
| 887 | path.lineTo(6, 0); |
| 888 | path.lineTo(4, 2); |
| 889 | path.close(); |
| 890 | path.moveTo(4, 2); |
| 891 | path.lineTo(0, 6); |
| 892 | path.lineTo(6, 6); |
| 893 | path.close(); |
| 894 | </div> |
| 895 | |
| 896 | <div id="testFauxQuadralateral6b"> |
| 897 | path.moveTo(0, 0); |
| 898 | path.lineTo(3, 0); |
| 899 | path.lineTo(3, 3); |
| 900 | path.close(); |
| 901 | path.moveTo(3, 0); |
| 902 | path.lineTo(6, 0); |
| 903 | path.lineTo(4, 2); |
| 904 | path.close(); |
| 905 | path.moveTo(4, 2); |
| 906 | path.lineTo(6, 6); |
| 907 | path.lineTo(0, 6); |
| 908 | path.close(); |
| 909 | </div> |
| 910 | |
| 911 | <div id="testFauxQuadralateral6c"> |
| 912 | path.moveTo(0, 0); |
| 913 | path.lineTo(3, 3); |
| 914 | path.lineTo(3, 0); |
| 915 | path.close(); |
| 916 | path.moveTo(3, 0); |
| 917 | path.lineTo(6, 0); |
| 918 | path.lineTo(4, 2); |
| 919 | path.close(); |
| 920 | path.moveTo(4, 2); |
| 921 | path.lineTo(0, 6); |
| 922 | path.lineTo(6, 6); |
| 923 | path.close(); |
| 924 | </div> |
| 925 | |
| 926 | <div id="testFauxQuadralateral6d"> |
| 927 | path.moveTo(0, 0); |
| 928 | path.lineTo(3, 3); |
| 929 | path.lineTo(3, 0); |
| 930 | path.close(); |
| 931 | path.moveTo(3, 0); |
| 932 | path.lineTo(6, 0); |
| 933 | path.lineTo(4, 2); |
| 934 | path.close(); |
| 935 | path.moveTo(4, 2); |
| 936 | path.lineTo(6, 6); |
| 937 | path.lineTo(0, 6); |
| 938 | </div> |
| 939 | |
| 940 | <div id="testQuadralateral6a"> |
| 941 | path.moveTo(0, 0); |
| 942 | path.lineTo(0, 0); |
| 943 | path.lineTo(3, 0); |
| 944 | path.lineTo(3, 3); |
| 945 | path.close(); |
| 946 | path.moveTo(3, 0); |
| 947 | path.lineTo(6, 0); |
| 948 | path.lineTo(0, 6); |
| 949 | path.lineTo(6, 6); |
| 950 | </div> |
| 951 | |
| 952 | <div id="testQuadralateral7"> |
| 953 | path.moveTo(0, 0); |
| 954 | path.lineTo(0, 0); |
| 955 | path.lineTo(1, 0); |
| 956 | path.lineTo(2, 1); |
| 957 | path.close(); |
| 958 | path.moveTo(1, 0); |
| 959 | path.lineTo(1, 1); |
| 960 | path.lineTo(2, 2); |
| 961 | path.lineTo(1, 3); |
| 962 | path.close(); |
| 963 | </div> |
| 964 | |
| 965 | <div id="testQuadralateral8"> |
| 966 | path.moveTo(0, 0); |
| 967 | path.lineTo(3, 1); |
| 968 | path.lineTo(1, 3); |
| 969 | path.lineTo(3, 3); |
| 970 | path.close(); |
| 971 | path.moveTo(2, 1); |
| 972 | path.lineTo(0, 2); |
| 973 | path.lineTo(3, 2); |
| 974 | path.lineTo(2, 3); |
| 975 | path.close(); |
| 976 | </div> |
| 977 | |
| 978 | <div id="testQuadralateral9"> |
| 979 | path.moveTo(0, 0); |
| 980 | path.lineTo(1, 0); |
| 981 | path.lineTo(1, 2); |
| 982 | path.lineTo(2, 2); |
| 983 | path.close(); |
| 984 | path.moveTo(1, 1); |
| 985 | path.lineTo(2, 1); |
| 986 | path.lineTo(1, 3); |
| 987 | path.lineTo(2, 3); |
| 988 | path.close(); |
| 989 | </div> |
| 990 | |
| 991 | <div id="testLine1x"> |
| 992 | path.setFillType(SkPath::kEvenOdd_FillType); |
| 993 | path.addRect(0, 0, 12, 12, (SkPath::Direction) 0); |
| 994 | path.addRect(4, 0, 13, 13, (SkPath::Direction) 0); |
| 995 | </div> |
| 996 | |
| 997 | <div id="testLine2x"> |
| 998 | path.setFillType(SkPath::kEvenOdd_FillType); |
| 999 | path.addRect(0, 20, 20, 20, (SkPath::Direction) 0); |
| 1000 | path.addRect(0, 20, 12, 30, (SkPath::Direction) 0); |
| 1001 | path.addRect(12, 0, 21, 21, (SkPath::Direction) 1); |
| 1002 | </div> |
| 1003 | |
| 1004 | <div id="testLine3x"> |
| 1005 | path.setFillType(SkPath::kEvenOdd_FillType); |
| 1006 | path.addRect(10, 30, 30, 30, (SkPath::Direction) 0); |
| 1007 | path.addRect(18, 20, 30, 30, (SkPath::Direction) 1); |
| 1008 | path.addRect(0, 32, 9, 36, (SkPath::Direction) 1); |
| 1009 | </div> |
| 1010 | |
| 1011 | <div id="testLine4x"> |
| 1012 | path.setFillType(SkPath::kEvenOdd_FillType); |
| 1013 | path.addRect(10, 30, 30, 30, (SkPath::Direction) 0); |
| 1014 | path.addRect(24, 20, 36, 30, (SkPath::Direction) 1); |
| 1015 | path.addRect(0, 32, 9, 36, (SkPath::Direction) 1); |
| 1016 | </div> |
| 1017 | |
| 1018 | <div id="testQuadratic1"> |
| 1019 | path.moveTo(0, 0); |
| 1020 | path.quadTo(0, 0, 0, 0); |
| 1021 | path.lineTo(1, 0); |
| 1022 | path.close(); |
| 1023 | path.moveTo(0, 0); |
| 1024 | path.lineTo(0, 0); |
| 1025 | path.quadTo(0, 0, 0, 0); |
| 1026 | path.close(); |
| 1027 | </div> |
| 1028 | |
| 1029 | <div id="testQuadratic2"> |
| 1030 | path.moveTo(0, 0); |
| 1031 | path.quadTo(0, 0, 0, 0); |
| 1032 | path.lineTo(3, 0); |
| 1033 | path.close(); |
| 1034 | path.moveTo(0, 0); |
| 1035 | path.lineTo(0, 0); |
| 1036 | path.quadTo(1, 0, 0, 1); |
| 1037 | path.close(); |
| 1038 | </div> |
| 1039 | |
caryclark@google.com | 03f9706 | 2012-08-21 13:13:52 +0000 | [diff] [blame] | 1040 | <div id="testQuadratic3"> |
| 1041 | path.moveTo(0, 0); |
| 1042 | path.quadTo(0, 0, 1, 0); |
| 1043 | path.lineTo(0, 2); |
| 1044 | path.close(); |
| 1045 | path.moveTo(0, 0); |
| 1046 | path.lineTo(0, 0); |
| 1047 | path.quadTo(1, 0, 0, 1); |
| 1048 | path.close(); |
| 1049 | </div> |
| 1050 | |
caryclark@google.com | c899ad9 | 2012-08-23 15:24:42 +0000 | [diff] [blame] | 1051 | <div id="testQuadratic4x"> |
| 1052 | path.setFillType(SkPath::kEvenOdd_FillType); |
| 1053 | path.moveTo(0, 0); |
| 1054 | path.quadTo(0, 0, 1, 0); |
| 1055 | path.lineTo(0, 2); |
| 1056 | path.close(); |
| 1057 | path.moveTo(0, 0); |
| 1058 | path.lineTo(0, 0); |
| 1059 | path.quadTo(1, 0, 0, 2); |
| 1060 | path.close(); |
| 1061 | </div> |
| 1062 | |
| 1063 | <div id="testQuadratic5"> |
| 1064 | path.moveTo(0, 0); |
| 1065 | path.quadTo(0, 0, 0, 0); |
| 1066 | path.lineTo(0, 1); |
| 1067 | path.close(); |
| 1068 | path.moveTo(0, 0); |
| 1069 | path.lineTo(1, 0); |
| 1070 | path.quadTo(0, 1, 0, 2); |
| 1071 | path.close(); |
| 1072 | </div> |
| 1073 | |
| 1074 | <div id="testQuadratic6"> |
| 1075 | path.moveTo(0, 0); |
| 1076 | path.quadTo(0, 0, 1, 0); |
| 1077 | path.lineTo(2, 1); |
| 1078 | path.close(); |
| 1079 | path.moveTo(0, 0); |
| 1080 | path.lineTo(0, 0); |
| 1081 | path.quadTo(2, 0, 0, 1); |
| 1082 | path.close(); |
| 1083 | </div> |
| 1084 | |
| 1085 | <div id="testQuadratic7"> |
| 1086 | path.moveTo(0, 0); |
| 1087 | path.quadTo(0, 0, 1, 0); |
| 1088 | path.lineTo(3, 1); |
| 1089 | path.close(); |
| 1090 | path.moveTo(0, 0); |
| 1091 | path.lineTo(0, 0); |
| 1092 | path.quadTo(3, 0, 1, 2); |
| 1093 | path.close(); |
| 1094 | </div> |
| 1095 | |
| 1096 | <div id="testQuadratic8"> |
| 1097 | path.moveTo(0, 0); |
| 1098 | path.quadTo(0, 0, 1, 0); |
| 1099 | path.lineTo(0, 2); |
| 1100 | path.close(); |
| 1101 | path.moveTo(0, 0); |
| 1102 | path.lineTo(1, 0); |
| 1103 | path.quadTo(0, 1, 1, 2); |
| 1104 | path.close(); |
| 1105 | </div> |
| 1106 | |
| 1107 | <div id="testQuadratic9"> |
| 1108 | path.moveTo(0, 0); |
| 1109 | path.quadTo(0, 0, 1, 0); |
| 1110 | path.lineTo(3, 1); |
| 1111 | path.close(); |
| 1112 | path.moveTo(0, 0); |
| 1113 | path.lineTo(1, 0); |
| 1114 | path.quadTo(1, 2, 3, 2); |
| 1115 | path.close(); |
| 1116 | </div> |
| 1117 | |
| 1118 | <div id="testQuadratic9a"> |
| 1119 | path.moveTo(1.08000004, 0.720000029); |
| 1120 | path.lineTo(0, 0); |
| 1121 | path.lineTo(1, 0); |
| 1122 | path.lineTo(3, 1); |
| 1123 | path.lineTo(1.01568651, 0.338562161); |
| 1124 | path.quadTo(1.03542483, 0.541699469, 1.08000004, 0.720000029); |
| 1125 | path.close(); |
| 1126 | path.moveTo(1.08000004, 0.720000029); |
| 1127 | path.lineTo(3, 2); |
| 1128 | path.quadTo(1.39999998, 2, 1.08000004, 0.720000029); |
| 1129 | path.close(); |
| 1130 | |
| 1131 | </div> |
| 1132 | |
| 1133 | <div id="testQuadratic10a"> |
| 1134 | path.moveTo(15.5, 15.5); |
| 1135 | path.lineTo(46.5, 15.5); |
| 1136 | path.quadTo(0, 31, 0, 46.5); |
| 1137 | path.lineTo(15.5, 15.5); |
| 1138 | path.close(); |
| 1139 | </div> |
| 1140 | |
| 1141 | <div id="testQuadratic10b"> |
| 1142 | path.moveTo(5.16666698, 36.1666641); |
| 1143 | path.lineTo(15.5, 15.5); |
| 1144 | path.lineTo(46.5, 15.5); |
| 1145 | path.quadTo(15.5, 25.8333321, 5.16666698, 36.1666641); |
| 1146 | path.close(); |
| 1147 | path.moveTo(5.16666698, 36.1666641); |
| 1148 | path.lineTo(0, 46.5); |
| 1149 | path.quadTo(0, 41.3333359, 5.16666698, 36.1666641); |
| 1150 | path.close(); |
| 1151 | </div> |
| 1152 | |
| 1153 | <div id="testQuadratic11a"> |
| 1154 | path.moveTo(0, 0); |
| 1155 | path.lineTo(15.5, 31); |
| 1156 | path.lineTo(0, 0); |
| 1157 | path.close(); |
| 1158 | path.moveTo(0, 15.5); |
| 1159 | path.lineTo(15.5, 15.5); |
| 1160 | path.quadTo(15.5, 15.5, 46.5, 31); |
| 1161 | path.lineTo(0, 15.5); |
| 1162 | path.close(); |
| 1163 | </div> |
| 1164 | |
| 1165 | <div id="testQuadratic11b"> |
| 1166 | path.moveTo(9.30000019, 18.6000004); |
| 1167 | path.lineTo(0, 15.5); |
| 1168 | path.lineTo(7.75, 15.5); |
| 1169 | path.lineTo(15.5, 15.5); |
| 1170 | path.lineTo(46.5, 31); |
| 1171 | path.lineTo(9.30000019, 18.6000004); |
| 1172 | path.close(); |
| 1173 | </div> |
| 1174 | |
| 1175 | <div id="testQuadratic12"> |
| 1176 | path.moveTo(0, 0); |
| 1177 | path.quadTo(0, 0, 0, 0); |
| 1178 | path.lineTo(1, 3); |
| 1179 | path.close(); |
| 1180 | path.moveTo(1, 0); |
| 1181 | path.lineTo(0, 1); |
| 1182 | path.quadTo(1, 1, 0, 3); |
| 1183 | path.close(); |
| 1184 | </div> |
| 1185 | |
| 1186 | <div id="testQuadratic13a"> |
| 1187 | path.moveTo(0, 0); |
| 1188 | path.quadTo(0, 0, 15.5, 0); |
| 1189 | path.lineTo(15.5, 31); |
| 1190 | path.lineTo(0, 0); |
| 1191 | path.close(); |
| 1192 | path.moveTo(0, 0); |
| 1193 | path.quadTo(15.5, 46.5, 46.5, 46.5); |
| 1194 | path.lineTo(0, 0); |
| 1195 | path.close(); |
| 1196 | </div> |
| 1197 | |
| 1198 | <div id="testQuadratic13b"> |
| 1199 | path.moveTo(14.8800001, 29.7600002); |
| 1200 | path.quadTo(6.20000029, 18.6000004, 0, 0); |
| 1201 | path.lineTo(14.8800001, 29.7600002); |
| 1202 | path.close(); |
| 1203 | path.moveTo(15.5, 30.5437222); |
| 1204 | path.lineTo(15.5, 31); |
| 1205 | path.lineTo(14.8800001, 29.7600002); |
| 1206 | path.quadTo(15.1884346, 30.156559, 15.5, 30.5437222); |
| 1207 | path.close(); |
| 1208 | path.moveTo(15.5, 15.5); |
| 1209 | path.lineTo(0, 0); |
| 1210 | path.lineTo(15.5, 0); |
| 1211 | path.lineTo(15.5, 15.5); |
| 1212 | path.close(); |
| 1213 | path.moveTo(15.5, 30.5437222); |
| 1214 | path.lineTo(15.5, 15.5); |
| 1215 | path.lineTo(46.5, 46.5); |
| 1216 | path.quadTo(28.34062, 46.5, 15.5, 30.5437222); |
| 1217 | path.close(); |
| 1218 | </div> |
| 1219 | |
| 1220 | <div id="testQuadratic14"> |
| 1221 | path.moveTo(0, 0); |
| 1222 | path.quadTo(0, 0, 1, 0); |
| 1223 | path.lineTo(3, 2); |
| 1224 | path.close(); |
| 1225 | path.moveTo(0, 0); |
| 1226 | path.lineTo(1, 0); |
| 1227 | path.quadTo(3, 2, 3, 3); |
| 1228 | path.close(); |
| 1229 | </div> |
| 1230 | |
caryclark@google.com | 3350c3c | 2012-08-24 15:24:36 +0000 | [diff] [blame] | 1231 | <div id="testQuadratic15"> |
| 1232 | path.moveTo(0, 0); |
| 1233 | path.quadTo(0, 0, 1, 0); |
| 1234 | path.lineTo(1, 3); |
| 1235 | path.close(); |
| 1236 | path.moveTo(1, 0); |
| 1237 | path.lineTo(0, 1); |
| 1238 | path.quadTo(1, 1, 0, 3); |
| 1239 | path.close(); |
| 1240 | </div> |
| 1241 | |
| 1242 | <div id="testQuadratic16a"> |
| 1243 | path.moveTo(0, 0); |
| 1244 | path.quadTo(0, 0, 31, 0); |
| 1245 | path.lineTo(46.5, 31); |
| 1246 | path.lineTo(0, 0); |
| 1247 | path.close(); |
| 1248 | path.moveTo(46.5, 15.5); |
| 1249 | path.lineTo(0, 31); |
| 1250 | path.quadTo(0, 31, 15.5, 31); |
| 1251 | path.lineTo(46.5, 15.5); |
| 1252 | path.close(); |
| 1253 | </div> |
| 1254 | |
| 1255 | <div id="testQuadratic16b"> |
| 1256 | path.moveTo(31, 20.6666679); |
| 1257 | path.lineTo(0, 0); |
| 1258 | path.lineTo(31, 0); |
| 1259 | path.lineTo(39.8571434, 17.7142868); |
| 1260 | path.lineTo(31, 20.6666679); |
| 1261 | path.close(); |
| 1262 | path.moveTo(33.214283, 22.1428585); |
| 1263 | path.lineTo(15.5, 31); |
| 1264 | path.lineTo(0, 31); |
| 1265 | path.lineTo(31, 20.6666679); |
| 1266 | path.lineTo(33.214283, 22.1428585); |
| 1267 | path.close(); |
| 1268 | path.moveTo(40.2999992, 18.6000004); |
| 1269 | path.lineTo(46.5, 31); |
| 1270 | path.lineTo(33.214283, 22.1428585); |
| 1271 | path.lineTo(40.2999992, 18.6000004); |
| 1272 | path.close(); |
| 1273 | path.moveTo(39.8571434, 17.7142868); |
| 1274 | path.lineTo(46.5, 15.5); |
| 1275 | path.lineTo(40.2999992, 18.6000004); |
| 1276 | path.lineTo(39.8571434, 17.7142868); |
| 1277 | path.close(); |
| 1278 | </div> |
| 1279 | |
| 1280 | <div id="testQuadratic17x"> |
| 1281 | path.setFillType(SkPath::kEvenOdd_FillType); |
| 1282 | path.moveTo(0, 0); |
| 1283 | path.quadTo(0, 0, 3, 1); |
| 1284 | path.lineTo(0, 2); |
| 1285 | path.close(); |
| 1286 | path.moveTo(0, 0); |
| 1287 | path.lineTo(1, 0); |
| 1288 | path.quadTo(3, 1, 0, 2); |
| 1289 | path.close(); |
| 1290 | </div> |
| 1291 | |
| 1292 | <div id="testQuadratic18"> |
| 1293 | path.moveTo(0, 0); |
| 1294 | path.quadTo(1, 0, 0, 1); |
| 1295 | path.lineTo(0, 1); |
| 1296 | path.close(); |
| 1297 | path.moveTo(0, 0); |
| 1298 | path.lineTo(0, 0); |
| 1299 | path.quadTo(1, 0, 1, 1); |
| 1300 | path.close(); |
| 1301 | </div> |
| 1302 | |
caryclark@google.com | a7e483d | 2012-08-28 20:44:43 +0000 | [diff] [blame] | 1303 | <div id="testQuadratic19"> |
| 1304 | path.moveTo(0, 0); |
| 1305 | path.quadTo(1, 0, 0, 1); |
| 1306 | path.lineTo(0, 1); |
| 1307 | path.close(); |
| 1308 | path.moveTo(0, 0); |
| 1309 | path.lineTo(0, 0); |
| 1310 | path.quadTo(2, 0, 0, 1); |
| 1311 | path.close(); |
| 1312 | </div> |
| 1313 | |
caryclark@google.com | 32546db | 2012-08-31 20:55:07 +0000 | [diff] [blame] | 1314 | <div id="testQuadratic20"> |
| 1315 | path.moveTo(0, 0); |
| 1316 | path.quadTo(1, 0, 0, 1); |
| 1317 | path.lineTo(0, 1); |
| 1318 | path.close(); |
| 1319 | path.moveTo(0, 0); |
| 1320 | path.lineTo(0, 0); |
| 1321 | path.quadTo(1, 0, 0, 1); |
| 1322 | path.close(); |
| 1323 | </div> |
| 1324 | |
caryclark@google.com | 235f56a | 2012-09-14 14:19:30 +0000 | [diff] [blame^] | 1325 | <div id="testQuadratic21"> |
| 1326 | path.moveTo(0, 0); |
| 1327 | path.quadTo(1, 0, 0, 1); |
| 1328 | path.lineTo(0, 1); |
| 1329 | path.close(); |
| 1330 | path.moveTo(0, 0); |
| 1331 | path.lineTo(0, 0); |
| 1332 | path.quadTo(1, 0, 0, 2); |
| 1333 | path.close(); |
| 1334 | </div> |
| 1335 | |
| 1336 | <div id="testQuadratic22"> |
| 1337 | path.moveTo(0, 0); |
| 1338 | path.quadTo(1, 0, 0, 1); |
| 1339 | path.lineTo(0, 1); |
| 1340 | path.close(); |
| 1341 | path.moveTo(0, 0); |
| 1342 | path.lineTo(0, 0); |
| 1343 | path.quadTo(0, 1, 2, 1); |
| 1344 | path.close(); |
| 1345 | </div> |
| 1346 | |
| 1347 | <div id="testQuadratic23"> |
| 1348 | path.moveTo(0, 0); |
| 1349 | path.quadTo(1, 0, 0, 1); |
| 1350 | path.lineTo(0, 1); |
| 1351 | path.close(); |
| 1352 | path.moveTo(0, 0); |
| 1353 | path.lineTo(0, 0); |
| 1354 | path.quadTo(0, 2, 1, 2); |
| 1355 | path.close(); |
| 1356 | </div> |
| 1357 | |
| 1358 | <div id="testQuadratic24"> |
| 1359 | path.moveTo(0, 0); |
| 1360 | path.quadTo(1, 0, 0, 1); |
| 1361 | path.lineTo(0, 1); |
| 1362 | path.close(); |
| 1363 | path.moveTo(0, 0); |
| 1364 | path.lineTo(1, 0); |
| 1365 | path.quadTo(2, 0, 0, 1); |
| 1366 | path.close(); |
| 1367 | </div> |
| 1368 | |
| 1369 | <div id="testQuadratic25"> |
| 1370 | path.moveTo(0, 0); |
| 1371 | path.quadTo(1, 0, 1, 1); |
| 1372 | path.lineTo(1, 1); |
| 1373 | path.close(); |
| 1374 | path.moveTo(0, 0); |
| 1375 | path.lineTo(0, 0); |
| 1376 | path.quadTo(2, 1, 0, 2); |
| 1377 | path.close(); |
| 1378 | </div> |
| 1379 | |
| 1380 | <div id="testQuadratic26"> |
| 1381 | path.moveTo(0, 0); |
| 1382 | path.quadTo(1, 0, 1, 1); |
| 1383 | path.lineTo(0, 2); |
| 1384 | path.close(); |
| 1385 | path.moveTo(0, 0); |
| 1386 | path.lineTo(0, 0); |
| 1387 | path.quadTo(1, 0, 0, 1); |
| 1388 | path.close(); |
| 1389 | </div> |
| 1390 | |
| 1391 | <div id="testQuadratic27"> |
| 1392 | path.moveTo(0, 0); |
| 1393 | path.quadTo(1, 0, 1, 1); |
| 1394 | path.lineTo(2, 1); |
| 1395 | path.close(); |
| 1396 | path.moveTo(0, 0); |
| 1397 | path.lineTo(0, 0); |
| 1398 | path.quadTo(2, 1, 0, 2); |
| 1399 | path.close(); |
| 1400 | </div> |
| 1401 | |
| 1402 | <div id="testQuadratic28"> |
| 1403 | path.moveTo(0, 0); |
| 1404 | path.quadTo(1, 0, 0, 1); |
| 1405 | path.lineTo(0, 1); |
| 1406 | path.close(); |
| 1407 | path.moveTo(0, 0); |
| 1408 | path.lineTo(0, 2); |
| 1409 | path.quadTo(1, 2, 0, 3); |
| 1410 | path.close(); |
| 1411 | </div> |
| 1412 | |
caryclark@google.com | 752b60e | 2012-03-22 21:11:17 +0000 | [diff] [blame] | 1413 | </div> |
| 1414 | |
| 1415 | <script type="text/javascript"> |
| 1416 | |
| 1417 | var testDivs = [ |
caryclark@google.com | 235f56a | 2012-09-14 14:19:30 +0000 | [diff] [blame^] | 1418 | testQuadratic28, |
| 1419 | testQuadratic27, |
| 1420 | testQuadratic26, |
| 1421 | testQuadratic25, |
| 1422 | testQuadratic24, |
| 1423 | testQuadratic23, |
| 1424 | testQuadratic22, |
| 1425 | testQuadratic21, |
caryclark@google.com | 32546db | 2012-08-31 20:55:07 +0000 | [diff] [blame] | 1426 | testQuadratic20, |
caryclark@google.com | a7e483d | 2012-08-28 20:44:43 +0000 | [diff] [blame] | 1427 | testQuadratic19, |
caryclark@google.com | 3350c3c | 2012-08-24 15:24:36 +0000 | [diff] [blame] | 1428 | testQuadratic18, |
| 1429 | testQuadratic17x, |
| 1430 | testQuadratic16b, |
| 1431 | testQuadratic16a, |
| 1432 | testQuadratic15, |
caryclark@google.com | c899ad9 | 2012-08-23 15:24:42 +0000 | [diff] [blame] | 1433 | testQuadratic14, |
| 1434 | testQuadratic13b, |
| 1435 | testQuadratic13a, |
| 1436 | testQuadratic12, |
| 1437 | testQuadratic11b, |
| 1438 | testQuadratic11a, |
| 1439 | testQuadratic10b, |
| 1440 | testQuadratic10a, |
| 1441 | testQuadratic9a, |
| 1442 | testQuadratic9, |
| 1443 | testQuadratic8, |
| 1444 | testQuadratic7, |
| 1445 | testQuadratic6, |
| 1446 | testQuadratic5, |
| 1447 | testQuadratic4x, |
caryclark@google.com | 03f9706 | 2012-08-21 13:13:52 +0000 | [diff] [blame] | 1448 | testQuadratic3, |
caryclark@google.com | 24bec79 | 2012-08-20 12:43:57 +0000 | [diff] [blame] | 1449 | testQuadratic2, |
| 1450 | testQuadratic1, |
| 1451 | testLine4x, |
| 1452 | testLine3x, |
| 1453 | testLine2x, |
| 1454 | testLine1x, |
| 1455 | testQuadralateral9, |
| 1456 | testQuadralateral8, |
| 1457 | testQuadralateral7, |
| 1458 | testFauxQuadralateral6d, |
| 1459 | testFauxQuadralateral6c, |
| 1460 | testFauxQuadralateral6b, |
| 1461 | testFauxQuadralateral6a, |
| 1462 | testFauxQuadralateral6, |
| 1463 | testQuadralateral6a, |
caryclark@google.com | 59823f7 | 2012-08-09 18:17:47 +0000 | [diff] [blame] | 1464 | testQuadralateral6, |
| 1465 | testQuadralateral5, |
| 1466 | testNondegenerate4, |
| 1467 | testNondegenerate3, |
| 1468 | testNondegenerate2, |
| 1469 | testNondegenerate1, |
| 1470 | testDegenerate4, |
| 1471 | testDegenerate3, |
| 1472 | testDegenerate2, |
| 1473 | testDegenerate1, |
caryclark@google.com | 2ddff93 | 2012-08-07 21:25:27 +0000 | [diff] [blame] | 1474 | testLine79, |
| 1475 | testLine78, |
| 1476 | testLine77, |
| 1477 | testLine76, |
| 1478 | testLine75, |
caryclark@google.com | 0c803d0 | 2012-08-06 11:15:47 +0000 | [diff] [blame] | 1479 | testLine74, |
caryclark@google.com | 200c211 | 2012-08-03 15:05:04 +0000 | [diff] [blame] | 1480 | testLine73, |
| 1481 | testLine72, |
caryclark@google.com | 534aa5b | 2012-08-02 20:08:21 +0000 | [diff] [blame] | 1482 | testLine71, |
| 1483 | testLine70, |
| 1484 | testLine69, |
| 1485 | testLine68f, |
| 1486 | testLine68e, |
| 1487 | testLine68d, |
| 1488 | testLine68c, |
| 1489 | testLine68b, |
| 1490 | testLine68a, |
| 1491 | testLine67, |
caryclark@google.com | 27c449a | 2012-07-27 18:26:38 +0000 | [diff] [blame] | 1492 | testLine66, |
| 1493 | testLine65, |
| 1494 | testLine64, |
| 1495 | testLine63, |
| 1496 | testLine62, |
| 1497 | testLine61, |
| 1498 | testLine60, |
caryclark@google.com | cc90505 | 2012-07-25 20:59:42 +0000 | [diff] [blame] | 1499 | testLine59, |
| 1500 | testLine58, |
caryclark@google.com | 1806344 | 2012-07-25 12:05:18 +0000 | [diff] [blame] | 1501 | testLine57, |
| 1502 | testLine56, |
caryclark@google.com | e21cb18 | 2012-07-23 21:26:31 +0000 | [diff] [blame] | 1503 | testLine55, |
| 1504 | testLine54, |
| 1505 | testLine53, |
| 1506 | testLine52, |
caryclark@google.com | 4758069 | 2012-07-23 12:14:49 +0000 | [diff] [blame] | 1507 | testLine51, |
| 1508 | testLine50, |
| 1509 | testLine49, |
| 1510 | testLine48, |
| 1511 | testLine47, |
| 1512 | testLine46, |
| 1513 | testLine45, |
| 1514 | testLine44, |
| 1515 | testLine43, |
| 1516 | testLine42, |
| 1517 | testLine41, |
| 1518 | testLine40, |
| 1519 | testLine39, |
| 1520 | testLine38, |
| 1521 | testLine37, |
caryclark@google.com | 0e08a19 | 2012-07-13 21:07:52 +0000 | [diff] [blame] | 1522 | testLine36, |
caryclark@google.com | 210acaf | 2012-07-12 21:05:13 +0000 | [diff] [blame] | 1523 | testLine35, |
| 1524 | testLine34, |
caryclark@google.com | 9764cc6 | 2012-07-12 19:29:45 +0000 | [diff] [blame] | 1525 | testLine33, |
caryclark@google.com | fa4a6e9 | 2012-07-11 17:52:32 +0000 | [diff] [blame] | 1526 | testLine32, |
| 1527 | testLine31, |
caryclark@google.com | 534aa5b | 2012-08-02 20:08:21 +0000 | [diff] [blame] | 1528 | testLine30, |
caryclark@google.com | fa4a6e9 | 2012-07-11 17:52:32 +0000 | [diff] [blame] | 1529 | testLine29, |
| 1530 | testLine28, |
caryclark@google.com | 4758069 | 2012-07-23 12:14:49 +0000 | [diff] [blame] | 1531 | testLine24, |
caryclark@google.com | cc90505 | 2012-07-25 20:59:42 +0000 | [diff] [blame] | 1532 | testLine22, |
caryclark@google.com | 4758069 | 2012-07-23 12:14:49 +0000 | [diff] [blame] | 1533 | testLine19, |
caryclark@google.com | fa4a6e9 | 2012-07-11 17:52:32 +0000 | [diff] [blame] | 1534 | testLine17, |
caryclark@google.com | e21cb18 | 2012-07-23 21:26:31 +0000 | [diff] [blame] | 1535 | testLine13, |
| 1536 | testLine12, |
caryclark@google.com | 4758069 | 2012-07-23 12:14:49 +0000 | [diff] [blame] | 1537 | testLine9, |
caryclark@google.com | cc90505 | 2012-07-25 20:59:42 +0000 | [diff] [blame] | 1538 | testLine7b, |
caryclark@google.com | 4758069 | 2012-07-23 12:14:49 +0000 | [diff] [blame] | 1539 | testLine7, |
caryclark@google.com | 8dcf114 | 2012-07-02 20:27:02 +0000 | [diff] [blame] | 1540 | testSimplifyQuadratic21, |
| 1541 | testSimplifyQuadratic20, |
| 1542 | testSimplifyQuadratic19, |
caryclark@google.com | b45a1b4 | 2012-05-18 20:50:33 +0000 | [diff] [blame] | 1543 | testSimplifyQuadratic18, |
caryclark@google.com | fa0588f | 2012-04-26 21:01:06 +0000 | [diff] [blame] | 1544 | testSimplifyQuadratic17, |
| 1545 | testSimplifyQuadratic16, |
| 1546 | testSimplifyQuadratic15, |
| 1547 | testSimplifyQuadratic14, |
| 1548 | testSimplifyQuadratic13, |
| 1549 | testSimplifyQuadratic12, |
| 1550 | testSimplifyQuadratic11, |
| 1551 | testSimplifyQuadratic10, |
| 1552 | testSimplifyQuadratic9, |
| 1553 | testSimplifyQuadratic8, |
| 1554 | testSimplifyQuadratic7, |
| 1555 | testSimplifyQuadratic6, |
| 1556 | testSimplifyQuadratic5, |
| 1557 | testSimplifyQuadratic4, |
| 1558 | testSimplifyQuadratic3, |
| 1559 | testSimplifyQuadratic2, |
| 1560 | testSimplifyQuadratic1, |
caryclark@google.com | 752b60e | 2012-03-22 21:11:17 +0000 | [diff] [blame] | 1561 | ]; |
| 1562 | |
| 1563 | var scale, columns, rows, xStart, yStart; |
| 1564 | |
| 1565 | var ticks = 0.1; |
| 1566 | var at_x = 13 + 0.5; |
| 1567 | var at_y = 13 + 0.5; |
caryclark@google.com | 2ddff93 | 2012-08-07 21:25:27 +0000 | [diff] [blame] | 1568 | var decimal_places = 0; // make this 3 to show more precision |
caryclark@google.com | 752b60e | 2012-03-22 21:11:17 +0000 | [diff] [blame] | 1569 | |
| 1570 | var tests = []; |
caryclark@google.com | 0e08a19 | 2012-07-13 21:07:52 +0000 | [diff] [blame] | 1571 | var testTitles = []; |
caryclark@google.com | 752b60e | 2012-03-22 21:11:17 +0000 | [diff] [blame] | 1572 | var testIndex = 0; |
caryclark@google.com | 24bec79 | 2012-08-20 12:43:57 +0000 | [diff] [blame] | 1573 | var hasXor = false; |
caryclark@google.com | 752b60e | 2012-03-22 21:11:17 +0000 | [diff] [blame] | 1574 | |
| 1575 | var ctx; |
| 1576 | |
caryclark@google.com | 0e08a19 | 2012-07-13 21:07:52 +0000 | [diff] [blame] | 1577 | function parse(test, title) { |
caryclark@google.com | 752b60e | 2012-03-22 21:11:17 +0000 | [diff] [blame] | 1578 | var contours = []; |
| 1579 | var contourStrs = test.split("path.close();"); |
caryclark@google.com | d88e089 | 2012-03-27 13:23:51 +0000 | [diff] [blame] | 1580 | var pattern = /-?\d+\.*\d*/g; |
caryclark@google.com | 24bec79 | 2012-08-20 12:43:57 +0000 | [diff] [blame] | 1581 | hasXor = test.split("kEvenOdd_FillType").length > 1; |
caryclark@google.com | 752b60e | 2012-03-22 21:11:17 +0000 | [diff] [blame] | 1582 | for (var c in contourStrs) { |
caryclark@google.com | fb17342 | 2012-04-10 18:28:55 +0000 | [diff] [blame] | 1583 | var contour = contourStrs[c]; |
| 1584 | var verbStrs = contour.split("path"); |
| 1585 | var verbs = []; |
| 1586 | for (var v in verbStrs) { |
| 1587 | var verbStr = verbStrs[v]; |
| 1588 | var points = verbStr.match(pattern); |
| 1589 | var pts = []; |
| 1590 | for (var wd in points) { |
| 1591 | var num = parseFloat(points[wd]); |
| 1592 | if (isNaN(num)) continue; |
| 1593 | pts.push(num); |
| 1594 | } |
| 1595 | if (pts.length > 0) |
| 1596 | verbs.push(pts); |
caryclark@google.com | 752b60e | 2012-03-22 21:11:17 +0000 | [diff] [blame] | 1597 | } |
caryclark@google.com | fa0588f | 2012-04-26 21:01:06 +0000 | [diff] [blame] | 1598 | if (verbs.length > 0) { |
| 1599 | var lastIndex = verbs.length - 1; |
| 1600 | var lastVerb = verbs[lastIndex]; |
| 1601 | var lastLen = lastVerb.length; |
| 1602 | if (verbs[0][0] != lastVerb[lastLen - 2] && verbs[0][1] != lastVerb[lastLen - 1]) { |
| 1603 | var lastPts = []; |
| 1604 | lastPts.push(verbs[0][0]); |
| 1605 | lastPts.push(verbs[0][1]); |
| 1606 | verbs.push(lastPts); |
| 1607 | } |
caryclark@google.com | fb17342 | 2012-04-10 18:28:55 +0000 | [diff] [blame] | 1608 | contours.push(verbs); |
caryclark@google.com | fa0588f | 2012-04-26 21:01:06 +0000 | [diff] [blame] | 1609 | } |
caryclark@google.com | 752b60e | 2012-03-22 21:11:17 +0000 | [diff] [blame] | 1610 | } |
caryclark@google.com | 0e08a19 | 2012-07-13 21:07:52 +0000 | [diff] [blame] | 1611 | if (contours.length > 0) { |
caryclark@google.com | fb17342 | 2012-04-10 18:28:55 +0000 | [diff] [blame] | 1612 | tests.push(contours); |
caryclark@google.com | 0e08a19 | 2012-07-13 21:07:52 +0000 | [diff] [blame] | 1613 | testTitles.push(title); |
| 1614 | } |
caryclark@google.com | 752b60e | 2012-03-22 21:11:17 +0000 | [diff] [blame] | 1615 | } |
| 1616 | |
caryclark@google.com | 0e08a19 | 2012-07-13 21:07:52 +0000 | [diff] [blame] | 1617 | function parseRect(test, title) { |
caryclark@google.com | fa4a6e9 | 2012-07-11 17:52:32 +0000 | [diff] [blame] | 1618 | var contours = []; |
| 1619 | var rectStrs = test.split("path.addRect"); |
| 1620 | var pattern = /-?\d+\.*\d*/g; |
caryclark@google.com | 24bec79 | 2012-08-20 12:43:57 +0000 | [diff] [blame] | 1621 | hasXor = test.split("kEvenOdd_FillType").length > 1; |
caryclark@google.com | fa4a6e9 | 2012-07-11 17:52:32 +0000 | [diff] [blame] | 1622 | for (var r in rectStrs) { |
| 1623 | var rect = rectStrs[r]; |
| 1624 | var sideStrs = rect.match(pattern); |
| 1625 | var sides = []; |
| 1626 | for (var wd in sideStrs) { |
| 1627 | var num = parseFloat(sideStrs[wd]); |
| 1628 | if (isNaN(num)) continue; |
| 1629 | sides.push(num); |
| 1630 | } |
| 1631 | if (sides.length == 0) |
| 1632 | continue; |
| 1633 | var verbs = []; |
| 1634 | var topLeft = []; |
| 1635 | topLeft.push(sides[0]); topLeft.push(sides[1]); |
| 1636 | var topRight = []; |
| 1637 | topRight.push(sides[2]); topRight.push(sides[1]); |
| 1638 | var botLeft = []; |
| 1639 | botLeft.push(sides[0]); botLeft.push(sides[3]); |
| 1640 | var botRight = []; |
| 1641 | botRight.push(sides[2]); botRight.push(sides[3]); |
| 1642 | verbs.push(topLeft); |
| 1643 | if (sides[4] == 0) { |
| 1644 | verbs.push(topRight); |
| 1645 | verbs.push(botRight); |
| 1646 | verbs.push(botLeft); |
| 1647 | } else { |
| 1648 | verbs.push(botLeft); |
| 1649 | verbs.push(botRight); |
| 1650 | verbs.push(topRight); |
| 1651 | } |
| 1652 | verbs.push(topLeft); |
| 1653 | contours.push(verbs); |
| 1654 | } |
caryclark@google.com | 0e08a19 | 2012-07-13 21:07:52 +0000 | [diff] [blame] | 1655 | if (contours.length > 0) { |
caryclark@google.com | fa4a6e9 | 2012-07-11 17:52:32 +0000 | [diff] [blame] | 1656 | tests.push(contours); |
caryclark@google.com | 0e08a19 | 2012-07-13 21:07:52 +0000 | [diff] [blame] | 1657 | testTitles.push(title); |
| 1658 | } |
caryclark@google.com | fa4a6e9 | 2012-07-11 17:52:32 +0000 | [diff] [blame] | 1659 | } |
| 1660 | |
caryclark@google.com | 752b60e | 2012-03-22 21:11:17 +0000 | [diff] [blame] | 1661 | function init(test) { |
| 1662 | var canvas = document.getElementById('canvas'); |
| 1663 | if (!canvas.getContext) return; |
caryclark@google.com | 534aa5b | 2012-08-02 20:08:21 +0000 | [diff] [blame] | 1664 | canvas.width = window.innerWidth - at_x; |
| 1665 | canvas.height = window.innerHeight - at_y; |
caryclark@google.com | 752b60e | 2012-03-22 21:11:17 +0000 | [diff] [blame] | 1666 | ctx = canvas.getContext('2d'); |
| 1667 | var xmin = Infinity; |
| 1668 | var xmax = -Infinity; |
| 1669 | var ymin = Infinity; |
| 1670 | var ymax = -Infinity; |
caryclark@google.com | fb17342 | 2012-04-10 18:28:55 +0000 | [diff] [blame] | 1671 | for (var contours in test) { |
| 1672 | var contour = test[contours]; |
| 1673 | for (var verbs in contour) { |
| 1674 | var verb = contour[verbs]; |
| 1675 | var last = verb.length; |
caryclark@google.com | b45a1b4 | 2012-05-18 20:50:33 +0000 | [diff] [blame] | 1676 | for (var idx = 0; idx < last; idx += 2) { |
| 1677 | xmin = Math.min(xmin, verb[idx]); |
| 1678 | xmax = Math.max(xmax, verb[idx]); |
| 1679 | ymin = Math.min(ymin, verb[idx + 1]); |
| 1680 | ymax = Math.max(ymax, verb[idx + 1]); |
| 1681 | } |
caryclark@google.com | 752b60e | 2012-03-22 21:11:17 +0000 | [diff] [blame] | 1682 | } |
| 1683 | } |
| 1684 | var subscale = 1; |
| 1685 | while ((xmax - xmin) * subscale < 0.1 && (ymax - ymin) * subscale < 0.1) { |
| 1686 | subscale *= 10; |
| 1687 | } |
| 1688 | columns = Math.ceil(xmax) - Math.floor(xmin) + 1; |
| 1689 | rows = Math.ceil(ymax) - Math.floor(ymin) + 1; |
| 1690 | xStart = Math.floor(xmin); |
| 1691 | yStart = Math.floor(ymin); |
| 1692 | var hscale = ctx.canvas.width / columns / ticks; |
| 1693 | var vscale = ctx.canvas.height / rows / ticks; |
| 1694 | scale = Math.floor(Math.min(hscale, vscale)) * subscale; |
| 1695 | } |
| 1696 | |
| 1697 | function drawPoint(px, py, xoffset, yoffset, unit) { |
caryclark@google.com | 2ddff93 | 2012-08-07 21:25:27 +0000 | [diff] [blame] | 1698 | var label = px.toFixed(decimal_places) + ", " + py.toFixed(decimal_places); |
caryclark@google.com | 752b60e | 2012-03-22 21:11:17 +0000 | [diff] [blame] | 1699 | var _px = px * unit + xoffset; |
| 1700 | var _py = py * unit + yoffset; |
| 1701 | ctx.beginPath(); |
| 1702 | ctx.arc(_px, _py, 3, 0, Math.PI*2, true); |
| 1703 | ctx.closePath(); |
| 1704 | ctx.fill(); |
| 1705 | ctx.fillText(label, _px + 5, _py); |
| 1706 | } |
| 1707 | |
caryclark@google.com | 0e08a19 | 2012-07-13 21:07:52 +0000 | [diff] [blame] | 1708 | function draw(test, title, _at_x, _at_y, scale) { |
| 1709 | ctx.fillStyle = "rgba(0,0,0, 0.1)"; |
| 1710 | ctx.font = "normal 50px Arial"; |
| 1711 | ctx.fillText(title, 50, 50); |
| 1712 | ctx.font = "normal 10px Arial"; |
| 1713 | |
caryclark@google.com | 752b60e | 2012-03-22 21:11:17 +0000 | [diff] [blame] | 1714 | var unit = scale * ticks; |
| 1715 | ctx.lineWidth = 1; |
| 1716 | var i; |
| 1717 | for (i = 0; i <= rows * ticks; ++i) { |
| 1718 | ctx.strokeStyle = (i % ticks) != 0 ? "rgb(160,160,160)" : "black"; |
| 1719 | ctx.beginPath(); |
| 1720 | ctx.moveTo(_at_x + 0, _at_y + i * scale); |
| 1721 | ctx.lineTo(_at_x + unit * columns, _at_y + i * scale); |
| 1722 | ctx.stroke(); |
| 1723 | } |
| 1724 | for (i = 0; i <= columns * ticks; ++i) { |
| 1725 | ctx.strokeStyle = (i % ticks) != 0 ? "rgb(160,160,160)" : "black"; |
| 1726 | ctx.beginPath(); |
| 1727 | ctx.moveTo(_at_x + i * scale, _at_y + 0); |
| 1728 | ctx.lineTo(_at_x + i * scale, _at_y + unit * rows); |
| 1729 | ctx.stroke(); |
| 1730 | } |
| 1731 | |
| 1732 | var xoffset = xStart * -unit + _at_x; |
| 1733 | var yoffset = yStart * -unit + _at_y; |
| 1734 | |
| 1735 | ctx.fillStyle = "rgb(40,80,60)" |
| 1736 | for (i = 0; i <= columns; i += (1 / ticks)) |
| 1737 | { |
| 1738 | num = (xoffset - _at_x) / -unit + i; |
| 1739 | ctx.fillText(num.toFixed(0), i * unit + _at_y - 5, 10); |
| 1740 | } |
| 1741 | for (i = 0; i <= rows; i += (1 / ticks)) |
| 1742 | { |
| 1743 | num = (yoffset - _at_x) / -unit + i; |
| 1744 | ctx.fillText(num.toFixed(0), 0, i * unit + _at_y + 0); |
| 1745 | } |
caryclark@google.com | 32546db | 2012-08-31 20:55:07 +0000 | [diff] [blame] | 1746 | |
caryclark@google.com | 752b60e | 2012-03-22 21:11:17 +0000 | [diff] [blame] | 1747 | ctx.strokeStyle = "red"; |
caryclark@google.com | fb17342 | 2012-04-10 18:28:55 +0000 | [diff] [blame] | 1748 | var contours, verbs, pts; |
caryclark@google.com | 8dcf114 | 2012-07-02 20:27:02 +0000 | [diff] [blame] | 1749 | ctx.beginPath(); |
caryclark@google.com | fb17342 | 2012-04-10 18:28:55 +0000 | [diff] [blame] | 1750 | for (contours in test) { |
| 1751 | var contour = test[contours]; |
| 1752 | if (contours == 2) ctx.strokeStyle = "blue"; |
caryclark@google.com | fb17342 | 2012-04-10 18:28:55 +0000 | [diff] [blame] | 1753 | var first = true; |
| 1754 | for (verbs in contour) { |
| 1755 | var verb = contour[verbs]; |
| 1756 | switch (verb.length) { |
| 1757 | case 2: |
| 1758 | if (first) { |
| 1759 | ctx.moveTo(xoffset + verb[0] * unit, yoffset + verb[1] * unit); |
| 1760 | first = false; |
| 1761 | } else |
| 1762 | ctx.lineTo(xoffset + verb[0] * unit, yoffset + verb[1] * unit); |
| 1763 | break; |
| 1764 | case 4: |
| 1765 | ctx.quadraticCurveTo(xoffset + verb[0] * unit, yoffset + verb[1] * unit, |
| 1766 | xoffset + verb[2] * unit, yoffset + verb[3] * unit); |
| 1767 | break; |
| 1768 | case 6: |
| 1769 | ctx.bezierCurveTo(xoffset + verb[0] * unit, yoffset + verb[1] * unit, |
| 1770 | xoffset + verb[2] * unit, yoffset + verb[3] * unit, |
| 1771 | xoffset + verb[4] * unit, yoffset + verb[5] * unit); |
| 1772 | break; |
| 1773 | } |
caryclark@google.com | 752b60e | 2012-03-22 21:11:17 +0000 | [diff] [blame] | 1774 | } |
caryclark@google.com | 8dcf114 | 2012-07-02 20:27:02 +0000 | [diff] [blame] | 1775 | ctx.closePath(); |
caryclark@google.com | 752b60e | 2012-03-22 21:11:17 +0000 | [diff] [blame] | 1776 | } |
caryclark@google.com | 24bec79 | 2012-08-20 12:43:57 +0000 | [diff] [blame] | 1777 | if (hasXor) { |
| 1778 | ctx.fillType=xor; // how is this done? |
| 1779 | } |
caryclark@google.com | 8dcf114 | 2012-07-02 20:27:02 +0000 | [diff] [blame] | 1780 | ctx.stroke(); |
| 1781 | ctx.fillStyle="rgba(192,192,255, 0.3)"; |
| 1782 | ctx.fill(); |
caryclark@google.com | 752b60e | 2012-03-22 21:11:17 +0000 | [diff] [blame] | 1783 | |
| 1784 | ctx.fillStyle="blue"; |
caryclark@google.com | fb17342 | 2012-04-10 18:28:55 +0000 | [diff] [blame] | 1785 | for (contours in test) { |
| 1786 | var contour = test[contours]; |
| 1787 | for (verbs in contour) { |
| 1788 | var verb = contour[verbs]; |
| 1789 | for (i = 0; i < verb.length; i += 2) { |
| 1790 | x = verb[i]; |
| 1791 | y = verb[i + 1]; |
| 1792 | drawPoint(x, y, xoffset, yoffset, unit); |
| 1793 | } |
caryclark@google.com | 752b60e | 2012-03-22 21:11:17 +0000 | [diff] [blame] | 1794 | } |
| 1795 | } |
| 1796 | } |
| 1797 | |
| 1798 | var mouseX = Infinity, mouseY; |
| 1799 | |
| 1800 | function calcXY() { |
| 1801 | var e = window.event; |
| 1802 | var tgt = e.target || e.srcElement; |
| 1803 | var left = tgt.offsetLeft; |
| 1804 | var top = tgt.offsetTop; |
| 1805 | var unit = scale * ticks; |
| 1806 | mouseX = (e.clientX - left - Math.ceil(at_x) + 1) / unit + xStart; |
| 1807 | mouseY = (e.clientY - top - Math.ceil(at_y)) / unit + yStart; |
| 1808 | } |
| 1809 | |
| 1810 | function handleMouseOver() { |
| 1811 | calcXY(); |
| 1812 | var num = mouseX.toFixed(3) + ", " + mouseY.toFixed(3); |
| 1813 | ctx.beginPath(); |
| 1814 | ctx.rect(300,100,200,10); |
| 1815 | ctx.fillStyle="white"; |
| 1816 | ctx.fill(); |
| 1817 | ctx.fillStyle="black"; |
| 1818 | ctx.fillText(num, 300, 108); |
| 1819 | } |
| 1820 | |
| 1821 | function handleMouseClick() { |
| 1822 | calcXY(); |
| 1823 | // drawInset(); |
| 1824 | } |
| 1825 | |
| 1826 | function drawTop() { |
| 1827 | init(tests[testIndex]); |
| 1828 | redraw(); |
| 1829 | } |
| 1830 | |
| 1831 | function redraw() { |
| 1832 | ctx.beginPath(); |
| 1833 | ctx.rect(0, 0, ctx.canvas.width, ctx.canvas.height); |
| 1834 | ctx.fillStyle="white"; |
| 1835 | ctx.fill(); |
caryclark@google.com | 0e08a19 | 2012-07-13 21:07:52 +0000 | [diff] [blame] | 1836 | draw(tests[testIndex], testTitles[testIndex], at_x, at_y, scale); |
caryclark@google.com | 752b60e | 2012-03-22 21:11:17 +0000 | [diff] [blame] | 1837 | // if (insetScale != scale && mouseX != Infinity) |
| 1838 | // drawInset(); |
| 1839 | } |
| 1840 | |
| 1841 | function doKeyPress(evt) { |
| 1842 | var char = String.fromCharCode(evt.charCode); |
| 1843 | switch (char) { |
| 1844 | case 'N': |
caryclark@google.com | 534aa5b | 2012-08-02 20:08:21 +0000 | [diff] [blame] | 1845 | testIndex += 9; |
caryclark@google.com | 752b60e | 2012-03-22 21:11:17 +0000 | [diff] [blame] | 1846 | case 'n': |
| 1847 | if (++testIndex >= tests.length) |
| 1848 | testIndex = 0; |
caryclark@google.com | fa0588f | 2012-04-26 21:01:06 +0000 | [diff] [blame] | 1849 | mouseX = Infinity; |
| 1850 | drawTop(); |
| 1851 | break; |
| 1852 | case 'P': |
caryclark@google.com | 534aa5b | 2012-08-02 20:08:21 +0000 | [diff] [blame] | 1853 | testIndex -= 9; |
caryclark@google.com | fa0588f | 2012-04-26 21:01:06 +0000 | [diff] [blame] | 1854 | case 'p': |
| 1855 | if (--testIndex < 0) |
| 1856 | testIndex = tests.length - 1; |
caryclark@google.com | 752b60e | 2012-03-22 21:11:17 +0000 | [diff] [blame] | 1857 | mouseX = Infinity; |
| 1858 | drawTop(); |
| 1859 | break; |
| 1860 | case 'T': |
| 1861 | case 't': |
caryclark@google.com | 752b60e | 2012-03-22 21:11:17 +0000 | [diff] [blame] | 1862 | break; |
| 1863 | case '-': |
caryclark@google.com | 534aa5b | 2012-08-02 20:08:21 +0000 | [diff] [blame] | 1864 | drawTop(); |
caryclark@google.com | 752b60e | 2012-03-22 21:11:17 +0000 | [diff] [blame] | 1865 | break; |
| 1866 | case '=': |
| 1867 | case '+': |
caryclark@google.com | 534aa5b | 2012-08-02 20:08:21 +0000 | [diff] [blame] | 1868 | drawTop(); |
caryclark@google.com | 752b60e | 2012-03-22 21:11:17 +0000 | [diff] [blame] | 1869 | break; |
| 1870 | } |
| 1871 | } |
| 1872 | |
| 1873 | function start() { |
| 1874 | for (i = 0; i < testDivs.length; ++i) { |
caryclark@google.com | 0e08a19 | 2012-07-13 21:07:52 +0000 | [diff] [blame] | 1875 | var title = testDivs[i].id.toString(); |
caryclark@google.com | 752b60e | 2012-03-22 21:11:17 +0000 | [diff] [blame] | 1876 | var str = testDivs[i].firstChild.data; |
caryclark@google.com | fa4a6e9 | 2012-07-11 17:52:32 +0000 | [diff] [blame] | 1877 | if (str.split("addRect").length > 1) { |
caryclark@google.com | 0e08a19 | 2012-07-13 21:07:52 +0000 | [diff] [blame] | 1878 | parseRect(str, title); |
caryclark@google.com | fa4a6e9 | 2012-07-11 17:52:32 +0000 | [diff] [blame] | 1879 | } else { |
caryclark@google.com | 0e08a19 | 2012-07-13 21:07:52 +0000 | [diff] [blame] | 1880 | parse(str, title); |
caryclark@google.com | fa4a6e9 | 2012-07-11 17:52:32 +0000 | [diff] [blame] | 1881 | } |
caryclark@google.com | 752b60e | 2012-03-22 21:11:17 +0000 | [diff] [blame] | 1882 | } |
| 1883 | drawTop(); |
| 1884 | window.addEventListener('keypress', doKeyPress, true); |
caryclark@google.com | 534aa5b | 2012-08-02 20:08:21 +0000 | [diff] [blame] | 1885 | window.onresize = function() { |
| 1886 | drawTop(); |
| 1887 | } |
caryclark@google.com | 752b60e | 2012-03-22 21:11:17 +0000 | [diff] [blame] | 1888 | } |
| 1889 | |
| 1890 | </script> |
| 1891 | </head> |
| 1892 | |
| 1893 | <body onLoad="start();"> |
caryclark@google.com | fa4a6e9 | 2012-07-11 17:52:32 +0000 | [diff] [blame] | 1894 | <canvas id="canvas" width="750" height="500" |
caryclark@google.com | 752b60e | 2012-03-22 21:11:17 +0000 | [diff] [blame] | 1895 | onmousemove="handleMouseOver()" |
| 1896 | onclick="handleMouseClick()" |
| 1897 | ></canvas > |
| 1898 | </body> |
| 1899 | </html> |