compositing: Use an OptionalIpcSender for communication between the

layout and paint tasks.
This commit is contained in:
Patrick Walton 2015-07-27 14:06:03 -07:00
parent 3be5bbbaa3
commit 1ff7a51f0a
4 changed files with 26 additions and 9 deletions

View file

@ -78,6 +78,7 @@ use style::stylesheets::{Origin, Stylesheet, CSSRuleIteratorExt};
use url::Url;
use util::cursor::Cursor;
use util::geometry::{Au, MAX_RECT, ZERO_POINT};
use util::ipc::OptionalIpcSender;
use util::logical_geometry::{LogicalPoint, WritingMode};
use util::mem::HeapSizeOf;
use util::opts;
@ -187,7 +188,7 @@ pub struct LayoutTask {
pub script_chan: ScriptControlChan,
/// The channel on which messages can be sent to the painting task.
pub paint_chan: Sender<LayoutToPaintMsg>,
pub paint_chan: OptionalIpcSender<LayoutToPaintMsg>,
/// The channel on which messages can be sent to the time profiler.
pub time_profiler_chan: time::ProfilerChan,
@ -227,7 +228,7 @@ impl LayoutTaskFactory for LayoutTask {
constellation_chan: ConstellationChan,
failure_msg: Failure,
script_chan: ScriptControlChan,
paint_chan: Sender<LayoutToPaintMsg>,
paint_chan: OptionalIpcSender<LayoutToPaintMsg>,
image_cache_task: ImageCacheTask,
font_cache_task: FontCacheTask,
time_profiler_chan: time::ProfilerChan,
@ -317,7 +318,7 @@ impl LayoutTask {
pipeline_port: IpcReceiver<LayoutControlMsg>,
constellation_chan: ConstellationChan,
script_chan: ScriptControlChan,
paint_chan: Sender<LayoutToPaintMsg>,
paint_chan: OptionalIpcSender<LayoutToPaintMsg>,
image_cache_task: ImageCacheTask,
font_cache_task: FontCacheTask,
time_profiler_chan: time::ProfilerChan,
@ -647,7 +648,7 @@ impl LayoutTask {
info.failure,
ScriptControlChan(info.script_chan.clone()),
*info.paint_chan
.downcast::<Sender<LayoutToPaintMsg>>()
.downcast::<OptionalIpcSender<LayoutToPaintMsg>>()
.unwrap(),
self.image_cache_task.clone(),
self.font_cache_task.clone(),