mirror of
https://github.com/servo/servo.git
synced 2025-08-05 05:30:08 +01:00
commit
0acb313c55
2 changed files with 15 additions and 11 deletions
|
@ -141,7 +141,7 @@ pub enum Msg {
|
|||
/// Alerts the compositor to the current status of rendering.
|
||||
ChangeRenderState(RenderState),
|
||||
/// Sets the channel to the current layout and render tasks, along with their id
|
||||
SetIds(SendableFrameTree),
|
||||
SetIds(SendableFrameTree, Chan<()>),
|
||||
}
|
||||
|
||||
/// Azure surface wrapping to work with the layers infrastructure.
|
||||
|
@ -345,8 +345,9 @@ impl CompositorTask {
|
|||
ChangeReadyState(ready_state) => window.set_ready_state(ready_state),
|
||||
ChangeRenderState(render_state) => window.set_render_state(render_state),
|
||||
|
||||
SetIds(frame_tree) => {
|
||||
SetIds(frame_tree, response_chan) => {
|
||||
pipeline = Some(frame_tree.pipeline);
|
||||
response_chan.send(());
|
||||
}
|
||||
|
||||
GetSize(chan) => {
|
||||
|
|
|
@ -509,15 +509,12 @@ impl Constellation {
|
|||
// from a pending frame. The only time that we will grant paint permission is
|
||||
// when the message originates from a pending frame or the current frame.
|
||||
|
||||
for self.current_frame().iter().advance |current_frame| {
|
||||
for self.current_frame().iter().advance |¤t_frame| {
|
||||
// Messages originating in the current frame are not navigations;
|
||||
// TODO(tkuehn): In fact, this kind of message might be provably
|
||||
// impossible to occur.
|
||||
if current_frame.contains(pipeline_id) {
|
||||
for current_frame.iter().advance |frame| {
|
||||
frame.pipeline.grant_paint_permission();
|
||||
}
|
||||
self.compositor_chan.send(SetIds(current_frame.to_sendable()));
|
||||
self.set_ids(current_frame);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
@ -606,10 +603,7 @@ impl Constellation {
|
|||
// Grants a frame tree permission to paint; optionally updates navigation to reflect a new page
|
||||
fn grant_paint_permission(&mut self, frame_tree: @mut FrameTree) {
|
||||
// Give permission to paint to the new frame and all child frames
|
||||
self.compositor_chan.send(SetIds(frame_tree.to_sendable()));
|
||||
for frame_tree.iter().advance |frame| {
|
||||
frame.pipeline.grant_paint_permission();
|
||||
}
|
||||
self.set_ids(frame_tree);
|
||||
|
||||
// Don't call navigation_context.load() on a Navigate type (or None, as in the case of
|
||||
// parsed iframes that finish loading)
|
||||
|
@ -629,5 +623,14 @@ impl Constellation {
|
|||
_ => {}
|
||||
}
|
||||
}
|
||||
|
||||
fn set_ids(&self, frame_tree: @mut FrameTree) {
|
||||
let (port, chan) = comm::stream();
|
||||
self.compositor_chan.send(SetIds(frame_tree.to_sendable(), chan));
|
||||
port.recv();
|
||||
for frame_tree.iter().advance |frame| {
|
||||
frame.pipeline.grant_paint_permission();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue