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

Unified Diff: LayoutTests/fast/canvas/pixelated-resize.html

Issue 562583002: Implement image-rendering:pixelated for accelerated 2D canvases. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Don't call setImageInterpolationQuality Created 6 years 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/pixelated-resize.html
diff --git a/LayoutTests/fast/canvas/pixelated-resize.html b/LayoutTests/fast/canvas/pixelated-resize.html
new file mode 100644
index 0000000000000000000000000000000000000000..723a0d5fb9914ec050952c15eccbb25f20b05122
--- /dev/null
+++ b/LayoutTests/fast/canvas/pixelated-resize.html
@@ -0,0 +1,37 @@
+<!DOCTYPE html>
+<style>
+ img {
+ display: none;
+ }
+ canvas {
+ width: 100px;
+ height: 100px;
+ image-rendering: pixelated;
+ }
+</style>
+<body>
+ <img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAIAAAACCAYAAABytg0kAAAAFElEQVQIHWP4z8DwHwyBNJDN8B8AQNEG+t5Ik2kAAAAASUVORK5CYII=">
+ <!-- Test that resizing a pixelated canvas works. -->
+ <!-- The canvas should be upscaled without blurring. -->
+ <canvas width="4" height="4"></canvas>
+</body>
+<script>
+ // Ignore the render tree.
+ if (window.testRunner)
+ window.testRunner.dumpAsTextWithPixelResults();
+
+ function drawToCanvas(canvas) {
+ var ctx = canvas.getContext("2d")
+ ctx.drawImage(document.getElementsByTagName("img")[0], 1, 1);
+ }
+
+ function draw() {
+ var canvas = document.getElementsByTagName("canvas")[0];
+ drawToCanvas(canvas);
+ // Resize so that the image buffer is reset.
+ canvas.width = 5;
+ canvas.style.width = "201px";
+ drawToCanvas(canvas);
+ }
+ window.onload = draw;
+</script>
« no previous file with comments | « LayoutTests/fast/canvas/pixelated-off-screen-expected.html ('k') | LayoutTests/fast/canvas/pixelated-resize-expected.png » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698