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

Side by Side 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: Set GL_NEAREST on the texture, invalidate the ImageBuffer and reconstruct the TextureMailbox when f… 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;
9 image-rendering: pixelated;
10 }
11 </style>
12 <body>
13 <img src="resources/dice_alpha.png">
14 <!-- -->
15 <canvas width="300" height="300"></canvas>
16 </body>
17 <script>
18 // Ignore the render tree.
19 if (window.testRunner)
20 window.testRunner.dumpAsTextWithPixelResults();
21
22 var image = document.getElementsByTagName("img")[0];
23
24 function draw() {
25 var canvas = document.getElementsByTagName("canvas")[0];
26 var context = canvas.getContext("2d");
27 context.drawImage(image, -0.5, -0.5, 300, 300);
28 // Resize so that the image buffer is reset.
29 canvas.width = 301;
30 canvas.style.width = "1001px";
31 context.drawImage(image, -0.5, -0.5, 300, 300);
32 }
33 window.onload = draw;
34 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698