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

Unified Diff: LayoutTests/css3/images/pixelated-canvas.html

Issue 336693005: Add image-rendering: pixelated. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Add svg image test Created 6 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
Index: LayoutTests/css3/images/pixelated-canvas.html
diff --git a/LayoutTests/css3/images/optimize-contrast-canvas.html b/LayoutTests/css3/images/pixelated-canvas.html
similarity index 50%
copy from LayoutTests/css3/images/optimize-contrast-canvas.html
copy to LayoutTests/css3/images/pixelated-canvas.html
index f0fc044e7c51b632d85629d7a184d65670d03bcc..9a08b69628d7ab5425a3a0bb8e2580e9cc0b58be 100644
--- a/LayoutTests/css3/images/optimize-contrast-canvas.html
+++ b/LayoutTests/css3/images/pixelated-canvas.html
@@ -1,37 +1,25 @@
-<!DOCTYPE html>
-<style>
- canvas {
- display: block;
- position: fixed;
- left: 0px;
- top: 0px;
- right: 0px;
- bottom: 0px;
- border: none;
- width: 100px;
- height: 100px;
- margin: 0px;
- padding: 0px;
- image-rendering: -webkit-optimize-contrast;
- }
-</style>
-<body>
+<!DOCTYPE html>
+<style>
+ canvas {
+ width: 100px;
+ height: 100px;
+ image-rendering: pixelated;
+ }
+</style>
+<body>
<!-- The resulting image should be 100x100, consisting of 4 50x50 blocks of solid color, with no blurring of edges -->
- <canvas width="2" height="2"></canvas>
-</body>
-<script>
- if (window.testRunner)
- testRunner.dumpAsTextWithPixelResults();
-
- var canvas;
- var imageHandle;
- canvas = document.getElementsByTagName("canvas")[0].getContext("2d");
- canvas.width = 2;
- canvas.height = 2;
- imageHandle = canvas.createImageData(2, 2);
+ <canvas width="2" height="2"></canvas>
+</body>
+<script>
+ var canvas;
+ var imageHandle;
+ canvas = document.getElementsByTagName("canvas")[0].getContext("2d");
+ canvas.width = 2;
+ canvas.height = 2;
+ imageHandle = canvas.createImageData(2, 2);
- var index = 0;
- var length = imageHandle.data.length;
+ var index = 0;
+ var length = imageHandle.data.length;
imageHandle.data[index++] = 255;
imageHandle.data[index++] = 0;
@@ -53,5 +41,5 @@
imageHandle.data[index++] = 0;
imageHandle.data[index++] = 255;
- canvas.putImageData(imageHandle, 0, 0);
-</script>
+ canvas.putImageData(imageHandle, 0, 0);
+</script>
« no previous file with comments | « no previous file | LayoutTests/css3/images/pixelated-canvas-expected.png » ('j') | LayoutTests/css3/images/pixelated-svg-image.html » ('J')

Powered by Google App Engine
This is Rietveld 408576698