aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPatrick Walton <pcwalton@mimiga.net>2013-05-28 09:59:46 -0700
committerPatrick Walton <pcwalton@mimiga.net>2013-05-28 16:16:34 -0700
commit83e1bd81e81bc4a121b182f9ac1b41fd22af97a3 (patch)
treea889d843ddce0bdd7009aba15d9686e3534e2673
parent4f3ca373d441bcb1bad51ddf9c579ccbd955ac95 (diff)
downloadservo-83e1bd81e81bc4a121b182f9ac1b41fd22af97a3.tar.gz
servo-83e1bd81e81bc4a121b182f9ac1b41fd22af97a3.zip
Fix merge fallout.
-rw-r--r--src/components/gfx/render_task.rs28
-rw-r--r--src/components/main/compositing/mod.rs2
-rw-r--r--src/components/main/engine.rs10
-rw-r--r--src/components/main/layout/box.rs2
-rwxr-xr-xsrc/components/main/servo.rc4
-rw-r--r--src/etc/tidy.py2
6 files changed, 32 insertions, 16 deletions
diff --git a/src/components/gfx/render_task.rs b/src/components/gfx/render_task.rs
index 231738b3a14..4b55382305c 100644
--- a/src/components/gfx/render_task.rs
+++ b/src/components/gfx/render_task.rs
@@ -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| {
diff --git a/src/components/main/compositing/mod.rs b/src/components/main/compositing/mod.rs
index 59529714f5f..14cf0052a5a 100644
--- a/src/components/main/compositing/mod.rs
+++ b/src/components/main/compositing/mod.rs
@@ -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();
diff --git a/src/components/main/engine.rs b/src/components/main/engine.rs
index 3a0e4f45e99..575fbc57bbf 100644
--- a/src/components/main/engine.rs
+++ b/src/components/main/engine.rs
@@ -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(),
diff --git a/src/components/main/layout/box.rs b/src/components/main/layout/box.rs
index 7f7945cea22..49444f03dc8 100644
--- a/src/components/main/layout/box.rs
+++ b/src/components/main/layout/box.rs
@@ -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() {
diff --git a/src/components/main/servo.rc b/src/components/main/servo.rc
index 52070cb7891..e4526bacf23 100755
--- a/src/components/main/servo.rc
+++ b/src/components/main/servo.rc
@@ -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| {
diff --git a/src/etc/tidy.py b/src/etc/tidy.py
index 37c499f57a8..4ffe776e8c3 100644
--- a/src/etc/tidy.py
+++ b/src/etc/tidy.py
@@ -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):