OLD | NEW |
(Empty) | |
| 1 <html> |
| 2 <body> |
| 3 <canvas id="c1" width="250" height="250"></canvas> |
| 4 <canvas id="c2" width="250" height="250"></canvas> |
| 5 <br> |
| 6 <canvas id="c3" width="250" height="250"></canvas> |
| 7 <canvas id="c4" width="250" height="250"></canvas> |
| 8 <script type="text/javascript"> |
| 9 var ctx1 = document.getElementById('c1').getContext('2d'); |
| 10 var ctx2 = document.getElementById('c2').getContext('2d'); |
| 11 var ctx3 = document.getElementById('c3').getContext('2d'); |
| 12 var ctx4 = document.getElementById('c4').getContext('2d'); |
| 13 ctx1.fillStyle = 'green'; |
| 14 ctx2.fillStyle = 'green'; |
| 15 ctx3.fillStyle = 'green'; |
| 16 ctx4.fillStyle = 'green'; |
| 17 ctx1.fillRect(25, 25, 200, 200); |
| 18 ctx2.fillRect(25, 25, 200, 200); |
| 19 if (window.createImageBitmap) { |
| 20 ctx4.fillRect(25, 25, 200, 200); |
| 21 } |
| 22 |
| 23 if (window.testRunner) { |
| 24 testRunner.waitUntilDone(); |
| 25 } |
| 26 var video = document.createElement("video"); |
| 27 video.autoplay = false; |
| 28 video.addEventListener("canplaythrough", videoLoaded, false); |
| 29 video.src = "resources/green.ogv"; |
| 30 |
| 31 function videoLoaded() { |
| 32 var w = video.videoWidth; |
| 33 var h = video.videoHeight; |
| 34 ctx3.drawImage(video, 0, 0, w, h, 75, 75, 100, 100); |
| 35 ctx3.drawImage(video, 0, 0, w, h, 25, 25, 50, 50); |
| 36 ctx3.drawImage(video, 0, 0, w, h, 75, 25, 100, 50); |
| 37 ctx3.drawImage(video, 0, 0, w, h, 175, 25, 50, 50); |
| 38 ctx3.drawImage(video, 0, 0, w, h, 25, 75, 50, 100); |
| 39 ctx3.drawImage(video, 0, 0, w, h, 175, 75, 50, 100); |
| 40 ctx3.drawImage(video, 0, 0, w, h, 25, 175, 50, 50); |
| 41 ctx3.drawImage(video, 0, 0, w, h, 75, 175, 100, 50); |
| 42 ctx3.drawImage(video, 0, 0, w, h, 175, 175, 50, 50); |
| 43 if (window.testRunner) { |
| 44 testRunner.notifyDone(); |
| 45 } |
| 46 } |
| 47 |
| 48 </script> |
| 49 </body></html> |
OLD | NEW |