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

Unified Diff: LayoutTests/fast/canvas/downsample-quality.html

Issue 1176073003: Improve filtering quality of images downsampled in 2d canvas (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: re-add test Created 5 years, 6 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
« no previous file with comments | « LayoutTests/TestExpectations ('k') | Source/core/html/canvas/CanvasRenderingContext2DState.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/fast/canvas/downsample-quality.html
diff --git a/LayoutTests/fast/canvas/downsample-quality.html b/LayoutTests/fast/canvas/downsample-quality.html
new file mode 100644
index 0000000000000000000000000000000000000000..ed2f31d6e66c36874f2b11ef1c24992d738b693b
--- /dev/null
+++ b/LayoutTests/fast/canvas/downsample-quality.html
@@ -0,0 +1,32 @@
+<canvas id="c1" width="100" height="100"></canvas>
+<canvas id="c2" width="100" height="100"></canvas>
+<script>
+// This test should show two side-by-side thin circle outlines
+// with good visual quality, i.e. no aliasing from image downsampling.
+// Both circles should look identical.
+
+if (window.testRunner) {
+ testRunner.dumpAsTextWithPixelResults();
+ testRunner.waitUntilDone();
+}
+
+var offscreenCanvas = document.createElement('canvas');
+offscreenCanvas.width = 500;
+offscreenCanvas.height = 500;
+var offscreenContext = offscreenCanvas.getContext('2d');
+offscreenContext.beginPath()
+offscreenContext.arc(250, 250, 200, 0, 2 * Math.PI, false);
+offscreenContext.lineWidth = 3;
+offscreenContext.stroke();
+
+var dstCtx = document.getElementById('c1').getContext('2d');
+dstCtx.drawImage(offscreenCanvas, 0, 0, 500, 500, 0, 0, 100, 100);
+
+var srcImage = new Image();
+srcImage.src = offscreenCanvas.toDataURL();
+srcImage.onload = function() {
+ dstCtx = document.getElementById('c2').getContext('2d');
+ dstCtx.drawImage(srcImage, 0, 0, 500, 500, 0, 0, 100, 100);
+ testRunner.notifyDone();
+}
+</script>
« no previous file with comments | « LayoutTests/TestExpectations ('k') | Source/core/html/canvas/CanvasRenderingContext2DState.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698