mirror of
https://github.com/servo/servo.git
synced 2025-07-23 23:33:43 +01:00
Do not assume OffscreenCanvasContext
to be 2d (#35629)
Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
This commit is contained in:
parent
6062995636
commit
e887e621f8
3 changed files with 30 additions and 18 deletions
|
@ -524,13 +524,19 @@ impl CanvasState {
|
|||
));
|
||||
},
|
||||
CanvasContext::Placeholder(ref context) => {
|
||||
context.send_canvas_2d_msg(Canvas2dMsg::DrawImageInOther(
|
||||
self.get_canvas_id(),
|
||||
image_size,
|
||||
dest_rect,
|
||||
source_rect,
|
||||
smoothing_enabled,
|
||||
));
|
||||
let Some(context) = context.context() else {
|
||||
return Err(Error::InvalidState);
|
||||
};
|
||||
match *context {
|
||||
OffscreenCanvasContext::OffscreenContext2d(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),
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue