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

Side by Side Diff: LayoutTests/fast/canvas/pixelated-canvas.html

Issue 562583002: Implement image-rendering:pixelated for accelerated 2D canvases. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Remove printfs, update test comments. Created 6 years, 1 month 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 unified diff | Download patch
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <style>
3 img {
4 display: none;
5 }
6 canvas {
7 width: 1000px;
8 height: 1000px;
Justin Novosad 2014/11/18 16:32:50 Too large for layout tests.
jackhou1 2014/12/01 07:00:08 Done.
9 image-rendering: pixelated;
10 }
11 .canvas0 {
12 position: absolute;
13 top: 0;
14 left: 0;
15 z-index: 0;
16 }
17 .canvas1 {
18 position: absolute;
19 top: 250px;
20 left: 250px;
21 z-index: 1;
22 }
23 </style>
24 <body>
25 <img src="resources/dice_alpha.png">
26 <!-- Test that drawing a pixelated canvas with another pixelated canvas as s ource works. -->
27 <!-- One canvas should be overlaid on the other at an offset. Both canvases should be upscaled without blurring. -->
28 <canvas class="canvas0" width="300" height="300"></canvas>
29 <canvas class="canvas1" width="300" height="300"></canvas>
30 </body>
31 <script>
32 // Ignore the render tree.
33 if (window.testRunner)
34 window.testRunner.dumpAsTextWithPixelResults();
35
36 function draw() {
37 var image = document.getElementsByTagName("img")[0];
38 var canvas0 = document.getElementsByTagName("canvas")[0];
39 var canvas1 = document.getElementsByTagName("canvas")[1];
40 canvas0.getContext("2d").drawImage(image, -0.5, -0.5, 300, 300);
41 canvas1.getContext("2d").drawImage(canvas0, -0.5, -0.5, 300, 300);
42 }
43 window.onload = draw;
44 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698