servo: Merge #2084 - Fix rendering of new pages after navigating (from mbrubeck: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.)

Source-Repo: https://github.com/servo/servo
Source-Revision: 2b12be6266262e3ae2fa8e0fa78f98ddcf6cc549
This commit is contained in:
Matt Brubeck 2014-04-10 11:43:32 -04:00
Родитель b015bf92d4
Коммит 86eec032fb
3 изменённых файлов: 3 добавлений и 12 удалений

Просмотреть файл

@ -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.