OLD | NEW |
(Empty) | |
| 1 <img id="png"/> |
| 2 <script> |
| 3 if (window.testRunner) { |
| 4 testRunner.waitUntilDone(); |
| 5 } |
| 6 |
| 7 var pngImage = document.getElementById('png'); |
| 8 function imageLoaded() { |
| 9 if (window.testRunner) { |
| 10 window.testRunner.notifyDone(); |
| 11 } |
| 12 } |
| 13 pngImage.addEventListener('load', imageLoaded); |
| 14 |
| 15 var canvas = document.createElement("canvas"); |
| 16 canvas.width = 50; |
| 17 canvas.height = 50; |
| 18 var gl = canvas.getContext('webgl'); |
| 19 gl.clearColor(0, 1, 0, 1); |
| 20 gl.clear(gl.COLOR_BUFFER_BIT); |
| 21 |
| 22 canvas.toBlob(function(blob) { |
| 23 pngImage.src = URL.createObjectURL(blob); |
| 24 }); |
| 25 </script> |
| 26 |
OLD | NEW |