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