mirror of
https://github.com/servo/servo.git
synced 2025-06-20 07:08:59 +01:00
Revert "auto merge of #1356 : ksh8281/servo/remove_@_in_LayoutTask.FontContext, r=pcwalton"
This reverts commite8ffac13d7
, reversing changes made todb923feffe
. Reverting this change because FreeType is *not* thread safe. See the documentation here: http://www.freetype.org/freetype2/docs/reference/ft2-base_interface.html "In multi-threaded applications, make sure that the same FT_Library object or any of its children doesn't get accessed in parallel." We will need to use a `MutexArc` instead.
This commit is contained in:
parent
e8ffac13d7
commit
30bbaa49b7
13 changed files with 120 additions and 122 deletions
|
@ -1217,20 +1217,6 @@ pub trait PostorderNodeTraversal {
|
|||
}
|
||||
}
|
||||
|
||||
/// A bottom-up, parallelizable traversal.
|
||||
pub trait PostorderNodeMutTraversal {
|
||||
/// The operation to perform. Return true to continue or false to stop.
|
||||
fn process(&mut self, node: AbstractNode<LayoutView>) -> bool;
|
||||
|
||||
/// Returns true if this node should be pruned. If this returns true, we skip the operation
|
||||
/// entirely and do not process any descendant nodes. This is called *before* child nodes are
|
||||
/// visited. The default implementation never prunes any nodes.
|
||||
fn should_prune(&self, _node: AbstractNode<LayoutView>) -> bool {
|
||||
false
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
impl AbstractNode<LayoutView> {
|
||||
/// Traverses the tree in postorder.
|
||||
///
|
||||
|
@ -1255,29 +1241,4 @@ impl AbstractNode<LayoutView> {
|
|||
|
||||
traversal.process(self)
|
||||
}
|
||||
|
||||
/// Traverses the tree in postorder.
|
||||
///
|
||||
/// TODO(pcwalton): Offer a parallel version with a compatible API.
|
||||
pub fn traverse_postorder_mut<T:PostorderNodeMutTraversal>(mut self, traversal: &mut T) -> bool {
|
||||
if traversal.should_prune(self) {
|
||||
return true
|
||||
}
|
||||
|
||||
let mut opt_kid = self.first_child();
|
||||
loop {
|
||||
match opt_kid {
|
||||
None => break,
|
||||
Some(kid) => {
|
||||
if !kid.traverse_postorder_mut(traversal) {
|
||||
return false
|
||||
}
|
||||
opt_kid = kid.next_sibling()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
traversal.process(self)
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue