mirror of
https://github.com/servo/servo.git
synced 2025-08-03 12:40:06 +01:00
Layout: Add Debug Print for The Scroll Tree (#37522)
Add debug option `dump-scroll-tree` to print the scroll tree that had been stored after each reflow, or log that the scoll tree is not initialized yet.. To reduce the coupling, the debug print operation will process the scroll tree node list that have been constructed in the stacking context tree. It will generate a adjacency list and do preorder traversal. The order of the tree then will depends on the order of the node in the node list that has been constructed. Which, in turn, correspond to the declaration order of the nodes. This would help with the analysis and development of post composite queries and its caching. cc: @xiaochengh Signed-off-by: stevennovaryo <steven.novaryo@gmail.com>
This commit is contained in:
parent
d70f6ace24
commit
b622157c10
3 changed files with 119 additions and 0 deletions
|
@ -664,6 +664,20 @@ impl LayoutThread {
|
|||
self.set_scroll_offset_from_script(external_scroll_id, offset);
|
||||
}
|
||||
|
||||
if self.debug.dump_scroll_tree {
|
||||
// Print the [ScrollTree], this is done after display list build so we have
|
||||
// the information about webrender id. Whether a scroll tree is initialized
|
||||
// or not depends on the reflow goal.
|
||||
if let Some(tree) = self.stacking_context_tree.borrow().as_ref() {
|
||||
tree.compositor_info.scroll_tree.debug_print();
|
||||
} else {
|
||||
println!(
|
||||
"Scroll Tree -- reflow {:?}: scroll tree is not initialized yet.",
|
||||
reflow_request.reflow_goal
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
let pending_images = std::mem::take(&mut *layout_context.pending_images.lock());
|
||||
let pending_rasterization_images =
|
||||
std::mem::take(&mut *layout_context.pending_rasterization_images.lock());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue