From acc0daa519ce3737624d9e047634feec61379c09 Mon Sep 17 00:00:00 2001 From: Cameron Zwarich Date: Thu, 10 Jul 2014 01:31:48 -0700 Subject: [PATCH] Make the CompositorTask Paint message take multiple replies --- src/components/compositing/compositor.rs | 7 ++++--- src/components/compositing/compositor_task.rs | 6 ++---- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/src/components/compositing/compositor.rs b/src/components/compositing/compositor.rs index 38cfdf5e46f..c9aa14cee14 100644 --- a/src/components/compositing/compositor.rs +++ b/src/components/compositing/compositor.rs @@ -303,9 +303,10 @@ impl IOCompositor { self.set_layer_clip_rect(pipeline_id, layer_id, new_rect); } - (Ok(Paint(pipeline_id, layer_id, new_layer_buffer_set, epoch)), - NotShuttingDown) => { - self.paint(pipeline_id, layer_id, new_layer_buffer_set, epoch); + (Ok(Paint(pipeline_id, epoch, replies)), NotShuttingDown) => { + for (layer_id, new_layer_buffer_set) in replies.move_iter() { + self.paint(pipeline_id, layer_id, new_layer_buffer_set, epoch); + } } (Ok(ScrollFragmentPoint(pipeline_id, layer_id, point)), NotShuttingDown) => { diff --git a/src/components/compositing/compositor_task.rs b/src/components/compositing/compositor_task.rs index 888fc650767..b4ffaa6ba81 100644 --- a/src/components/compositing/compositor_task.rs +++ b/src/components/compositing/compositor_task.rs @@ -98,9 +98,7 @@ impl RenderListener for CompositorChan { pipeline_id: PipelineId, epoch: Epoch, replies: Vec<(LayerId, Box)>) { - for (layer_id, layer_buffer_set) in replies.move_iter() { - self.chan.send(Paint(pipeline_id, layer_id, layer_buffer_set, epoch)) - } + self.chan.send(Paint(pipeline_id, epoch, replies)); } fn initialize_layers_for_pipeline(&self, @@ -181,7 +179,7 @@ pub enum Msg { /// Scroll a page in a window ScrollFragmentPoint(PipelineId, LayerId, Point2D), /// Requests that the compositor paint the given layer buffer set for the given page size. - Paint(PipelineId, LayerId, Box, Epoch), + Paint(PipelineId, Epoch, Vec<(LayerId, Box)>), /// Alerts the compositor to the current status of page loading. ChangeReadyState(ReadyState), /// Alerts the compositor to the current status of rendering.