From b3f5099d69c65facf68f96266a9a007654587dfc Mon Sep 17 00:00:00 2001 From: Paul Rouget Date: Sat, 22 Aug 2015 05:20:09 -0600 Subject: [PATCH] servo: Merge #7096 - Glutin update (from paulrouget:glutin-update); r=glennw Source-Repo: https://github.com/servo/servo Source-Revision: 12c44d69f69e723b86fa7539a1238e0c883816a5 --- servo/components/servo/Cargo.lock | 137 +++++++++++++++++++++++++++--- servo/ports/cef/Cargo.lock | 129 ++++++++++++++++++++++++++-- servo/ports/glutin/lib.rs | 2 +- servo/ports/glutin/window.rs | 7 +- 4 files changed, 253 insertions(+), 22 deletions(-) diff --git a/servo/components/servo/Cargo.lock b/servo/components/servo/Cargo.lock index 60df35ece0d7..4a9911942384 100644 --- a/servo/components/servo/Cargo.lock +++ b/servo/components/servo/Cargo.lock @@ -91,6 +91,11 @@ dependencies = [ "serde 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "bitflags" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "bitflags" version = "0.3.2" @@ -313,6 +318,31 @@ dependencies = [ "util 0.0.1", ] +[[package]] +name = "dlib" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "libc 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "dwmapi-sys" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "winapi 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "dylib" +version = "0.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "libc 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "egl" version = "0.1.0" @@ -545,6 +575,16 @@ dependencies = [ "libc 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "gl_generator" +version = "0.0.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "khronos_api 0.0.7 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", + "xml-rs 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "gl_generator" version = "0.0.27" @@ -568,25 +608,33 @@ dependencies = [ [[package]] name = "glutin" -version = "0.0.26" -source = "git+https://github.com/servo/glutin?branch=servo#b22056cc75602e2e8cecba605b93a4e52a99a2a2" +version = "0.3.5" +source = "git+https://github.com/servo/glutin?branch=servo#22a561c30a0560f445f50abcebf8439d264e0c67" dependencies = [ "android_glue 0.0.2 (registry+https://github.com/rust-lang/crates.io-index)", + "cgl 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "cocoa 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", "core-foundation 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "core-graphics 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "dwmapi-sys 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "gdi32-sys 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "gl_common 0.0.4 (registry+https://github.com/rust-lang/crates.io-index)", - "gl_generator 0.0.27 (registry+https://github.com/rust-lang/crates.io-index)", + "gl_generator 0.0.26 (registry+https://github.com/rust-lang/crates.io-index)", "kernel32-sys 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", "khronos_api 0.0.7 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", "objc 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", "osmesa-sys 0.0.5 (registry+https://github.com/rust-lang/crates.io-index)", + "shared_library 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "shell32-sys 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "user32-sys 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi 0.1.23 (registry+https://github.com/rust-lang/crates.io-index)", + "wayland-client 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "wayland-kbd 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "wayland-window 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "x11 2.0.1 (registry+https://github.com/rust-lang/crates.io-index)", + "x11-dl 2.0.1 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -599,7 +647,7 @@ dependencies = [ "egl 0.1.0 (git+https://github.com/servo/rust-egl)", "euclid 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", "gleam 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", - "glutin 0.0.26 (git+https://github.com/servo/glutin?branch=servo)", + "glutin 0.3.5 (git+https://github.com/servo/glutin?branch=servo)", "layers 0.1.0 (git+https://github.com/servo/rust-layers)", "libc 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", "msg 0.0.1", @@ -901,6 +949,15 @@ dependencies = [ "libc 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "mmap" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "libc 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", + "tempdir 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "mozjs_sys" version = "0.0.0" @@ -1356,6 +1413,15 @@ dependencies = [ "libc 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "shell32-sys" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "winapi 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "skia" version = "0.0.20130412" @@ -1480,6 +1546,17 @@ dependencies = [ "rand 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "tempfile" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "kernel32-sys 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", + "rand 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "tenacious" version = "0.0.9" @@ -1610,6 +1687,39 @@ name = "void" version = "0.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "wayland-client" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "bitflags 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", + "dlib 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "wayland-kbd" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "bitflags 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", + "mmap 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "wayland-client 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "wayland-window" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "byteorder 0.3.11 (registry+https://github.com/rust-lang/crates.io-index)", + "tempfile 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "wayland-client 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "webdriver" version = "0.2.2" @@ -1652,14 +1762,6 @@ dependencies = [ "url 0.2.36 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "winapi" -version = "0.1.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "libc 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "winapi" version = "0.2.1" @@ -1679,6 +1781,15 @@ dependencies = [ "pkg-config 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "x11-dl" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "dylib 0.0.1 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "xml-rs" version = "0.1.25" diff --git a/servo/ports/cef/Cargo.lock b/servo/ports/cef/Cargo.lock index 5a5a50c886bf..baeef6bfd7db 100644 --- a/servo/ports/cef/Cargo.lock +++ b/servo/ports/cef/Cargo.lock @@ -90,6 +90,11 @@ dependencies = [ "serde 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "bitflags" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "bitflags" version = "0.3.2" @@ -312,6 +317,31 @@ dependencies = [ "util 0.0.1", ] +[[package]] +name = "dlib" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "libc 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "dwmapi-sys" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "winapi 0.1.23 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "dylib" +version = "0.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "libc 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "egl" version = "0.1.0" @@ -537,6 +567,16 @@ dependencies = [ "libc 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "gl_generator" +version = "0.0.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "khronos_api 0.0.7 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", + "xml-rs 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "gl_generator" version = "0.0.27" @@ -560,25 +600,33 @@ dependencies = [ [[package]] name = "glutin" -version = "0.0.26" -source = "git+https://github.com/servo/glutin?branch=servo#b22056cc75602e2e8cecba605b93a4e52a99a2a2" +version = "0.3.5" +source = "git+https://github.com/servo/glutin?branch=servo#22a561c30a0560f445f50abcebf8439d264e0c67" dependencies = [ "android_glue 0.0.2 (registry+https://github.com/rust-lang/crates.io-index)", + "cgl 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "cocoa 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", "core-foundation 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "core-graphics 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "dwmapi-sys 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "gdi32-sys 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "gl_common 0.0.4 (registry+https://github.com/rust-lang/crates.io-index)", - "gl_generator 0.0.27 (registry+https://github.com/rust-lang/crates.io-index)", + "gl_generator 0.0.26 (registry+https://github.com/rust-lang/crates.io-index)", "kernel32-sys 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", "khronos_api 0.0.7 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", "objc 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", "osmesa-sys 0.0.5 (registry+https://github.com/rust-lang/crates.io-index)", + "shared_library 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "shell32-sys 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "user32-sys 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi 0.1.23 (registry+https://github.com/rust-lang/crates.io-index)", + "wayland-client 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "wayland-kbd 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "wayland-window 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "x11 2.0.1 (registry+https://github.com/rust-lang/crates.io-index)", + "x11-dl 2.0.1 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -591,7 +639,7 @@ dependencies = [ "egl 0.1.0 (git+https://github.com/servo/rust-egl)", "euclid 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", "gleam 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", - "glutin 0.0.26 (git+https://github.com/servo/glutin?branch=servo)", + "glutin 0.3.5 (git+https://github.com/servo/glutin?branch=servo)", "layers 0.1.0 (git+https://github.com/servo/rust-layers)", "libc 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", "msg 0.0.1", @@ -893,6 +941,15 @@ dependencies = [ "libc 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "mmap" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "libc 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", + "tempdir 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "mozjs_sys" version = "0.0.0" @@ -1352,6 +1409,15 @@ dependencies = [ "libc 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "shell32-sys" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "winapi 0.1.23 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "skia" version = "0.0.20130412" @@ -1462,6 +1528,17 @@ dependencies = [ "rand 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "tempfile" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "kernel32-sys 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", + "rand 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "tenacious" version = "0.0.9" @@ -1582,6 +1659,39 @@ name = "void" version = "0.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "wayland-client" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "bitflags 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", + "dlib 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "wayland-kbd" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "bitflags 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", + "mmap 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "wayland-client 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "wayland-window" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "byteorder 0.3.11 (registry+https://github.com/rust-lang/crates.io-index)", + "tempfile 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "wayland-client 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "webdriver" version = "0.2.2" @@ -1651,6 +1761,15 @@ dependencies = [ "pkg-config 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "x11-dl" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "dylib 0.0.1 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "xml-rs" version = "0.1.25" diff --git a/servo/ports/glutin/lib.rs b/servo/ports/glutin/lib.rs index 00ebba7d517e..0bd7fffff8e2 100644 --- a/servo/ports/glutin/lib.rs +++ b/servo/ports/glutin/lib.rs @@ -4,7 +4,7 @@ //! A simple application that uses glutin to open a window for Servo to display in. -#![feature(box_syntax)] +#![feature(box_syntax, result_expect)] #[macro_use] extern crate bitflags; #[cfg(target_os="macos")] extern crate cgl; diff --git a/servo/ports/glutin/window.rs b/servo/ports/glutin/window.rs index 9841da934a17..f22fab799020 100644 --- a/servo/ports/glutin/window.rs +++ b/servo/ports/glutin/window.rs @@ -97,7 +97,8 @@ impl Window { .with_parent(parent) .build() .unwrap(); - unsafe { glutin_window.make_current() }; + + unsafe { glutin_window.make_current().expect("Failed to make context current!") } glutin_window.set_window_resize_callback(Some(Window::nested_window_resize as fn(u32, u32))); @@ -352,7 +353,7 @@ impl Window { close_event = self.handle_next_event(); } - if close_event || self.window.is_closed() { + if close_event { events.push(WindowEvent::Quit) } @@ -518,7 +519,7 @@ impl WindowMethods for Window { } fn present(&self) { - self.window.swap_buffers() + self.window.swap_buffers().unwrap(); } fn create_compositor_channel(window: &Option>)