Don't reuse an old pipeline for a new root layer

When navigating to a new URL, we need to make sure compositor messages go to
the new page's pipeline, not the previous one.
This commit is contained in:
Matt Brubeck 2014-04-09 20:07:16 -07:00
parent 9c3875ead5
commit 3231f12708

View file

@ -354,16 +354,15 @@ impl IOCompositor {
self.constellation_chan = new_constellation_chan;
}
// FIXME(pcwalton): Take the pipeline ID into account.
fn create_root_compositor_layer_if_necessary(&mut self,
_: PipelineId,
id: PipelineId,
layer_id: LayerId,
size: Size2D<f32>) {
let (root_pipeline, root_layer_id) = match self.compositor_layer {
Some(ref compositor_layer) => {
Some(ref compositor_layer) if compositor_layer.pipeline.id == id => {
(compositor_layer.pipeline.clone(), compositor_layer.id_of_first_child())
}
None => {
_ => {
match self.root_pipeline {
Some(ref root_pipeline) => (root_pipeline.clone(), LayerId::null()),
None => fail!("Compositor: Received new layer without initialized pipeline"),