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

Side by Side Diff: LayoutTests/css3/images/pixelated-canvas-composited.html

Issue 562583002: Implement image-rendering:pixelated for accelerated 2D canvases. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Change setNearestNeighbor to setFilterLevel, use SkPaint::FilterLevel. Created 6 years, 3 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 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;
9 image-rendering: pixelated;
10 }
11 .under {
12 position: absolute;
13 top: 0;
14 left: 0;
15 z-index: 1;
16 }
17 .over {
18 position: absolute;
19 top: 250px;
20 left: 250px;
21 z-index: 2;
22 }
23 </style>
24 <body>
25 <img src="resources/dice_alpha.png">
26 <!-- One canvas should be overlaid on the other at an offset. Both canvases should be upscaled without blurring. -->
27 <canvas class="under" width="300" height="300"></canvas>
28 <canvas class="over" width="300" height="300"></canvas>
29 </body>
30 <script>
31 // Ignore the render tree.
32 if (window.testRunner)
33 window.testRunner.dumpAsTextWithPixelResults();
34
35 var image = document.getElementsByTagName("img")[0];
36
37 function drawToContext(context) {
38 context.drawImage(image, -0.5, -0.5, 300, 300);
39 }
40
41 function draw() {
42 drawToContext(document.getElementsByTagName("canvas")[0].getContext("2d" ));
43 drawToContext(document.getElementsByTagName("canvas")[1].getContext("2d" ));
44 }
45 window.onload = draw;
46 </script>
OLDNEW
« no previous file with comments | « no previous file | LayoutTests/css3/images/pixelated-canvas-webgl.html » ('j') | Source/core/html/HTMLCanvasElement.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698