mirror of
https://github.com/servo/servo.git
synced 2025-08-05 13:40:08 +01:00
implement clone for embedder and compositor proxies
This commit is contained in:
parent
01c24e017d
commit
6bca3402a6
4 changed files with 14 additions and 8 deletions
|
@ -27,7 +27,7 @@ impl GLContextFactory {
|
||||||
if cfg!(target_os = "windows") {
|
if cfg!(target_os = "windows") {
|
||||||
// Used to dispatch functions from the GLContext thread to the main thread's event loop.
|
// Used to dispatch functions from the GLContext thread to the main thread's event loop.
|
||||||
// Required to allow WGL GLContext sharing in Windows.
|
// Required to allow WGL GLContext sharing in Windows.
|
||||||
GLContextFactory::Native(handle, Some(MainThreadDispatcher::new(proxy.clone_compositor_proxy())))
|
GLContextFactory::Native(handle, Some(MainThreadDispatcher::new(proxy.clone())))
|
||||||
} else {
|
} else {
|
||||||
GLContextFactory::Native(handle, None)
|
GLContextFactory::Native(handle, None)
|
||||||
}
|
}
|
||||||
|
|
|
@ -43,7 +43,10 @@ impl EmbedderProxy {
|
||||||
}
|
}
|
||||||
self.event_loop_waker.wake();
|
self.event_loop_waker.wake();
|
||||||
}
|
}
|
||||||
pub fn clone_embedder_proxy(&self) -> EmbedderProxy {
|
}
|
||||||
|
|
||||||
|
impl Clone for EmbedderProxy {
|
||||||
|
fn clone(&self) -> EmbedderProxy {
|
||||||
EmbedderProxy {
|
EmbedderProxy {
|
||||||
sender: self.sender.clone(),
|
sender: self.sender.clone(),
|
||||||
event_loop_waker: self.event_loop_waker.clone(),
|
event_loop_waker: self.event_loop_waker.clone(),
|
||||||
|
@ -79,7 +82,10 @@ impl CompositorProxy {
|
||||||
}
|
}
|
||||||
self.event_loop_waker.wake();
|
self.event_loop_waker.wake();
|
||||||
}
|
}
|
||||||
pub fn clone_compositor_proxy(&self) -> CompositorProxy {
|
}
|
||||||
|
|
||||||
|
impl Clone for CompositorProxy {
|
||||||
|
fn clone(&self) -> CompositorProxy {
|
||||||
CompositorProxy {
|
CompositorProxy {
|
||||||
sender: self.sender.clone(),
|
sender: self.sender.clone(),
|
||||||
event_loop_waker: self.event_loop_waker.clone(),
|
event_loop_waker: self.event_loop_waker.clone(),
|
||||||
|
|
|
@ -699,7 +699,7 @@ impl<Message, LTF, STF> Constellation<Message, LTF, STF>
|
||||||
},
|
},
|
||||||
layout_to_constellation_chan: self.layout_sender.clone(),
|
layout_to_constellation_chan: self.layout_sender.clone(),
|
||||||
scheduler_chan: self.scheduler_chan.clone(),
|
scheduler_chan: self.scheduler_chan.clone(),
|
||||||
compositor_proxy: self.compositor_proxy.clone_compositor_proxy(),
|
compositor_proxy: self.compositor_proxy.clone(),
|
||||||
devtools_chan: self.devtools_chan.clone(),
|
devtools_chan: self.devtools_chan.clone(),
|
||||||
bluetooth_thread: self.bluetooth_thread.clone(),
|
bluetooth_thread: self.bluetooth_thread.clone(),
|
||||||
swmanager_thread: self.swmanager_sender.clone(),
|
swmanager_thread: self.swmanager_sender.clone(),
|
||||||
|
@ -1694,7 +1694,7 @@ impl<Message, LTF, STF> Constellation<Message, LTF, STF>
|
||||||
Some((parent_pipeline_id, frame_type)),
|
Some((parent_pipeline_id, frame_type)),
|
||||||
script_sender,
|
script_sender,
|
||||||
layout_sender,
|
layout_sender,
|
||||||
self.compositor_proxy.clone_compositor_proxy(),
|
self.compositor_proxy.clone(),
|
||||||
is_private || parent_pipeline.is_private,
|
is_private || parent_pipeline.is_private,
|
||||||
url.clone(),
|
url.clone(),
|
||||||
parent_pipeline.visible)
|
parent_pipeline.visible)
|
||||||
|
@ -1998,7 +1998,7 @@ impl<Message, LTF, STF> Constellation<Message, LTF, STF>
|
||||||
},
|
},
|
||||||
None => {
|
None => {
|
||||||
let event = EmbedderMsg::KeyEvent(None, ch, key, state, mods);
|
let event = EmbedderMsg::KeyEvent(None, ch, key, state, mods);
|
||||||
self.embedder_proxy.clone_embedder_proxy().send(event);
|
self.embedder_proxy.clone().send(event);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -213,8 +213,8 @@ impl<Window> Servo<Window> where Window: WindowMethods + 'static {
|
||||||
// as the navigation context.
|
// as the navigation context.
|
||||||
let (constellation_chan, sw_senders) = create_constellation(opts.user_agent.clone(),
|
let (constellation_chan, sw_senders) = create_constellation(opts.user_agent.clone(),
|
||||||
opts.config_dir.clone(),
|
opts.config_dir.clone(),
|
||||||
embedder_proxy.clone_embedder_proxy(),
|
embedder_proxy.clone(),
|
||||||
compositor_proxy.clone_compositor_proxy(),
|
compositor_proxy.clone(),
|
||||||
time_profiler_chan.clone(),
|
time_profiler_chan.clone(),
|
||||||
mem_profiler_chan.clone(),
|
mem_profiler_chan.clone(),
|
||||||
debugger_chan,
|
debugger_chan,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue