auto merge of #638 : tkuehn/servo/master, r=metajack

... renderers
This commit is contained in:
bors-servo 2013-07-29 23:06:19 -07:00
commit 0acb313c55
2 changed files with 15 additions and 11 deletions

View file

@ -141,7 +141,7 @@ pub enum Msg {
/// Alerts the compositor to the current status of rendering. /// Alerts the compositor to the current status of rendering.
ChangeRenderState(RenderState), ChangeRenderState(RenderState),
/// Sets the channel to the current layout and render tasks, along with their id /// 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. /// Azure surface wrapping to work with the layers infrastructure.
@ -345,8 +345,9 @@ impl CompositorTask {
ChangeReadyState(ready_state) => window.set_ready_state(ready_state), ChangeReadyState(ready_state) => window.set_ready_state(ready_state),
ChangeRenderState(render_state) => window.set_render_state(render_state), ChangeRenderState(render_state) => window.set_render_state(render_state),
SetIds(frame_tree) => { SetIds(frame_tree, response_chan) => {
pipeline = Some(frame_tree.pipeline); pipeline = Some(frame_tree.pipeline);
response_chan.send(());
} }
GetSize(chan) => { GetSize(chan) => {

View file

@ -509,15 +509,12 @@ impl Constellation {
// from a pending frame. The only time that we will grant paint permission is // 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. // 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 |&current_frame| {
// Messages originating in the current frame are not navigations; // Messages originating in the current frame are not navigations;
// TODO(tkuehn): In fact, this kind of message might be provably // TODO(tkuehn): In fact, this kind of message might be provably
// impossible to occur. // impossible to occur.
if current_frame.contains(pipeline_id) { if current_frame.contains(pipeline_id) {
for current_frame.iter().advance |frame| { self.set_ids(current_frame);
frame.pipeline.grant_paint_permission();
}
self.compositor_chan.send(SetIds(current_frame.to_sendable()));
return true; return true;
} }
} }
@ -606,10 +603,7 @@ impl Constellation {
// Grants a frame tree permission to paint; optionally updates navigation to reflect a new page // 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) { fn grant_paint_permission(&mut self, frame_tree: @mut FrameTree) {
// Give permission to paint to the new frame and all child frames // Give permission to paint to the new frame and all child frames
self.compositor_chan.send(SetIds(frame_tree.to_sendable())); self.set_ids(frame_tree);
for frame_tree.iter().advance |frame| {
frame.pipeline.grant_paint_permission();
}
// Don't call navigation_context.load() on a Navigate type (or None, as in the case of // Don't call navigation_context.load() on a Navigate type (or None, as in the case of
// parsed iframes that finish loading) // 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();
}
}
} }