Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(14)

Side by Side Diff: LayoutTests/fast/canvas/canvas-toDataURL-webp-maximum-quality.html

Issue 1302423004: Support lossy and lossless <canvas>.toDataURL for webp (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 like the letters in the left imag e.<p>
2 <canvas></canvas> 2 <canvas></canvas>
3 <img id="result" onload="testDone()"> 3 <img id="result">
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()
12 {
13 if (window.testRunner)
14 window.testRunner.notifyDone();
15 }
16
17 var image = new Image(); 11 var image = new Image();
18 image.onload = function() { 12 image.onload = function() {
19 var canvas = document.querySelector('canvas'); 13 var canvas = document.querySelector('canvas');
20 canvas.width = this.width; 14 canvas.width = this.width;
21 canvas.height = this.height; 15 canvas.height = this.height;
22 canvas.getContext('2d').drawImage(this, 0, 0); 16 canvas.getContext('2d').drawImage(this, 0, 0);
23 result.src = canvas.toDataURL('image/jpeg', 1.0); 17
24 document.body.style.zoom = 1.3; 18 document.body.style.zoom = 1.3;
19
20 document.getElementById('result').src = canvas.toDataURL('image/webp', 1.0);
21
22 if (window.testRunner)
23 window.testRunner.notifyDone();
25 }; 24 };
26 25
27 image.src = "resources/letters.png"; 26 image.src = "resources/letters.png";
28 </script> 27 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698