mirror of
https://github.com/servo/servo.git
synced 2025-08-03 12:40:06 +01:00
auto merge of #2084 : mbrubeck/servo/navigate-new-pipeline-fix, r=larsbergstrom
After clicking a link to load a new page, the new page content is never painted. This is because the compositor is still sending render messages to old frame tree's pipeline, not the new one. This patch fixes this by ensuring that the compositor's new root layer is attached to the correct pipeline. (Note: You will also need to apply #2080 if you want to test this without crashing.)
This commit is contained in:
commit
2b12be6266
3 changed files with 3 additions and 12 deletions
|
@ -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"),
|
||||
|
|
|
@ -83,13 +83,6 @@ impl RenderListener for CompositorChan {
|
|||
self.chan.send(Paint(pipeline_id, layer_id, layer_buffer_set, epoch))
|
||||
}
|
||||
|
||||
fn create_layer_group_for_pipeline(&self, id: PipelineId, page_size: Size2D<uint>) {
|
||||
let Size2D { width, height } = page_size;
|
||||
self.chan.send(CreateRootCompositorLayerIfNecessary(id,
|
||||
LayerId::null(),
|
||||
Size2D(width as f32, height as f32)))
|
||||
}
|
||||
|
||||
fn initialize_layers_for_pipeline(&self,
|
||||
pipeline_id: PipelineId,
|
||||
metadata: ~[LayerMetadata],
|
||||
|
|
|
@ -121,7 +121,6 @@ pub struct LayerMetadata {
|
|||
/// submit them to be drawn to the display.
|
||||
pub trait RenderListener {
|
||||
fn get_graphics_metadata(&self) -> Option<NativeGraphicsMetadata>;
|
||||
fn create_layer_group_for_pipeline(&self, PipelineId, Size2D<uint>);
|
||||
|
||||
/// Informs the compositor of the layers for the given pipeline. The compositor responds by
|
||||
/// creating and/or destroying render layers as necessary.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue