mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Implement Ellipse Canvas 2D API
* Update rust-azure to 0.21.0 * Mark the following test case as fail: tests/wpt/mozilla/tests/mozilla/css-paint-api/background-image-tiled.html * Make the ellipse test case pass. BUG: https://github.com/servo/servo/issues/17598
This commit is contained in:
parent
ac7cf53692
commit
57e283aaab
8 changed files with 52 additions and 16 deletions
|
@ -173,6 +173,9 @@ impl<'a> CanvasPaintThread<'a> {
|
|||
Canvas2dMsg::ArcTo(ref cp1, ref cp2, radius) => {
|
||||
painter.arc_to(cp1, cp2, radius)
|
||||
}
|
||||
Canvas2dMsg::Ellipse(ref center, radius_x, radius_y, rotation, start, end, ccw) => {
|
||||
painter.ellipse(center, radius_x, radius_y, rotation, start, end, ccw)
|
||||
}
|
||||
Canvas2dMsg::RestoreContext => painter.restore_context_state(),
|
||||
Canvas2dMsg::SaveContext => painter.save_context_state(),
|
||||
Canvas2dMsg::SetFillStyle(style) => painter.set_fill_style(style),
|
||||
|
@ -501,6 +504,17 @@ impl<'a> CanvasPaintThread<'a> {
|
|||
}
|
||||
}
|
||||
|
||||
fn ellipse(&mut self,
|
||||
center: &Point2D<AzFloat>,
|
||||
radius_x: AzFloat,
|
||||
radius_y: AzFloat,
|
||||
rotation_angle: AzFloat,
|
||||
start_angle: AzFloat,
|
||||
end_angle: AzFloat,
|
||||
ccw: bool) {
|
||||
self.path_builder.ellipse(*center, radius_x, radius_y, rotation_angle, start_angle, end_angle, ccw);
|
||||
}
|
||||
|
||||
fn set_fill_style(&mut self, style: FillOrStrokeStyle) {
|
||||
if let Some(pattern) = style.to_azure_pattern(&self.drawtarget) {
|
||||
self.state.fill_style = pattern
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue