diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/components/main/compositing/mod.rs | 5 | ||||
-rw-r--r-- | src/components/main/constellation.rs | 21 |
2 files changed, 15 insertions, 11 deletions
diff --git a/src/components/main/compositing/mod.rs b/src/components/main/compositing/mod.rs index b13c5cbc8d0..b45cbad2197 100644 --- a/src/components/main/compositing/mod.rs +++ b/src/components/main/compositing/mod.rs @@ -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) => { diff --git a/src/components/main/constellation.rs b/src/components/main/constellation.rs index 7c1c8a1fa50..b5783533da9 100644 --- a/src/components/main/constellation.rs +++ b/src/components/main/constellation.rs @@ -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(); + } + } } |