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

Unified 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, 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 side-by-side diff with in-line comments
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 »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/fast/canvas/canvas-2d-clip-anti-aliasing.html
diff --git a/third_party/WebKit/LayoutTests/fast/canvas/canvas-2d-clip-anti-aliasing.html b/third_party/WebKit/LayoutTests/fast/canvas/canvas-2d-clip-anti-aliasing.html
new file mode 100644
index 0000000000000000000000000000000000000000..1596a6d267c2aba8546f85358e1850986f60f20e
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/fast/canvas/canvas-2d-clip-anti-aliasing.html
@@ -0,0 +1,41 @@
+<!DOCTYPE html>
+
+<script src="../../resources/testharness.js"></script>
+<script src="../../resources/testharnessreport.js"></script>
+<canvas id="myCanvas" width="240" height="240" style="border:1px solid #d3d3d3;"></canvas>
+
+<script>
+
+test(function() {
+ var c = document.getElementById("myCanvas");
+ var ctx = c.getContext("2d");
+
+ ctx.beginPath();
+ ctx.moveTo(120, 20);
+ ctx.lineTo(220, 120);
+ ctx.lineTo(120, 220);
+ ctx.lineTo(20, 120);
+ ctx.lineTo(120, 20);
+ ctx.closePath();
+ ctx.clip();
+
+ ctx.lineWidth = 1;
+ ctx.strokeStyle="#FF0000";
+ ctx.stroke();
+
+ // When canvas clips are not anti-aliased, only the first two segments of
+ // the diamond-shaped closed path are drawn on the canvas.
+ // To check that canvas clip anti-aliasing works fine, we check the
+ // 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
+ var colorData = ctx.getImageData(20, 120, 1, 1).data;
+ assert_equals(colorData[0], 255);
+ assert_equals(colorData[1], 0);
+ assert_equals(colorData[2], 0);
+ assert_not_equals(colorData[3], 0);
+
+}, '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
+
+</script>
+
+
+
« 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