remove @ in LayoutTask.FontContext

This commit is contained in:
patrick kim 2013-12-09 16:28:41 +09:00
parent 5077c771a5
commit f187035e25
6 changed files with 68 additions and 30 deletions

View file

@ -77,9 +77,6 @@ struct LayoutTask {
/// The local image cache.
local_image_cache: MutexArc<LocalImageCache>,
/// The local font context.
font_ctx: @mut FontContext,
/// The size of the viewport.
screen_size: Option<Size2D<Au>>,
@ -90,6 +87,8 @@ struct LayoutTask {
/// The channel on which messages can be sent to the profiler.
profiler_chan: ProfilerChan,
opts: Opts
}
/// The damage computation traversal.
@ -229,7 +228,6 @@ impl LayoutTask {
opts: &Opts,
profiler_chan: ProfilerChan)
-> LayoutTask {
let fctx = @mut FontContext::new(opts.render_backend, true, profiler_chan.clone());
LayoutTask {
id: id,
@ -239,13 +237,13 @@ impl LayoutTask {
render_chan: render_chan,
image_cache_task: image_cache_task.clone(),
local_image_cache: MutexArc::new(LocalImageCache(image_cache_task)),
font_ctx: fctx,
screen_size: None,
display_list: None,
stylist: RWArc::new(new_stylist()),
profiler_chan: profiler_chan,
opts: opts.clone()
}
}
@ -259,7 +257,8 @@ impl LayoutTask {
// Create a layout context for use in building display lists, hit testing, &c.
fn build_layout_context(&self) -> LayoutContext {
let image_cache = self.local_image_cache.clone();
let font_ctx = self.font_ctx;
let font_ctx = ~FontContext::new(self.opts.render_backend, true,
self.profiler_chan.clone());
let screen_size = self.screen_size.unwrap();
LayoutContext {
@ -344,9 +343,9 @@ impl LayoutTask {
/// is intertwined with selector matching, making it difficult to compare directly. It is
/// marked `#[inline(never)]` to aid benchmarking in sampling profilers.
#[inline(never)]
fn construct_flow_tree(&self, layout_context: &LayoutContext, node: AbstractNode<LayoutView>)
fn construct_flow_tree(&self, layout_context: &mut LayoutContext, node: AbstractNode<LayoutView>)
-> ~Flow: {
node.traverse_postorder(&FlowConstructor::init(layout_context));
node.traverse_postorder_mut(&mut FlowConstructor::init(layout_context));
let result = match *node.mutate_layout_data().ptr {
Some(ref mut layout_data) => {
@ -441,7 +440,7 @@ impl LayoutTask {
// Construct the flow tree.
let mut layout_root = profile(time::LayoutTreeBuilderCategory,
self.profiler_chan.clone(),
|| self.construct_flow_tree(&layout_ctx, *node));
|| self.construct_flow_tree(&mut layout_ctx, *node));
// Propagate damage.
layout_root.traverse_preorder(&mut PropagateDamageTraversal {