mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +01:00
Replace almost "render" to "paint" in compositing crate.
This doesn't touch some "render" words which are used as general means.
This commit is contained in:
parent
f04c64f500
commit
8cee554898
5 changed files with 63 additions and 63 deletions
|
@ -19,7 +19,7 @@ use servo_net::storage_task::StorageTask;
|
|||
use servo_util::time::TimeProfilerChan;
|
||||
use std::rc::Rc;
|
||||
|
||||
/// A uniquely-identifiable pipeline of script task, layout task, and render task.
|
||||
/// A uniquely-identifiable pipeline of script task, layout task, and paint task.
|
||||
pub struct Pipeline {
|
||||
pub id: PipelineId,
|
||||
pub subpage_id: Option<SubpageId>,
|
||||
|
@ -27,7 +27,7 @@ pub struct Pipeline {
|
|||
pub layout_chan: LayoutControlChan,
|
||||
pub paint_chan: PaintChan,
|
||||
pub layout_shutdown_port: Receiver<()>,
|
||||
pub render_shutdown_port: Receiver<()>,
|
||||
pub paint_shutdown_port: Receiver<()>,
|
||||
/// The most recently loaded page
|
||||
pub load_data: LoadData,
|
||||
}
|
||||
|
@ -41,7 +41,7 @@ pub struct CompositionPipeline {
|
|||
}
|
||||
|
||||
impl Pipeline {
|
||||
/// Starts a render task, layout task, and possibly a script task.
|
||||
/// Starts a paint task, layout task, and possibly a script task.
|
||||
/// Returns the channels wrapped in a struct.
|
||||
/// If script_pipeline is not None, then subpage_id must also be not None.
|
||||
pub fn create<LTF:LayoutTaskFactory, STF:ScriptTaskFactory>(
|
||||
|
@ -60,8 +60,8 @@ impl Pipeline {
|
|||
load_data: LoadData)
|
||||
-> Pipeline {
|
||||
let layout_pair = ScriptTaskFactory::create_layout_channel(None::<&mut STF>);
|
||||
let (render_port, paint_chan) = PaintChan::new();
|
||||
let (render_shutdown_chan, render_shutdown_port) = channel();
|
||||
let (paint_port, paint_chan) = PaintChan::new();
|
||||
let (paint_shutdown_chan, paint_shutdown_port) = channel();
|
||||
let (layout_shutdown_chan, layout_shutdown_port) = channel();
|
||||
let (pipeline_chan, pipeline_port) = channel();
|
||||
|
||||
|
@ -103,13 +103,13 @@ impl Pipeline {
|
|||
};
|
||||
|
||||
PaintTask::create(id,
|
||||
render_port,
|
||||
paint_port,
|
||||
compositor_proxy,
|
||||
constellation_chan.clone(),
|
||||
font_cache_task.clone(),
|
||||
failure.clone(),
|
||||
time_profiler_chan.clone(),
|
||||
render_shutdown_chan);
|
||||
paint_shutdown_chan);
|
||||
|
||||
LayoutTaskFactory::create(None::<&mut LTF>,
|
||||
id,
|
||||
|
@ -131,7 +131,7 @@ impl Pipeline {
|
|||
LayoutControlChan(pipeline_chan),
|
||||
paint_chan,
|
||||
layout_shutdown_port,
|
||||
render_shutdown_port,
|
||||
paint_shutdown_port,
|
||||
load_data)
|
||||
}
|
||||
|
||||
|
@ -141,7 +141,7 @@ impl Pipeline {
|
|||
layout_chan: LayoutControlChan,
|
||||
paint_chan: PaintChan,
|
||||
layout_shutdown_port: Receiver<()>,
|
||||
render_shutdown_port: Receiver<()>,
|
||||
paint_shutdown_port: Receiver<()>,
|
||||
load_data: LoadData)
|
||||
-> Pipeline {
|
||||
Pipeline {
|
||||
|
@ -151,7 +151,7 @@ impl Pipeline {
|
|||
layout_chan: layout_chan,
|
||||
paint_chan: paint_chan,
|
||||
layout_shutdown_port: layout_shutdown_port,
|
||||
render_shutdown_port: render_shutdown_port,
|
||||
paint_shutdown_port: paint_shutdown_port,
|
||||
load_data: load_data,
|
||||
}
|
||||
}
|
||||
|
@ -166,20 +166,20 @@ impl Pipeline {
|
|||
}
|
||||
|
||||
pub fn revoke_paint_permission(&self) {
|
||||
debug!("pipeline revoking render channel paint permission");
|
||||
debug!("pipeline revoking paint channel paint permission");
|
||||
let _ = self.paint_chan.send_opt(PaintPermissionRevoked);
|
||||
}
|
||||
|
||||
pub fn exit(&self) {
|
||||
debug!("pipeline {} exiting", self.id);
|
||||
|
||||
// Script task handles shutting down layout, and layout handles shutting down the renderer.
|
||||
// Script task handles shutting down layout, and layout handles shutting down the painter.
|
||||
// For now, if the script task has failed, we give up on clean shutdown.
|
||||
let ScriptControlChan(ref chan) = self.script_chan;
|
||||
if chan.send_opt(ExitPipelineMsg(self.id)).is_ok() {
|
||||
// Wait until all slave tasks have terminated and run destructors
|
||||
// NOTE: We don't wait for script task as we don't always own it
|
||||
let _ = self.render_shutdown_port.recv_opt();
|
||||
let _ = self.paint_shutdown_port.recv_opt();
|
||||
let _ = self.layout_shutdown_port.recv_opt();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue