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

Unified Diff: LayoutTests/fast/canvas/canvas-toBlob-webp-lossless.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, 4 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 side-by-side diff with in-line comments
Download patch
Index: LayoutTests/fast/canvas/canvas-toBlob-webp-lossless.html
diff --git a/LayoutTests/fast/canvas/canvas-toBlob-webp-lossless.html b/LayoutTests/fast/canvas/canvas-toBlob-webp-lossless.html
new file mode 100644
index 0000000000000000000000000000000000000000..9cadf8c21d1d3eaf316e5ccb03bbbfc295b25d85
--- /dev/null
+++ b/LayoutTests/fast/canvas/canvas-toBlob-webp-lossless.html
@@ -0,0 +1,39 @@
+The letters in the right image should be crisp like the letters in the left image.<p>
+<canvas></canvas>
+<img id="result" onload="testDone()">
+
+<script>
+if (window.testRunner) {
+ testRunner.dumpAsTextWithPixelResults();
+ testRunner.waitUntilDone();
+}
+
+function testDone()
+{
+ if (window.testRunner)
+ testRunner.notifyDone();
+}
+
+var image = new Image();
+image.onload = function() {
+ var canvas = document.querySelector('canvas');
+ canvas.width = image.width;
+ canvas.height = image.height;
+ canvas.getContext('2d').drawImage(image, 0, 0);
+
+ document.body.style.zoom = 1.3;
+
+ canvas.toBlob(function(blob) {
+ var failure = "../../fast/images/resources/rgb-jpeg-red.jpg";
+ if (!blob) {
+ result.src = failure;
+ } else if (blob.type != 'image/webp') {
+ result.src = failure;
+ } else {
+ result.src = URL.createObjectURL(blob);
+ }
+ }, "image/webplossless", 0.2);
+};
+
+image.src = "resources/letters.png";
+</script>

Powered by Google App Engine
This is Rietveld 408576698