mirror of
https://github.com/servo/servo.git
synced 2025-07-22 23:03:42 +01:00
Implement HTMLCanvasElement.transferControlToOffscreen (#34959)
This follows the spec by introducing a new "Placeholder" canvas context mode. The underlying offscreen canvas is kept accessible from the DOM element to allow for the drawImage() implementation to work with canvases that have transfered their control. Signed-off-by: webbeef <me@webbeef.org>
This commit is contained in:
parent
90c5685d61
commit
c936dd6c4e
8 changed files with 139 additions and 42 deletions
|
@ -529,6 +529,15 @@ impl CanvasState {
|
|||
smoothing_enabled,
|
||||
));
|
||||
},
|
||||
CanvasContext::Placeholder(ref context) => {
|
||||
context.send_canvas_2d_msg(Canvas2dMsg::DrawImageInOther(
|
||||
self.get_canvas_id(),
|
||||
image_size,
|
||||
dest_rect,
|
||||
source_rect,
|
||||
smoothing_enabled,
|
||||
));
|
||||
},
|
||||
_ => return Err(Error::InvalidState),
|
||||
}
|
||||
} else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue