OLD | NEW |
---|---|
(Empty) | |
1 <html> | |
2 <body> | |
3 <canvas id="c"></canvas> | |
4 <script> | |
5 if (window.testRunner) | |
6 testRunner.waitUntilDone(); | |
7 | |
8 function finishTest() { | |
9 if (window.testRunner) | |
10 testRunner.notifyDone(); | |
11 } | |
12 | |
13 var canvas = document.getElementById("c"); | |
14 canvas.setAttribute("width", "200"); | |
Justin Novosad
2013/08/07 18:56:55
canvas.width = 200;
| |
15 canvas.setAttribute("height", "200"); | |
16 var ctx = canvas.getContext("2d"); | |
17 | |
18 var img = new Image(); | |
19 img.src = 'resources/green-red-animated.gif'; | |
20 img.onload = imageLoaded(); | |
21 | |
22 function imageLoaded() { | |
23 window.setTimeout(function() { | |
24 createImageBitmap(img).then(function (imageBitmap) { | |
25 ctx.drawImage(imageBitmap, 0, 0); | |
Justin Novosad
2013/08/07 18:56:55
Instead of implementing this as a ref test, it cou
| |
26 finishTest(); | |
27 }, finishTest); | |
28 }, 200); | |
Justin Novosad
2013/08/07 18:56:55
This 200ms seems to come out of nowhere. I think
| |
29 } | |
30 </script> | |
31 <p>A green square should be visible.</p> | |
32 </body> | |
33 </html> | |
OLD | NEW |