auto merge of #5185 : mmatyas/servo/canvas_arc, r=pcwalton

This patch enables the use of `arc()` on the canvas.
I couldn't add reftest this time, as it involves some antialiasing issues, and so the reference doesn't match.
This commit is contained in:
bors-servo 2015-03-10 09:45:49 -06:00
commit e8f1a046c6
12 changed files with 19 additions and 47 deletions

View file

@ -160,6 +160,11 @@ impl<'a> CanvasRenderingContext2DMethods for JSRef<'a, CanvasRenderingContext2D>
Point2D(x as f32, y as f32))).unwrap();
}
fn Arc(self, x: f64, y: f64, r: f64, start: f64, end: f64, ccw: bool) {
self.renderer.send(CanvasMsg::Arc(Point2D(x as f32, y as f32), r as f32,
start as f32, end as f32, ccw)).unwrap();
}
fn StrokeStyle(self) -> StringOrCanvasGradientOrCanvasPattern {
// FIXME(pcwalton, #4761): This is not spec-compliant. See:
//

View file

@ -138,7 +138,7 @@ interface CanvasPathMethods {
//void rect(double x, double y, double w, double h);
//void arc(double x, double y, double radius, double startAngle, double endAngle, optional boolean anticlockwise = false);
void arc(double x, double y, double radius, double startAngle, double endAngle, optional boolean anticlockwise = false);
// NOT IMPLEMENTED [LenientFloat] void ellipse(double x, double y, double radiusX, double radiusY, double rotation, double startAngle, double endAngle, boolean anticlockwise);
};