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

Side by Side Diff: LayoutTests/fast/canvas/pixelated.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;
Justin Novosad 2014/11/18 16:32:50 This is larger than the area that is captured by t
jackhou1 2014/12/01 07:00:08 Ah, I wanted the canvas to be larger than 256x257
Stephen White 2014/12/01 15:53:48 As you probably know, the layout tests will automa
jackhou1 2014/12/02 00:50:48 Done.
8 height: 1000px;
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 .canvas2 {
24 position: absolute;
25 top: 500px;
26 left: 500px;
27 z-index: 2;
28 image-rendering: auto;
29 }
30 </style>
31 <body>
32 <img src="resources/dice_alpha.png">
33 <!-- Test that gpu accelerated canvases work with pixelated. -->
34 <!-- Canvases should be overlaid at an offset. Only the middle one should be blurred. -->
35 <canvas class="canvas0" width="300" height="300"></canvas>
36 <canvas class="canvas1" width="300" height="300"></canvas>
37 <canvas class="canvas2" width="300" height="300"></canvas>
38 </body>
39 <script>
40 // Ignore the render tree.
41 if (window.testRunner)
42 window.testRunner.dumpAsTextWithPixelResults();
43
44 var image = document.getElementsByTagName("img")[0];
45
46 function drawToCanvas(canvas) {
47 canvas.getContext("2d").drawImage(image, -0.5, -0.5, 300, 300);
48 }
49
50 function draw() {
51 drawToCanvas(document.getElementsByTagName("canvas")[0]);
52 var canvas1 = document.getElementsByTagName("canvas")[1];
53 var canvas2 = document.getElementsByTagName("canvas")[2];
54 drawToCanvas(canvas1);
55 drawToCanvas(canvas2);
56 // The first canvas stays pixelated. Flip the pixelated-ness of the
57 // other two.
58 canvas1.style.imageRendering = "auto";
59 canvas2.style.imageRendering = "pixelated";
60 }
61 window.onload = draw;
62 </script>
OLDNEW
« no previous file with comments | « no previous file | LayoutTests/fast/canvas/pixelated-canvas.html » ('j') | LayoutTests/fast/canvas/pixelated-canvas.html » ('J')

Powered by Google App Engine
This is Rietveld 408576698