mirror of
https://github.com/servo/servo.git
synced 2025-07-22 23:03:42 +01:00
Remove Canvas2dMsg::DrawImageSelf
Now that all canvas share the same thread, it's useless to have a separate message for that.
This commit is contained in:
parent
9f7b746430
commit
36c8cd229e
4 changed files with 11 additions and 51 deletions
|
@ -361,25 +361,13 @@ impl CanvasRenderingContext2D {
|
|||
if let Some(context) = canvas.context() {
|
||||
match *context {
|
||||
CanvasContext::Context2d(ref context) => {
|
||||
if self.canvas.as_ref().map_or(false, |c| &**c == canvas) {
|
||||
self.send_canvas_2d_msg(Canvas2dMsg::DrawImageSelf(
|
||||
image_size,
|
||||
dest_rect,
|
||||
source_rect,
|
||||
smoothing_enabled,
|
||||
));
|
||||
} else {
|
||||
context.get_ipc_renderer().send(CanvasMsg::Canvas2d(
|
||||
Canvas2dMsg::DrawImageInOther(
|
||||
self.get_canvas_id(),
|
||||
image_size,
|
||||
dest_rect,
|
||||
source_rect,
|
||||
smoothing_enabled,
|
||||
),
|
||||
context.get_canvas_id(),
|
||||
)).unwrap();
|
||||
}
|
||||
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