mirror of
https://github.com/servo/servo.git
synced 2025-06-06 16:45:39 +00:00
canvas2d: Implement .reset()
(#31258)
* Implement Canvas2D reset * Update WPT tests * Apply suggestions from code review --------- Co-authored-by: Martin Robinson <mrobinson@igalia.com>
This commit is contained in:
parent
29c206a702
commit
b2ae3928ab
106 changed files with 28 additions and 289 deletions
|
@ -74,7 +74,7 @@ impl CanvasRenderingContext2D {
|
|||
self.canvas_state
|
||||
.get_ipc_renderer()
|
||||
.send(CanvasMsg::Recreate(
|
||||
size.to_u64(),
|
||||
Some(size.to_u64()),
|
||||
self.canvas_state.get_canvas_id(),
|
||||
))
|
||||
.unwrap();
|
||||
|
@ -181,6 +181,11 @@ impl CanvasRenderingContext2DMethods for CanvasRenderingContext2D {
|
|||
self.canvas_state.restore()
|
||||
}
|
||||
|
||||
/// <https://html.spec.whatwg.org/multipage/#dom-context-2d-reset>
|
||||
fn Reset(&self) {
|
||||
self.canvas_state.reset()
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/#dom-context-2d-scale
|
||||
fn Scale(&self, x: f64, y: f64) {
|
||||
self.canvas_state.scale(x, y)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue