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

Side by Side Diff: third_party/WebKit/LayoutTests/fast/canvas/canvas-2d-clip-anti-aliasing.html

Issue 2359843003: Turning on clip anti-aliasing by default in Chrome. (Closed)
Patch Set: Addressing comments from patch set 3. Created 4 years, 2 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
« no previous file with comments | « content/renderer/render_view_impl.cc ('k') | third_party/WebKit/Source/core/frame/Settings.in » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 <!DOCTYPE html>
2
3 <script src="../../resources/testharness.js"></script>
4 <script src="../../resources/testharnessreport.js"></script>
5 <canvas id="myCanvas" width="240" height="240" style="border:1px solid #d3d3d3;" ></canvas>
6
7 <script>
8
9 test(function() {
10 var c = document.getElementById("myCanvas");
11 var ctx = c.getContext("2d");
12
13 ctx.beginPath();
14 ctx.moveTo(120, 20);
15 ctx.lineTo(220, 120);
16 ctx.lineTo(120, 220);
17 ctx.lineTo(20, 120);
18 ctx.lineTo(120, 20);
19 ctx.closePath();
20 ctx.clip();
21
22 ctx.lineWidth = 1;
23 ctx.strokeStyle="#FF0000";
24 ctx.stroke();
25
26 // When canvas clips are not anti-aliased, only the first two segments of
27 // the diamond-shaped closed path are drawn on the canvas.
28 // To check that canvas clip anti-aliasing works fine, we check the
29 // junction of the third and fourth segments of the path.
Justin Novosad 2016/09/22 19:15:18 You should check multiple points. you never know h
30 var colorData = ctx.getImageData(20, 120, 1, 1).data;
31 assert_equals(colorData[0], 255);
32 assert_equals(colorData[1], 0);
33 assert_equals(colorData[2], 0);
34 assert_not_equals(colorData[3], 0);
35
36 }, 'canvas-2d-clip-anti-aliasing should not return any error');
Justin Novosad 2016/09/22 19:15:18 The description you put here should describe what
37
38 </script>
39
40
41
OLDNEW
« no previous file with comments | « content/renderer/render_view_impl.cc ('k') | third_party/WebKit/Source/core/frame/Settings.in » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698