mirror of
https://github.com/servo/servo.git
synced 2025-08-03 12:40:06 +01:00
Rename RenderChan -> PaintChan
This commit is contained in:
parent
9b6faaf7f0
commit
7ff790d941
7 changed files with 38 additions and 38 deletions
|
@ -29,7 +29,7 @@ use geom::point::{Point2D, TypedPoint2D};
|
|||
use geom::rect::{Rect, TypedRect};
|
||||
use geom::size::TypedSize2D;
|
||||
use geom::scale_factor::ScaleFactor;
|
||||
use gfx::paint_task::{RenderChan, RenderMsg, PaintRequest, UnusedBufferMsg};
|
||||
use gfx::paint_task::{PaintChan, RenderMsg, PaintRequest, UnusedBufferMsg};
|
||||
use layers::geometry::{DevicePixel, LayerPixel};
|
||||
use layers::layers::{BufferRequest, Layer, LayerBufferSet};
|
||||
use layers::rendergl;
|
||||
|
@ -837,22 +837,22 @@ impl<Window: WindowMethods> IOCompositor<Window> {
|
|||
fn convert_buffer_requests_to_pipeline_requests_map(&self,
|
||||
requests: Vec<(Rc<Layer<CompositorData>>,
|
||||
Vec<BufferRequest>)>) ->
|
||||
HashMap<PipelineId, (RenderChan,
|
||||
HashMap<PipelineId, (PaintChan,
|
||||
Vec<PaintRequest>)> {
|
||||
let scale = self.device_pixels_per_page_px();
|
||||
let mut results:
|
||||
HashMap<PipelineId, (RenderChan, Vec<PaintRequest>)> = HashMap::new();
|
||||
HashMap<PipelineId, (PaintChan, Vec<PaintRequest>)> = HashMap::new();
|
||||
|
||||
for (layer, mut layer_requests) in requests.into_iter() {
|
||||
let &(_, ref mut vec) =
|
||||
match results.entry(layer.extra_data.borrow().pipeline.id) {
|
||||
Occupied(mut entry) => {
|
||||
*entry.get_mut() =
|
||||
(layer.extra_data.borrow().pipeline.render_chan.clone(), vec!());
|
||||
(layer.extra_data.borrow().pipeline.paint_chan.clone(), vec!());
|
||||
entry.into_mut()
|
||||
}
|
||||
Vacant(entry) => {
|
||||
entry.set((layer.extra_data.borrow().pipeline.render_chan.clone(), vec!()))
|
||||
entry.set((layer.extra_data.borrow().pipeline.paint_chan.clone(), vec!()))
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -879,7 +879,7 @@ impl<Window: WindowMethods> IOCompositor<Window> {
|
|||
let unused_buffers = self.scene.collect_unused_buffers();
|
||||
if unused_buffers.len() != 0 {
|
||||
let message = UnusedBufferMsg(unused_buffers);
|
||||
let _ = pipeline.render_chan.send_opt(message);
|
||||
let _ = pipeline.paint_chan.send_opt(message);
|
||||
}
|
||||
},
|
||||
None => {}
|
||||
|
|
|
@ -194,7 +194,7 @@ impl CompositorLayer for Layer<CompositorData> {
|
|||
epoch,
|
||||
self.extra_data.borrow().pipeline.id);
|
||||
let msg = UnusedBufferMsg(new_buffers.buffers);
|
||||
let _ = self.extra_data.borrow().pipeline.render_chan.send_opt(msg);
|
||||
let _ = self.extra_data.borrow().pipeline.paint_chan.send_opt(msg);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -206,7 +206,7 @@ impl CompositorLayer for Layer<CompositorData> {
|
|||
let unused_buffers = self.collect_unused_buffers();
|
||||
if !unused_buffers.is_empty() { // send back unused buffers
|
||||
let msg = UnusedBufferMsg(unused_buffers);
|
||||
let _ = self.extra_data.borrow().pipeline.render_chan.send_opt(msg);
|
||||
let _ = self.extra_data.borrow().pipeline.paint_chan.send_opt(msg);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -224,7 +224,7 @@ impl CompositorLayer for Layer<CompositorData> {
|
|||
buffer.mark_wont_leak()
|
||||
}
|
||||
|
||||
let _ = self.extra_data.borrow().pipeline.render_chan.send_opt(UnusedBufferMsg(buffers));
|
||||
let _ = self.extra_data.borrow().pipeline.paint_chan.send_opt(UnusedBufferMsg(buffers));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -506,7 +506,7 @@ impl<LTF: LayoutTaskFactory, STF: ScriptTaskFactory> Constellation<LTF, STF> {
|
|||
fn force_pipeline_exit(old_pipeline: &Rc<Pipeline>) {
|
||||
let ScriptControlChan(ref old_script) = old_pipeline.script_chan;
|
||||
let _ = old_script.send_opt(ExitPipelineMsg(old_pipeline.id));
|
||||
let _ = old_pipeline.render_chan.send_opt(paint_task::ExitMsg(None));
|
||||
let _ = old_pipeline.paint_chan.send_opt(paint_task::ExitMsg(None));
|
||||
let LayoutControlChan(ref old_layout) = old_pipeline.layout_chan;
|
||||
let _ = old_layout.send_opt(ExitNowMsg);
|
||||
}
|
||||
|
|
|
@ -9,7 +9,7 @@ use script_traits::{AttachLayoutMsg, LoadMsg, NewLayoutInfo, ExitPipelineMsg};
|
|||
|
||||
use devtools_traits::DevtoolsControlChan;
|
||||
use gfx::paint_task::{PaintPermissionGranted, PaintPermissionRevoked};
|
||||
use gfx::paint_task::{RenderChan, PaintTask};
|
||||
use gfx::paint_task::{PaintChan, PaintTask};
|
||||
use servo_msg::constellation_msg::{ConstellationChan, Failure, PipelineId, SubpageId};
|
||||
use servo_msg::constellation_msg::{LoadData, WindowSizeData};
|
||||
use servo_net::image_cache_task::ImageCacheTask;
|
||||
|
@ -25,7 +25,7 @@ pub struct Pipeline {
|
|||
pub subpage_id: Option<SubpageId>,
|
||||
pub script_chan: ScriptControlChan,
|
||||
pub layout_chan: LayoutControlChan,
|
||||
pub render_chan: RenderChan,
|
||||
pub paint_chan: PaintChan,
|
||||
pub layout_shutdown_port: Receiver<()>,
|
||||
pub render_shutdown_port: Receiver<()>,
|
||||
/// The most recently loaded page
|
||||
|
@ -37,7 +37,7 @@ pub struct Pipeline {
|
|||
pub struct CompositionPipeline {
|
||||
pub id: PipelineId,
|
||||
pub script_chan: ScriptControlChan,
|
||||
pub render_chan: RenderChan,
|
||||
pub paint_chan: PaintChan,
|
||||
}
|
||||
|
||||
impl Pipeline {
|
||||
|
@ -60,7 +60,7 @@ impl Pipeline {
|
|||
load_data: LoadData)
|
||||
-> Pipeline {
|
||||
let layout_pair = ScriptTaskFactory::create_layout_channel(None::<&mut STF>);
|
||||
let (render_port, render_chan) = RenderChan::new();
|
||||
let (render_port, paint_chan) = PaintChan::new();
|
||||
let (render_shutdown_chan, render_shutdown_port) = channel();
|
||||
let (layout_shutdown_chan, layout_shutdown_port) = channel();
|
||||
let (pipeline_chan, pipeline_port) = channel();
|
||||
|
@ -118,7 +118,7 @@ impl Pipeline {
|
|||
constellation_chan,
|
||||
failure,
|
||||
script_chan.clone(),
|
||||
render_chan.clone(),
|
||||
paint_chan.clone(),
|
||||
resource_task,
|
||||
image_cache_task,
|
||||
font_cache_task,
|
||||
|
@ -129,7 +129,7 @@ impl Pipeline {
|
|||
subpage_id,
|
||||
script_chan,
|
||||
LayoutControlChan(pipeline_chan),
|
||||
render_chan,
|
||||
paint_chan,
|
||||
layout_shutdown_port,
|
||||
render_shutdown_port,
|
||||
load_data)
|
||||
|
@ -139,7 +139,7 @@ impl Pipeline {
|
|||
subpage_id: Option<SubpageId>,
|
||||
script_chan: ScriptControlChan,
|
||||
layout_chan: LayoutControlChan,
|
||||
render_chan: RenderChan,
|
||||
paint_chan: PaintChan,
|
||||
layout_shutdown_port: Receiver<()>,
|
||||
render_shutdown_port: Receiver<()>,
|
||||
load_data: LoadData)
|
||||
|
@ -149,7 +149,7 @@ impl Pipeline {
|
|||
subpage_id: subpage_id,
|
||||
script_chan: script_chan,
|
||||
layout_chan: layout_chan,
|
||||
render_chan: render_chan,
|
||||
paint_chan: paint_chan,
|
||||
layout_shutdown_port: layout_shutdown_port,
|
||||
render_shutdown_port: render_shutdown_port,
|
||||
load_data: load_data,
|
||||
|
@ -162,12 +162,12 @@ impl Pipeline {
|
|||
}
|
||||
|
||||
pub fn grant_paint_permission(&self) {
|
||||
let _ = self.render_chan.send_opt(PaintPermissionGranted);
|
||||
let _ = self.paint_chan.send_opt(PaintPermissionGranted);
|
||||
}
|
||||
|
||||
pub fn revoke_paint_permission(&self) {
|
||||
debug!("pipeline revoking render channel paint permission");
|
||||
let _ = self.render_chan.send_opt(PaintPermissionRevoked);
|
||||
let _ = self.paint_chan.send_opt(PaintPermissionRevoked);
|
||||
}
|
||||
|
||||
pub fn exit(&self) {
|
||||
|
@ -188,7 +188,7 @@ impl Pipeline {
|
|||
CompositionPipeline {
|
||||
id: self.id.clone(),
|
||||
script_chan: self.script_chan.clone(),
|
||||
render_chan: self.render_chan.clone(),
|
||||
paint_chan: self.paint_chan.clone(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -77,21 +77,21 @@ pub enum Msg {
|
|||
}
|
||||
|
||||
#[deriving(Clone)]
|
||||
pub struct RenderChan(Sender<Msg>);
|
||||
pub struct PaintChan(Sender<Msg>);
|
||||
|
||||
impl RenderChan {
|
||||
pub fn new() -> (Receiver<Msg>, RenderChan) {
|
||||
impl PaintChan {
|
||||
pub fn new() -> (Receiver<Msg>, PaintChan) {
|
||||
let (chan, port) = channel();
|
||||
(port, RenderChan(chan))
|
||||
(port, PaintChan(chan))
|
||||
}
|
||||
|
||||
pub fn send(&self, msg: Msg) {
|
||||
let &RenderChan(ref chan) = self;
|
||||
assert!(chan.send_opt(msg).is_ok(), "RenderChan.send: render port closed")
|
||||
let &PaintChan(ref chan) = self;
|
||||
assert!(chan.send_opt(msg).is_ok(), "PaintChan.send: render port closed")
|
||||
}
|
||||
|
||||
pub fn send_opt(&self, msg: Msg) -> Result<(), Msg> {
|
||||
let &RenderChan(ref chan) = self;
|
||||
let &PaintChan(ref chan) = self;
|
||||
chan.send_opt(msg)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -28,7 +28,7 @@ use geom::scale_factor::ScaleFactor;
|
|||
use gfx::color;
|
||||
use gfx::display_list::{DisplayList, OpaqueNode, StackingContext};
|
||||
use gfx::font_cache_task::FontCacheTask;
|
||||
use gfx::paint_task::{mod, RenderInitMsg, RenderChan, PaintLayer};
|
||||
use gfx::paint_task::{mod, RenderInitMsg, PaintChan, PaintLayer};
|
||||
use layout_traits;
|
||||
use layout_traits::{LayoutControlMsg, LayoutTaskFactory};
|
||||
use log;
|
||||
|
@ -119,7 +119,7 @@ pub struct LayoutTask {
|
|||
pub script_chan: ScriptControlChan,
|
||||
|
||||
/// The channel on which messages can be sent to the painting task.
|
||||
pub render_chan: RenderChan,
|
||||
pub paint_chan: PaintChan,
|
||||
|
||||
/// The channel on which messages can be sent to the time profiler.
|
||||
pub time_profiler_chan: TimeProfilerChan,
|
||||
|
@ -173,7 +173,7 @@ impl LayoutTaskFactory for LayoutTask {
|
|||
constellation_chan: ConstellationChan,
|
||||
failure_msg: Failure,
|
||||
script_chan: ScriptControlChan,
|
||||
render_chan: RenderChan,
|
||||
paint_chan: PaintChan,
|
||||
resource_task: ResourceTask,
|
||||
img_cache_task: ImageCacheTask,
|
||||
font_cache_task: FontCacheTask,
|
||||
|
@ -191,7 +191,7 @@ impl LayoutTaskFactory for LayoutTask {
|
|||
pipeline_port,
|
||||
constellation_chan,
|
||||
script_chan,
|
||||
render_chan,
|
||||
paint_chan,
|
||||
resource_task,
|
||||
img_cache_task,
|
||||
font_cache_task,
|
||||
|
@ -240,7 +240,7 @@ impl LayoutTask {
|
|||
pipeline_port: Receiver<LayoutControlMsg>,
|
||||
constellation_chan: ConstellationChan,
|
||||
script_chan: ScriptControlChan,
|
||||
render_chan: RenderChan,
|
||||
paint_chan: PaintChan,
|
||||
resource_task: ResourceTask,
|
||||
image_cache_task: ImageCacheTask,
|
||||
font_cache_task: FontCacheTask,
|
||||
|
@ -264,7 +264,7 @@ impl LayoutTask {
|
|||
chan: chan,
|
||||
constellation_chan: constellation_chan,
|
||||
script_chan: script_chan,
|
||||
render_chan: render_chan,
|
||||
paint_chan: paint_chan,
|
||||
time_profiler_chan: time_profiler_chan,
|
||||
resource_task: resource_task,
|
||||
image_cache_task: image_cache_task.clone(),
|
||||
|
@ -463,7 +463,7 @@ impl LayoutTask {
|
|||
LayoutTask::return_rw_data(possibly_locked_rw_data, rw_data);
|
||||
}
|
||||
|
||||
self.render_chan.send(paint_task::ExitMsg(Some(response_chan)));
|
||||
self.paint_chan.send(paint_task::ExitMsg(Some(response_chan)));
|
||||
response_port.recv()
|
||||
}
|
||||
|
||||
|
@ -690,7 +690,7 @@ impl LayoutTask {
|
|||
|
||||
debug!("Layout done!");
|
||||
|
||||
self.render_chan.send(RenderInitMsg(stacking_context));
|
||||
self.paint_chan.send(RenderInitMsg(stacking_context));
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
@ -20,7 +20,7 @@ extern crate "util" as servo_util;
|
|||
// that these modules won't have to depend on layout.
|
||||
|
||||
use gfx::font_cache_task::FontCacheTask;
|
||||
use gfx::paint_task::RenderChan;
|
||||
use gfx::paint_task::PaintChan;
|
||||
use servo_msg::constellation_msg::{ConstellationChan, PipelineId};
|
||||
use servo_msg::constellation_msg::Failure;
|
||||
use servo_net::image_cache_task::ImageCacheTask;
|
||||
|
@ -48,7 +48,7 @@ pub trait LayoutTaskFactory {
|
|||
constellation_chan: ConstellationChan,
|
||||
failure_msg: Failure,
|
||||
script_chan: ScriptControlChan,
|
||||
render_chan: RenderChan,
|
||||
paint_chan: PaintChan,
|
||||
resource_task: ResourceTask,
|
||||
img_cache_task: ImageCacheTask,
|
||||
font_cache_task: FontCacheTask,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue