Send IPC receiver for canvas as part of CreateCanvasPaintThread message

This commit is contained in:
tigercosmos 2017-12-12 15:20:04 +08:00
parent 22472b4db4
commit a504c9358b
4 changed files with 13 additions and 18 deletions

View file

@ -129,11 +129,10 @@ impl CanvasRenderingContext2D {
size: Size2D<i32>)
-> CanvasRenderingContext2D {
debug!("Creating new canvas rendering context.");
let (sender, receiver) = ipc::channel().unwrap();
let (ipc_renderer, receiver) = ipc::channel::<CanvasMsg>().unwrap();
let script_to_constellation_chan = global.script_to_constellation_chan();
debug!("Asking constellation to create new canvas thread.");
script_to_constellation_chan.send(ScriptMsg::CreateCanvasPaintThread(size, sender)).unwrap();
let ipc_renderer = receiver.recv().unwrap();
script_to_constellation_chan.send(ScriptMsg::CreateCanvasPaintThread(size, receiver)).unwrap();
debug!("Done.");
CanvasRenderingContext2D {
reflector_: Reflector::new(),