mirror of
https://github.com/servo/servo.git
synced 2025-08-01 19:50:30 +01:00
Make the parallel traversal an explicit flag instead of guessing from Servo.
MozReview-Commit-ID: 83DgB1sZnCb
This commit is contained in:
parent
f4ccbf3687
commit
248a245c95
2 changed files with 7 additions and 1 deletions
|
@ -31,6 +31,10 @@ bitflags! {
|
|||
const ClearDirtyDescendants = 1 << 5,
|
||||
/// Clears the animation-only dirty descendants bit in the subtree.
|
||||
const ClearAnimationOnlyDirtyDescendants = 1 << 6,
|
||||
/// Allows the traversal to run in parallel if there are sufficient cores on
|
||||
/// the machine.
|
||||
const ParallelTraversal = 1 << 7,
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -62,6 +66,7 @@ pub fn assert_traversal_flags_match() {
|
|||
ServoTraversalFlags_ClearDirtyDescendants => ClearDirtyDescendants,
|
||||
ServoTraversalFlags_ClearAnimationOnlyDirtyDescendants =>
|
||||
ClearAnimationOnlyDirtyDescendants,
|
||||
ServoTraversalFlags_ParallelTraversal => ParallelTraversal,
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -229,7 +229,8 @@ fn traverse_subtree(element: GeckoElement,
|
|||
debug!("{:?}", ShowSubtreeData(element.as_node()));
|
||||
|
||||
let style_thread_pool = &*STYLE_THREAD_POOL;
|
||||
let traversal_driver = if style_thread_pool.style_thread_pool.is_none() || !element.is_root() {
|
||||
let traversal_driver = if !traversal_flags.contains(traversal_flags::ParallelTraversal) ||
|
||||
style_thread_pool.style_thread_pool.is_none() {
|
||||
TraversalDriver::Sequential
|
||||
} else {
|
||||
TraversalDriver::Parallel
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue