diff options
author | patrick kim <ksh8281@gmail.com> | 2013-12-09 16:28:41 +0900 |
---|---|---|
committer | patrick kim <ksh8281@gmail.com> | 2013-12-11 11:42:14 +0900 |
commit | 0026eb0899ceec9a8be2e28f8f9426b23ec5438f (patch) | |
tree | 43583feabe129072f7d5b06a722a0c54b646ecd6 /src/components/main/layout/layout_task.rs | |
parent | 55771bc307b0be36ef89548c406ca5632f95de21 (diff) | |
download | servo-0026eb0899ceec9a8be2e28f8f9426b23ec5438f.tar.gz servo-0026eb0899ceec9a8be2e28f8f9426b23ec5438f.zip |
remove @ in LayoutTask.FontContext
Diffstat (limited to 'src/components/main/layout/layout_task.rs')
-rw-r--r-- | src/components/main/layout/layout_task.rs | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/src/components/main/layout/layout_task.rs b/src/components/main/layout/layout_task.rs index d1e8cb63671..fdface606fd 100644 --- a/src/components/main/layout/layout_task.rs +++ b/src/components/main/layout/layout_task.rs @@ -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 { |