Fix merge fallout.

This commit is contained in:
Patrick Walton 2013-05-28 09:59:46 -07:00
parent 4f3ca373d4
commit 83e1bd81e8
6 changed files with 32 additions and 16 deletions

View file

@ -34,7 +34,10 @@ pub struct RenderTask {
}
impl RenderTask {
pub fn new<C:Compositor + Owned>(compositor: C, opts: Opts) -> RenderTask {
pub fn new<C:Compositor + Owned>(compositor: C,
opts: Opts,
profiler_chan: ProfilerChan)
-> RenderTask {
let compositor_cell = Cell(compositor);
let opts_cell = Cell(opts);
let (port, chan) = comm::stream();
@ -48,14 +51,21 @@ impl RenderTask {
let n_threads = opts.n_render_threads;
let new_opts_cell = Cell(opts);
let profiler_chan = profiler_chan.clone();
let profiler_chan_copy = profiler_chan.clone();
let thread_pool = do TaskPool::new(n_threads, Some(SingleThreaded)) {
let opts_cell = Cell(new_opts_cell.with_ref(|o| copy *o));
let profiler_chan = Cell(profiler_chan.clone());
let f: ~fn(uint) -> ThreadRenderContext = |thread_index| {
let opts = opts_cell.with_ref(|opts| copy *opts);
ThreadRenderContext {
thread_index: thread_index,
font_ctx: @mut FontContext::new(opts.render_backend, false),
font_ctx: @mut FontContext::new(opts.render_backend,
false,
profiler_chan.take()),
opts: opts,
}
};
@ -67,7 +77,8 @@ impl RenderTask {
port: port.take(),
compositor: compositor,
thread_pool: thread_pool,
opts: opts_cell.take()
opts: opts_cell.take(),
profiler_chan: profiler_chan_copy,
};
renderer.start();
@ -91,7 +102,9 @@ priv struct Renderer<C> {
compositor: C,
thread_pool: TaskPool<ThreadRenderContext>,
opts: Opts,
prof_chan: ProfilerChan,
/// A channel to the profiler.
profiler_chan: ProfilerChan,
}
impl<C: Compositor + Owned> Renderer<C> {
@ -112,8 +125,11 @@ impl<C: Compositor + Owned> Renderer<C> {
fn render(&mut self, render_layer: RenderLayer) {
debug!("renderer: rendering");
do time("rendering") {
let layer_buffer_set = do render_layers(&render_layer, &self.opts)
|render_layer_ref, layer_buffer, buffer_chan| {
let layer_buffer_set = do render_layers(&render_layer,
&self.opts,
self.profiler_chan.clone()) |render_layer_ref,
layer_buffer,
buffer_chan| {
let layer_buffer_cell = Cell(layer_buffer);
do self.thread_pool.execute |thread_render_context| {
do layer_buffer_cell.with_ref |layer_buffer| {

View file

@ -190,7 +190,7 @@ fn run_main_loop(port: Port<Msg>,
};
do window.set_composite_callback {
do profile(time::CompositingCategory, prof_chan.clone()) {
do profile(time::CompositingCategory, profiler_chan.clone()) {
debug!("compositor: compositing");
// Adjust the layer dimensions as necessary to correspond to the size of the window.
scene.size = window.size();

View file

@ -17,11 +17,9 @@ use gfx::render_task;
use servo_net::image_cache_task::{ImageCacheTask, ImageCacheTaskClient};
use servo_net::resource_task::ResourceTask;
use servo_net::resource_task;
use std::net::url::Url;
use servo_util::time::{ProfilerChan, ProfilerPort, ProfilerTask};
use servo_util::time;
use servo_util::time::ProfilerChan;
use servo_util::time::ProfilerPort;
use std::net::url::Url;
pub type EngineTask = Chan<Msg>;
@ -38,7 +36,7 @@ pub struct Engine {
image_cache_task: ImageCacheTask,
layout_task: LayoutTask,
script_task: ScriptTask,
profiler_task: time::ProfilerTask,
profiler_task: ProfilerTask,
}
impl Engine {
@ -60,6 +58,8 @@ impl Engine {
opts.with_ref(|o| copy *o),
profiler_chan.clone());
let profiler_task = ProfilerTask::new(profiler_port.take(), profiler_chan.clone());
let opts = opts.take();
let layout_task = LayoutTask(render_task.clone(),
image_cache_task.clone(),

View file

@ -760,7 +760,7 @@ pub impl RenderBox {
fn text_decoration(&self) -> CSSTextDecoration {
/// Computes the propagated value of text-decoration, as specified in CSS 2.1 § 16.3.1
/// TODO: make sure this works with anonymous box generation.
fn get_propagated_text_decoration(element: AbstractNode) -> CSSTextDecoration {
fn get_propagated_text_decoration(element: AbstractNode<LayoutView>) -> CSSTextDecoration {
//Skip over non-element nodes in the DOM
if(!element.is_element()){
return match element.parent_node() {

View file

@ -155,8 +155,8 @@ fn run(opts: &Opts) {
script_chan,
resource_task,
image_cache_task,
prof_port,
prof_chan);
profiler_port,
profiler_chan);
// Send the URL command to the engine task.
for opts.urls.each |filename| {

View file

@ -35,7 +35,7 @@ exceptions = [
"src/support", # Upstream
"src/platform", # Upstream
"src/compiler", # Upstream
"src/components/servo/dom/bindings/codegen", # Generated and upstream code combined with our own. Could use cleanup
"src/components/main/dom/bindings/codegen", # Generated and upstream code combined with our own. Could use cleanup
]
def should_check(name):