diff options
author | Martin Robinson <mrobinson@igalia.com> | 2014-11-14 10:31:28 -0800 |
---|---|---|
committer | Martin Robinson <mrobinson@igalia.com> | 2015-01-09 15:14:01 -0800 |
commit | f1d82cf82c9fcbfdf0e40363588fd4ca0f708a3a (patch) | |
tree | e754d99ec3af9502706dda42f1b9d94d4dfca7da | |
parent | 6a46eef5cd85bacefe0a5dc383833df5076d34fa (diff) | |
download | servo-f1d82cf82c9fcbfdf0e40363588fd4ca0f708a3a.tar.gz servo-f1d82cf82c9fcbfdf0e40363588fd4ca0f708a3a.zip |
Add FrameTree::add_child
This helper method simplifies a few lines.
-rw-r--r-- | components/compositing/constellation.rs | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/components/compositing/constellation.rs b/components/compositing/constellation.rs index 0024d516f43..6e2d1380aa9 100644 --- a/components/compositing/constellation.rs +++ b/components/compositing/constellation.rs @@ -118,6 +118,10 @@ impl FrameTree { has_compositor_layer: Cell::new(false), } } + + fn add_child(&self, new_child: ChildFrameTree) { + self.children.borrow_mut().push(new_child); + } } #[deriving(Clone)] @@ -720,8 +724,7 @@ impl<LTF: LayoutTaskFactory, STF: ScriptTaskFactory> Constellation<LTF, STF> { let new_frame_tree = Rc::new(FrameTree::new(self.get_next_frame_id(), new_pipeline, Some(frame_tree.pipeline.borrow().clone()))); - frame_tree.children.borrow_mut().push(ChildFrameTree::new(new_frame_tree, - new_rect)); + frame_tree.add_child(ChildFrameTree::new(new_frame_tree, new_rect)); } } } @@ -963,8 +966,7 @@ impl<LTF: LayoutTaskFactory, STF: ScriptTaskFactory> Constellation<LTF, STF> { let parent = next_frame_tree.find(parent.id).expect( "Constellation: pending frame has a parent frame that is not active. This is a bug."); - parent.children.borrow_mut().push(ChildFrameTree::new(to_add.clone(), - rect)); + parent.add_child(ChildFrameTree::new(to_add.clone(), rect)); } } } |