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

Side by Side Diff: LayoutTests/fast/canvas/script-tests/js-ellipse-implementation.js

Issue 14298022: Add support for new canvas ellipse method. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Make canvas-ellipse-360-winding.html for virtual/gpu pass. Created 7 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 function rad2deg(x) {
2 return x * 180 / Math.PI;
3 }
4
5 function ellipseUsingArc(context, x, y, radiusX, radiusY, rotation, startAngle, endAngle, anticlockwise)
6 {
7 var transform = new WebKitCSSMatrix();
8 transform = transform.translate(x, y);
9 transform = transform.rotate(rad2deg(rotation));
10 transform = transform.scale(radiusX, radiusY);
11
12 /*
13 Use WebKitCSSMatrix instead of as follows, because using WebKitCSSMatrix com putes float values more precisely.
14 It is because we don't want to fail pixel comparison due to float precision.
15 context.translate(x, y);
16 context.rotate(rotation);
17 context.scale(radiusX, radiusY);
18 */
19 context.save();
20 context.transform(transform.a, transform.b, transform.c, transform.d, transf orm.e, transform.f);
21 context.arc(0, 0, 1, startAngle, endAngle, anticlockwise);
22 context.restore();
23 }
24
OLDNEW
« no previous file with comments | « LayoutTests/fast/canvas/script-tests/canvas-ellipse-360-winding.js ('k') | Source/core/html/canvas/CanvasPathMethods.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698