aboutsummaryrefslogtreecommitdiffstats
path: root/components/layout/layout_debug.rs
diff options
context:
space:
mode:
authorShing Lyu <shing.lyu@gmail.com>2016-09-09 17:32:12 +0800
committerShing Lyu <shing.lyu@gmail.com>2016-09-09 17:38:19 +0800
commitfc8731990cef746bcacdfae6dd6180cd983dace3 (patch)
tree5f8bfdd0405090494093fecb348b39bacb541941 /components/layout/layout_debug.rs
parentbba3eefde86d7716c35b6dcb6f45c9d42fbe758f (diff)
downloadservo-fc8731990cef746bcacdfae6dd6180cd983dace3.tar.gz
servo-fc8731990cef746bcacdfae6dd6180cd983dace3.zip
Create separate layout trace file for each reflow
Diffstat (limited to 'components/layout/layout_debug.rs')
-rw-r--r--components/layout/layout_debug.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/components/layout/layout_debug.rs b/components/layout/layout_debug.rs
index 20e8a16714b..77ed1741add 100644
--- a/components/layout/layout_debug.rs
+++ b/components/layout/layout_debug.rs
@@ -121,13 +121,13 @@ pub fn begin_trace(flow_root: FlowRef) {
/// End the debug layout trace. This will write the layout
/// trace to disk in the current directory. The output
/// file can then be viewed with an external tool.
-pub fn end_trace() {
+pub fn end_trace(generation: u32) {
let mut thread_state = STATE_KEY.with(|ref r| r.borrow_mut().take().unwrap());
assert!(thread_state.scope_stack.len() == 1);
let mut root_scope = thread_state.scope_stack.pop().unwrap();
root_scope.post = json::encode(&flow::base(&*thread_state.flow_root)).unwrap();
let result = json::encode(&root_scope).unwrap();
- let mut file = File::create("layout_trace.json").unwrap();
+ let mut file = File::create(format!("layout_trace-{}.json", generation)).unwrap();
file.write_all(result.as_bytes()).unwrap();
}