OLD | NEW |
(Empty) | |
| 1 <!-- The letters in the right image should be crisp like the letters in the left
image. --> |
| 2 <canvas></canvas> |
| 3 <img id="result" onload="testDone()"> |
| 4 |
| 5 <script> |
| 6 if (window.testRunner) { |
| 7 testRunner.dumpAsTextWithPixelResults(); |
| 8 testRunner.waitUntilDone(); |
| 9 } |
| 10 |
| 11 function testDone() |
| 12 { |
| 13 if (window.testRunner) |
| 14 testRunner.notifyDone(); |
| 15 } |
| 16 |
| 17 var image = new Image(); |
| 18 image.onload = function() { |
| 19 var canvas = document.querySelector('canvas'); |
| 20 canvas.width = image.width; |
| 21 canvas.height = image.height; |
| 22 canvas.getContext('2d').drawImage(image, 0, 0); |
| 23 |
| 24 document.body.style.zoom = 1.3; |
| 25 |
| 26 canvas.toBlob(function(blob) { |
| 27 var failure = "../../fast/images/resources/rgb-jpeg-red.jpg"; |
| 28 if (!blob) { |
| 29 result.src = failure; |
| 30 } else if (blob.type != 'image/webp') { |
| 31 result.src = failure; |
| 32 } else { |
| 33 result.src = URL.createObjectURL(blob); |
| 34 } |
| 35 }, "image/webp.ll", 0.2); |
| 36 }; |
| 37 |
| 38 image.src = "resources/letters.png"; |
| 39 </script> |
OLD | NEW |