| OLD | NEW |
| 1 The letters in the right image should be crisp and non-blurry like the letters i
n the left image.<p> | 1 The letters in the right image should be crisp and non-blurry like the letters i
n the left image.<p> |
| 2 <canvas></canvas> | 2 <canvas></canvas> |
| 3 <img id="result" onload="testDone()"> | 3 <img id="result" onload="testDone()"> |
| 4 | 4 |
| 5 <script> | 5 <script> |
| 6 if (window.testRunner) { | 6 if (window.testRunner) { |
| 7 window.testRunner.dumpAsTextWithPixelResults(); | 7 window.testRunner.dumpAsTextWithPixelResults(); |
| 8 window.testRunner.waitUntilDone(); | 8 window.testRunner.waitUntilDone(); |
| 9 } | 9 } |
| 10 | 10 |
| 11 function testDone() | 11 function testDone() |
| 12 { | 12 { |
| 13 if (window.testRunner) | 13 if (window.testRunner) |
| 14 window.testRunner.layoutAndPaintAsyncThen(function(){ testRunner.notifyD
one(); }); | 14 window.testRunner.notifyDone(); |
| 15 } | 15 } |
| 16 | 16 |
| 17 var image = new Image(); | 17 var image = new Image(); |
| 18 image.onload = function() { | 18 image.onload = function() { |
| 19 var canvas = document.querySelector('canvas'); | 19 var canvas = document.querySelector('canvas'); |
| 20 canvas.width = this.width; | 20 canvas.width = this.width; |
| 21 canvas.height = this.height; | 21 canvas.height = this.height; |
| 22 canvas.getContext('2d').drawImage(this, 0, 0); | 22 canvas.getContext('2d').drawImage(this, 0, 0); |
| 23 result.src = canvas.toDataURL('image/jpeg', 1.0); | 23 result.src = canvas.toDataURL('image/jpeg', 1.0); |
| 24 document.body.style.zoom = 1.3; | 24 document.body.style.zoom = 1.3; |
| 25 }; | 25 }; |
| 26 | 26 |
| 27 image.src = "resources/letters.png"; | 27 image.src = "resources/letters.png"; |
| 28 </script> | 28 </script> |
| OLD | NEW |