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

Unified Diff: third_party/WebKit/LayoutTests/fast/canvas/OffscreenCanvas-2d-imageSmoothing-in-worker-expected.html

Issue 2181183003: Expose imageSmothing attributes in OffscreenCanvas 2D context (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fixed layout tests Created 4 years, 5 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: third_party/WebKit/LayoutTests/fast/canvas/OffscreenCanvas-2d-imageSmoothing-in-worker-expected.html
diff --git a/third_party/WebKit/LayoutTests/fast/canvas/OffscreenCanvas-2d-imageSmoothing-in-worker-expected.html b/third_party/WebKit/LayoutTests/fast/canvas/OffscreenCanvas-2d-imageSmoothing-in-worker-expected.html
new file mode 100644
index 0000000000000000000000000000000000000000..437efa58c5b52dd35c2ceaf739dfdf30ee7706aa
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/fast/canvas/OffscreenCanvas-2d-imageSmoothing-in-worker-expected.html
@@ -0,0 +1,38 @@
+<!DOCTYPE html>
+<p>Below this text, there should be a checker pattern that is drawn pixelated, and with low, medium and high filtering quality.</p>
+<canvas id="canvasOutput" width="250" height="50"></canvas>
+<script>
+if (window.testRunner) {
+ testRunner.waitUntilDone();
+}
+var checkerCanvas = document.createElement('canvas');
+checkerCanvas.width = checkerCanvas.height = 5;
+var checkerContext = checkerCanvas.getContext('2d');
+var checkerData = checkerContext.createImageData(5,5);
+for (pixel = 0; pixel < 25; pixel++) {
+ var color = (pixel % 2) * 255;
+ checkerData.data[pixel * 4 + 0] = color;
+ checkerData.data[pixel * 4 + 1] = color;
+ checkerData.data[pixel * 4 + 2] = color;
+ checkerData.data[pixel * 4 + 3] = 255;
+}
+checkerContext.putImageData(checkerData, 0, 0);
+createImageBitmap(checkerCanvas).then(image => {
+ var outputCanvas = document.getElementById('canvasOutput');
+ var ctx = outputCanvas.getContext('2d');
+ ctx.scale(10, 10)
+ ctx.imageSmoothingEnabled = false;
+ ctx.drawImage(image, 0, 0);
+ ctx.imageSmoothingEnabled = true;
+ ctx.imageSmoothingQuality = 'low';
+ ctx.drawImage(image, 6, 0);
+ ctx.imageSmoothingQuality = 'medium';
+ ctx.drawImage(image, 12, 0);
+ ctx.imageSmoothingQuality = 'high';
+ ctx.drawImage(image, 18, 0);
+ if (window.testRunner) {
+ testRunner.notifyDone();
+ }
+});
+</script>
+

Powered by Google App Engine
This is Rietveld 408576698