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

Unified Diff: LayoutTests/fast/canvas/canvas-ellipse-zero-lineto.html

Issue 14298022: Add support for new canvas ellipse method. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Match addEllipse impl to addArc style. Add 4 more layout tests. Created 7 years, 5 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
Index: LayoutTests/fast/canvas/canvas-ellipse-zero-lineto.html
diff --git a/LayoutTests/fast/canvas/canvas-ellipse-zero-lineto.html b/LayoutTests/fast/canvas/canvas-ellipse-zero-lineto.html
new file mode 100644
index 0000000000000000000000000000000000000000..acb76d5893c9edc3312f3c8033f53cc2ebce3842
--- /dev/null
+++ b/LayoutTests/fast/canvas/canvas-ellipse-zero-lineto.html
@@ -0,0 +1,67 @@
+<!DOCTYPE html>
+<html>
+<head></head>
+<body>
+<canvas id="mycanvas" width="400" height="400"></canvas>
+<script>
+var canvas = document.getElementById('mycanvas');
+var ctx = canvas.getContext('2d');
+ctx.lineWidth = 4;
+
+// moveTo + empty ellipse (swing == 0)
+ctx.translate(0, 20);
+ctx.save();
+ctx.beginPath();
+ctx.moveTo(20, 0);
+ctx.ellipse(80, 0, 10, 20, Math.PI / 6, -Math.PI / 2, -Math.PI / 2, true);
+ctx.stroke();
+ctx.restore();
+
+// moveTo + empty ellipse (radiusX == 0)
+ctx.translate(0, 20);
+ctx.save();
+ctx.beginPath();
+ctx.moveTo(20, 0);
+ctx.ellipse(80, 0, 0, 20, Math.PI / 6, -Math.PI / 2, Math.PI / 2, false);
+ctx.stroke();
+ctx.restore();
+
+// moveTo + empty ellipse (radiusY == 0)
+ctx.translate(0, 20);
+ctx.save();
+ctx.beginPath();
+ctx.moveTo(20, 0);
+ctx.ellipse(80, 0, 10, 0, Math.PI / 6, -Math.PI / 2, Math.PI / 2, false);
+ctx.stroke();
+ctx.restore();
+
+// empty ellipse (swing == 0) + lineTo
+ctx.translate(0, 20);
+ctx.save();
+ctx.beginPath();
+ctx.ellipse(20, 0, 10, 20, Math.PI / 6, -Math.PI / 2, -Math.PI / 2, false);
+ctx.lineTo(80, 0);
+ctx.stroke();
+ctx.restore();
+
+// empty ellipse (radiusX == 0) + lineTo
+ctx.translate(0, 20);
+ctx.save();
+ctx.beginPath();
+ctx.ellipse(20, 0, 0, 20, Math.PI / 6, -Math.PI / 2, Math.PI / 2, false);
+ctx.lineTo(80, 0);
+ctx.stroke();
+ctx.restore();
+
+// empty ellipse (radiusY == 0) + lineTo
+ctx.translate(0, 20);
+ctx.save();
+ctx.beginPath();
+ctx.ellipse(20, 0, 10, 0, Math.PI / 6, -Math.PI / 2, Math.PI / 2, false);
+ctx.lineTo(80, 0);
+ctx.stroke();
+ctx.restore();
+
+</script>
+</body>
+</html>

Powered by Google App Engine
This is Rietveld 408576698