mirror of
https://github.com/servo/servo.git
synced 2025-08-05 21:50:18 +01:00
auto merge of #563 : metajack/servo/glfw, r=metajack
This code replaces glut with glfw. The motivation here is address the GPU driver bugs on Linux when using multiple `Display *` pointers with shared GL contexts instead of a single common one. GLFW has native access methods which provide access to its `Display *`, which appears to be unique among all the similar toolkits. Details: - Adds glfw and glfw-rs to the build - Removes GLUT code and replaces it with GLFW versions - Fixes hard coded initial window values - Fixes clean targets - Event loop doesn't block on windowing events anymore
This commit is contained in:
commit
34a35054e9
85 changed files with 671 additions and 732 deletions
|
@ -363,10 +363,10 @@ impl<View> AbstractNode<View> {
|
|||
pub fn dump_indent(&self, indent: uint) {
|
||||
let mut s = ~"";
|
||||
for uint::range(0u, indent) |_i| {
|
||||
s += " ";
|
||||
s.push_str(" ");
|
||||
}
|
||||
|
||||
s += self.debug_str();
|
||||
s.push_str(self.debug_str());
|
||||
debug!("%s", s);
|
||||
|
||||
// FIXME: this should have a pure version?
|
||||
|
@ -423,7 +423,35 @@ impl Node<ScriptView> {
|
|||
layout_data: None,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub fn getNodeType(&self) -> i32 {
|
||||
match self.type_id {
|
||||
ElementNodeTypeId(_) => 1,
|
||||
TextNodeTypeId => 3,
|
||||
CommentNodeTypeId => 8,
|
||||
DoctypeNodeTypeId => 10
|
||||
}
|
||||
}
|
||||
|
||||
pub fn getNextSibling(&mut self) -> Option<&mut AbstractNode<ScriptView>> {
|
||||
match self.next_sibling {
|
||||
// transmute because the compiler can't deduce that the reference
|
||||
// is safe outside of with_mut_base blocks.
|
||||
Some(ref mut n) => Some(unsafe { cast::transmute(n) }),
|
||||
None => None
|
||||
}
|
||||
}
|
||||
|
||||
pub fn getFirstChild(&mut self) -> Option<&mut AbstractNode<ScriptView>> {
|
||||
match self.first_child {
|
||||
// transmute because the compiler can't deduce that the reference
|
||||
// is safe outside of with_mut_base blocks.
|
||||
Some(ref mut n) => Some(unsafe { cast::transmute(n) }),
|
||||
None => None
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// The CSS library requires that DOM nodes be convertible to `*c_void` via the `VoidPtrLike`
|
||||
/// trait.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue