From a06537e165b1074df17f15e83a713ab7ac58c32a Mon Sep 17 00:00:00 2001 From: Dzmitry Malyshau Date: Tue, 6 Feb 2018 11:50:08 -0500 Subject: [PATCH 1/4] Port examples to upstream glutin --- Cargo.lock | 336 ++++++++++++++++++++- webrender/Cargo.toml | 6 +- webrender/examples/alpha_perf.rs | 11 +- webrender/examples/animation.rs | 13 +- webrender/examples/basic.rs | 4 +- webrender/examples/common/boilerplate.rs | 206 ++++++------- webrender/examples/image_resize.rs | 52 ++-- webrender/examples/multiwindow.rs | 87 ++++-- webrender/examples/scrolling.rs | 19 +- webrender/examples/texture_cache_stress.rs | 11 +- webrender/examples/yuv.rs | 4 +- 11 files changed, 544 insertions(+), 205 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 562621a436..090bb085c3 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -97,7 +97,7 @@ dependencies = [ [[package]] name = "cfg-if" -version = "0.1.0" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] @@ -109,6 +109,15 @@ dependencies = [ "libc 0.2.20 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "chrono" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "num 0.1.36 (registry+https://github.com/rust-lang/crates.io-index)", + "time 0.1.36 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "clap" version = "2.29.1" @@ -141,6 +150,18 @@ dependencies = [ "scopeguard 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "cocoa" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "bitflags 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "block 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", + "core-graphics 0.12.4 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.20 (registry+https://github.com/rust-lang/crates.io-index)", + "objc 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "cocoa" version = "0.14.0" @@ -158,6 +179,15 @@ name = "color_quant" version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "core-foundation" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "core-foundation-sys 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.20 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "core-foundation" version = "0.5.1" @@ -167,6 +197,14 @@ dependencies = [ "libc 0.2.20 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "core-foundation-sys" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "libc 0.2.20 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "core-foundation-sys" version = "0.5.1" @@ -175,6 +213,17 @@ dependencies = [ "libc 0.2.20 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "core-graphics" +version = "0.12.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "bitflags 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "core-foundation 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", + "foreign-types 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.20 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "core-graphics" version = "0.13.0" @@ -211,11 +260,28 @@ dependencies = [ "byteorder 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "dlib" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "libloading 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "dtoa" version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "dwmapi-sys" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "winapi 0.2.8 (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 = "dwrote" version = "0.4.1" @@ -252,6 +318,18 @@ dependencies = [ "regex 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "env_logger" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "atty 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", + "chrono 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", + "regex 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "termcolor 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "euclid" version = "0.16.0" @@ -322,6 +400,15 @@ name = "gcc" version = "0.3.43" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "gdi32-sys" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "winapi 0.2.8 (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 = "gdi32-sys" version = "0.2.0" @@ -340,6 +427,16 @@ dependencies = [ "lzw 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "gl_generator" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "khronos_api 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", + "xml-rs 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "gl_generator" version = "0.8.0" @@ -359,6 +456,33 @@ dependencies = [ "pkg-config 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "glutin" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "android_glue 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "cgl 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "cocoa 0.13.0 (registry+https://github.com/rust-lang/crates.io-index)", + "core-foundation 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", + "core-graphics 0.12.4 (registry+https://github.com/rust-lang/crates.io-index)", + "dwmapi-sys 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "gdi32-sys 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", + "gl_generator 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", + "kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.20 (registry+https://github.com/rust-lang/crates.io-index)", + "objc 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", + "osmesa-sys 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", + "shared_library 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", + "shell32-sys 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", + "user32-sys 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", + "wayland-client 0.12.5 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", + "winit 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)", + "x11-dl 2.12.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "httparse" version = "1.2.3" @@ -475,6 +599,16 @@ name = "libc" version = "0.2.20" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "libloading" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "linked-hash-map" version = "0.3.0" @@ -485,6 +619,14 @@ name = "log" version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "log" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "cfg-if 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "lzw" version = "0.10.0" @@ -511,6 +653,15 @@ dependencies = [ "libc 0.2.20 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "memmap" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "libc 0.2.20 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "mio" version = "0.6.7" @@ -543,13 +694,23 @@ name = "net2" version = "0.2.26" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "cfg-if 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "cfg-if 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.20 (registry+https://github.com/rust-lang/crates.io-index)", "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", "ws2_32-sys 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "num" +version = "0.1.36" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "num-integer 0.1.32 (registry+https://github.com/rust-lang/crates.io-index)", + "num-iter 0.1.32 (registry+https://github.com/rust-lang/crates.io-index)", + "num-traits 0.1.37 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "num-integer" version = "0.1.32" @@ -817,6 +978,15 @@ dependencies = [ "libc 0.2.20 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "shell32-sys" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "winapi 0.2.8 (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 = "slab" version = "0.3.0" @@ -850,6 +1020,26 @@ dependencies = [ "unicode-xid 0.0.4 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "tempfile" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.20 (registry+https://github.com/rust-lang/crates.io-index)", + "rand 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)", + "redox_syscall 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "termcolor" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "wincolor 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "textwrap" version = "0.9.0" @@ -897,6 +1087,11 @@ dependencies = [ "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "token_store" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "unicode-bidi" version = "0.3.4" @@ -938,6 +1133,15 @@ dependencies = [ "percent-encoding 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "user32-sys" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "winapi 0.2.8 (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 = "user32-sys" version = "0.2.0" @@ -970,6 +1174,69 @@ name = "void" version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "wayland-client" +version = "0.12.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "bitflags 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.20 (registry+https://github.com/rust-lang/crates.io-index)", + "token_store 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", + "wayland-scanner 0.12.5 (registry+https://github.com/rust-lang/crates.io-index)", + "wayland-sys 0.12.5 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "wayland-kbd" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "bitflags 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "dlib 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "memmap 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)", + "wayland-client 0.12.5 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "wayland-protocols" +version = "0.12.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "bitflags 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "wayland-client 0.12.5 (registry+https://github.com/rust-lang/crates.io-index)", + "wayland-scanner 0.12.5 (registry+https://github.com/rust-lang/crates.io-index)", + "wayland-sys 0.12.5 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "wayland-scanner" +version = "0.12.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "xml-rs 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "wayland-sys" +version = "0.12.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "dlib 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "wayland-window" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "memmap 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)", + "tempfile 2.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "wayland-client 0.12.5 (registry+https://github.com/rust-lang/crates.io-index)", + "wayland-protocols 0.12.5 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "webrender" version = "0.57.0" @@ -984,14 +1251,15 @@ dependencies = [ "core-graphics 0.13.0 (registry+https://github.com/rust-lang/crates.io-index)", "core-text 9.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "dwrote 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", - "env_logger 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", + "env_logger 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)", "euclid 0.16.0 (registry+https://github.com/rust-lang/crates.io-index)", "freetype 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "fxhash 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "gleam 0.4.20 (registry+https://github.com/rust-lang/crates.io-index)", + "glutin 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)", "image 0.17.0 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", "num-traits 0.1.37 (registry+https://github.com/rust-lang/crates.io-index)", "plane-split 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", "png 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1000,7 +1268,6 @@ dependencies = [ "ron 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.27 (registry+https://github.com/rust-lang/crates.io-index)", "serde_json 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", - "servo-glutin 0.14.0 (registry+https://github.com/rust-lang/crates.io-index)", "smallvec 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", "thread_profiler 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "time 0.1.36 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1055,6 +1322,35 @@ name = "winapi-x86_64-pc-windows-gnu" version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "wincolor" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "winapi 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "winit" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "android_glue 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "cocoa 0.13.0 (registry+https://github.com/rust-lang/crates.io-index)", + "core-foundation 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", + "core-graphics 0.12.4 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.20 (registry+https://github.com/rust-lang/crates.io-index)", + "objc 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", + "percent-encoding 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "wayland-client 0.12.5 (registry+https://github.com/rust-lang/crates.io-index)", + "wayland-kbd 0.13.1 (registry+https://github.com/rust-lang/crates.io-index)", + "wayland-protocols 0.12.5 (registry+https://github.com/rust-lang/crates.io-index)", + "wayland-window 0.13.2 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", + "x11-dl 2.12.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "wrench" version = "0.3.0" @@ -1158,24 +1454,32 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum block 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "0d8c1fef690941d3e7788d328517591fecc684c084084702d6ff1641e993699a" "checksum byteorder 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "652805b7e73fada9d85e9a6682a4abd490cb52d96aeecc12e33a0de34dfd0d23" "checksum bytes 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)" = "d828f97b58cc5de3e40c421d0cf2132d6b2da4ee0e11b8632fa838f0f9333ad6" -"checksum cfg-if 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "de1e760d7b6535af4241fca8bd8adf68e2e7edacc6b29f5d399050c5e48cf88c" +"checksum cfg-if 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "d4c819a1287eb618df47cc647173c5c4c66ba19d888a6e50d605672aed3140de" "checksum cgl 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "86765cb42c2a2c497e142af72517c1b4d7ae5bb2f25dfa77a5c69642f2342d89" +"checksum chrono 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7c20ebe0b2b08b0aeddba49c609fe7957ba2e33449882cb186a180bc60682fa9" "checksum clap 2.29.1 (registry+https://github.com/rust-lang/crates.io-index)" = "8f4a2b3bb7ef3c672d7c13d15613211d5a6976b6892c598b0fcb5d40765f19c2" "checksum cmake 0.1.20 (registry+https://github.com/rust-lang/crates.io-index)" = "a3a6805df695087e7c1bcd9a82e03ad6fb864c8e67ac41b1348229ce5b7f0407" "checksum coco 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "c06169f5beb7e31c7c67ebf5540b8b472d23e3eade3b2ec7d1f5b504a85f91bd" +"checksum cocoa 0.13.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ac0d785ff4faf0ff23d7b5561346bb50dc7ef9a11cb0e65e07ef776b7752938f" "checksum cocoa 0.14.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b0c23085dde1ef4429df6e5896b89356d35cdd321fb43afe3e378d010bb5adc6" "checksum color_quant 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "a475fc4af42d83d28adf72968d9bcfaf035a1a9381642d8e85d8a04957767b0d" +"checksum core-foundation 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)" = "8047f547cd6856d45b1cdd75ef8d2f21f3d0e4bf1dab0a0041b0ae9a5dda9c0e" "checksum core-foundation 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "286e0b41c3a20da26536c6000a280585d519fd07b3956b43aed8a79e9edce980" +"checksum core-foundation-sys 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)" = "152195421a2e6497a8179195672e9d4ee8e45ed8c465b626f1606d27a08ebcd5" "checksum core-foundation-sys 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "716c271e8613ace48344f723b60b900a93150271e5be206212d052bbc0883efa" +"checksum core-graphics 0.12.4 (registry+https://github.com/rust-lang/crates.io-index)" = "8de78908c558a9ba526877d165635c9eaed0818a785a93efddde1c5bfd2ce5d1" "checksum core-graphics 0.13.0 (registry+https://github.com/rust-lang/crates.io-index)" = "fb0ed45fdc32f9ab426238fba9407dfead7bacd7900c9b4dd3f396f46eafdae3" "checksum core-text 9.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "2bd581c37283d0c23311d179aefbb891f2324ee0405da58a26e8594ab76e5748" "checksum crossbeam 0.2.12 (registry+https://github.com/rust-lang/crates.io-index)" = "bd66663db5a988098a89599d4857919b3acf7f61402e61365acfd3919857b9be" "checksum deflate 0.7.17 (registry+https://github.com/rust-lang/crates.io-index)" = "4dddda59aaab719767ab11d3efd9a714e95b610c4445d4435765021e9d52dfb1" +"checksum dlib 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "95518d8f88d556e62c9b3014629f21bdad97a9fdfee85c68a185e3980af29e7c" "checksum dtoa 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "80c8b71fd71146990a9742fc06dcbbde19161a267e0ad4e572c35162f4578c90" +"checksum dwmapi-sys 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "b44b6442aeab12e609aee505bd1066bdfd36b79c3fe5aad604aae91537623e76" "checksum dwrote 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "a207eb7b40e25d1d28dc679f451d321fb6954b73ceaa47986702575865469461" "checksum either 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "18785c1ba806c258137c937e44ada9ee7e69a37e3c72077542cd2f069d78562a" "checksum enum_primitive 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "be4551092f4d519593039259a9ed8daedf0da12e5109c5280338073eaeb81180" "checksum env_logger 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "e3856f1697098606fc6cb97a93de88ca3f3bc35bb878c725920e6e82ecf05e83" +"checksum env_logger 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)" = "f15f0b172cb4f52ed5dbf47f774a387cd2315d1bf7894ab5af9b083ae27efa5a" "checksum euclid 0.16.0 (registry+https://github.com/rust-lang/crates.io-index)" = "926c639bfdff1f3063f76bb66245f6d2b691aa20fdbaabecc38b2947a13a4eba" "checksum expat-sys 2.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "cef36cd1a8a02d28b91d97347c63247b9e4cb8a8e36df36f8201dc87a1c0859c" "checksum fnv 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)" = "6cc484842f1e2884faf56f529f960cc12ad8c71ce96cc7abba0a067c98fee344" @@ -1185,10 +1489,13 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum futures 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)" = "55f0008e13fc853f79ea8fc86e931486860d4c4c156cdffb59fa5f7fa833660a" "checksum fxhash 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "c31b6d751ae2c7f11320402d34e41349dd1016f8d5d45e48c4312bc8625af50c" "checksum gcc 0.3.43 (registry+https://github.com/rust-lang/crates.io-index)" = "c07c758b972368e703a562686adb39125707cc1ef3399da8c019fc6c2498a75d" +"checksum gdi32-sys 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "8e3eb92c1107527888f86b6ebb0b7f82794777dbf172a932998660a0a2e26c11" "checksum gdi32-sys 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "0912515a8ff24ba900422ecda800b52f4016a56251922d397c576bf92c690518" "checksum gif 0.9.2 (registry+https://github.com/rust-lang/crates.io-index)" = "e2e41945ba23db3bf51b24756d73d81acb4f28d85c3dccc32c6fae904438c25f" +"checksum gl_generator 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "04e3e0220a68b8875b5a311fe67ee3b76d3d9b719a92277aff0ec5bb5e7b0ec1" "checksum gl_generator 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "4f5c19cde55637681450c92f7a05ea16c78e2b6d0587e601ec1ebdab6960854b" "checksum gleam 0.4.20 (registry+https://github.com/rust-lang/crates.io-index)" = "959c818d9bbe9f7b7db55dce0bc44673c4da4f4ee122536c40550f984c3b8017" +"checksum glutin 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)" = "25c70edeb14581cb6edb486eb15d55b41815fade469308474932549fd9703fe5" "checksum httparse 1.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "af2f2dd97457e8fb1ae7c5a420db346af389926e36f43768b96f101546b04a07" "checksum idna 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "014b298351066f1512874135335d62a789ffe78a9974f94b43ed5621951eaf7d" "checksum image 0.17.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d1576ffa01849c91b484b95c01d54dddc242b4d50923eaa2d4d74a58c4b9e8fd" @@ -1204,15 +1511,19 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum lazy_static 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "c8f31047daa365f19be14b47c29df4f7c3b581832407daabe6ae77397619237d" "checksum lazycell 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ce12306c4739d86ee97c23139f3a34ddf0387bbf181bc7929d287025a8c3ef6b" "checksum libc 0.2.20 (registry+https://github.com/rust-lang/crates.io-index)" = "684f330624d8c3784fb9558ca46c4ce488073a8d22450415c5eb4f4cfb0d11b5" +"checksum libloading 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)" = "fd38073de8f7965d0c17d30546d4bb6da311ab428d1c7a3fc71dff7f9d4979b9" "checksum linked-hash-map 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "6d262045c5b87c0861b3f004610afd0e2c851e2908d08b6c870cbb9d5f494ecd" "checksum log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)" = "ab83497bf8bf4ed2a74259c1c802351fcd67a65baa86394b6ba73c36f4838054" +"checksum log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "89f010e843f2b1a31dbd316b3b8d443758bc634bed37aabade59c686d644e0a2" "checksum lzw 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7d947cbb889ed21c2a84be6ffbaebf5b4e0f4340638cba0444907e38b56be084" "checksum malloc_buf 0.0.6 (registry+https://github.com/rust-lang/crates.io-index)" = "62bb907fe88d54d8d9ce32a3cceab4218ed2f6b7d35617cafe9adf84e43919cb" "checksum matches 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "100aabe6b8ff4e4a7e32c1c13523379802df0772b82466207ac25b013f193376" "checksum memchr 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "1dbccc0e46f1ea47b9f17e6d67c5a96bd27030519c519c9c91327e31275a47b4" +"checksum memmap 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)" = "e2ffa2c986de11a9df78620c01eeaaf27d94d3ff02bf81bfcca953102dd0c6ff" "checksum mio 0.6.7 (registry+https://github.com/rust-lang/crates.io-index)" = "6d19442734abd7d780b981c590c325680d933e99795fe1f693f0686c9ed48022" "checksum miow 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "8c1f2f3b1cf331de6896aabf6e9d55dca90356cc9960cca7eaaf408a355ae919" "checksum net2 0.2.26 (registry+https://github.com/rust-lang/crates.io-index)" = "5edf9cb6be97212423aed9413dd4729d62b370b5e1c571750e882cebbbc1e3e2" +"checksum num 0.1.36 (registry+https://github.com/rust-lang/crates.io-index)" = "bde7c03b09e7c6a301ee81f6ddf66d7a28ec305699e3d3b056d2fc56470e3120" "checksum num-integer 0.1.32 (registry+https://github.com/rust-lang/crates.io-index)" = "fb24d9bfb3f222010df27995441ded1e954f8f69cd35021f6bef02ca9552fb92" "checksum num-iter 0.1.32 (registry+https://github.com/rust-lang/crates.io-index)" = "287a1c9969a847055e1122ec0ea7a5c5d6f72aad97934e131c83d5c08ab4e45c" "checksum num-rational 0.1.35 (registry+https://github.com/rust-lang/crates.io-index)" = "54ff603b8334a72fbb27fe66948aac0abaaa40231b3cecd189e76162f6f38aaf" @@ -1245,32 +1556,45 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum servo-glutin 0.14.0 (registry+https://github.com/rust-lang/crates.io-index)" = "4cb5211b22c2ef903a2ac7dd384dabdfaeb176128cbd7409ec49381f69887df1" "checksum sha1 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "cc30b1e1e8c40c121ca33b86c23308a090d19974ef001b4bf6e61fd1a0fb095c" "checksum shared_library 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "fb04126b6fcfd2710fb5b6d18f4207b6c535f2850a7e1a43bcd526d44f30a79a" +"checksum shell32-sys 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "9ee04b46101f57121c9da2b151988283b6beb79b34f5bb29a58ee48cb695122c" "checksum slab 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "17b4fcaed89ab08ef143da37bc52adbcc04d4a69014f4c1208d6b51f0c47bc23" "checksum smallvec 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "44db0ecb22921ef790d17ae13a3f6d15784183ff5f2a01aa32098c7498d2b4b9" "checksum strsim 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b4d15c810519a91cf877e7e36e63fe068815c678181439f2f29e2562147c3694" "checksum syn 0.11.11 (registry+https://github.com/rust-lang/crates.io-index)" = "d3b891b9015c88c576343b9b3e41c2c11a51c219ef067b264bd9c8aa9b441dad" "checksum synom 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "8fece1853fb872b0acdc3ff88f37c474018e125ef81cd4cb8c0ca515746b62ed" +"checksum tempfile 2.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "11ce2fe9db64b842314052e2421ac61a73ce41b898dc8e3750398b219c5fc1e0" +"checksum termcolor 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "9065bced9c3e43453aa3d56f1e98590b8455b341d2fa191a1090c0dd0b242c75" "checksum textwrap 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "c0b59b6b4b44d867f1370ef1bd91bfb262bf07bf0ae65c202ea2fbc16153b693" "checksum thread-id 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "4437c97558c70d129e40629a5b385b3fb1ffac301e63941335e4d354081ec14a" "checksum thread_local 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "c85048c6260d17cf486ceae3282d9fb6b90be220bf5b28c400f5485ffc29f0c7" "checksum thread_profiler 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "cf947d192a9be60ef5131cc7a4648886ba89d712f16700ebbf80c8a69d05d48f" "checksum time 0.1.36 (registry+https://github.com/rust-lang/crates.io-index)" = "211b63c112206356ef1ff9b19355f43740fc3f85960c598a93d3a3d3ba7beade" +"checksum token_store 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "a686838375fc11103b9c1529c6508320b7bd5e2401cd62831ca51b3e82e61849" "checksum unicode-bidi 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "49f2bd0c6468a8230e1db229cff8029217cf623c767ea5d60bfbd42729ea54d5" "checksum unicode-normalization 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "51ccda9ef9efa3f7ef5d91e8f9b83bbe6955f9bf86aec89d5cce2c874625920f" "checksum unicode-width 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "bf3a113775714a22dcb774d8ea3655c53a32debae63a063acc00a91cc586245f" "checksum unicode-xid 0.0.4 (registry+https://github.com/rust-lang/crates.io-index)" = "8c1f860d7d29cf02cb2f3f359fd35991af3d30bac52c57d265a3c461074cb4dc" "checksum unreachable 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "1f2ae5ddb18e1c92664717616dd9549dde73f539f01bd7b77c2edb2446bdff91" "checksum url 1.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "eeb819346883532a271eb626deb43c4a1bb4c4dd47c519bd78137c3e72a4fe27" +"checksum user32-sys 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "e6b719983b952c04198829b51653c06af36f0e44c967fcc1a2bb397ceafbf80a" "checksum user32-sys 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "4ef4711d107b21b410a3a974b1204d9accc8b10dad75d8324b5d755de1617d47" "checksum utf8-ranges 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "662fab6525a98beff2921d7f61a39e7d59e0b425ebc7d0d9e66d316e55124122" "checksum uuid 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b5d0f5103675a280a926ec2f9b7bcc2ef49367df54e8c570c3311fec919f9a8b" "checksum vec_map 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "887b5b631c2ad01628bbbaa7dd4c869f80d3186688f8d0b6f58774fbe324988c" "checksum void 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "6a02e4885ed3bc0f2de90ea6dd45ebcbb66dacffe03547fadbb0eeae2770887d" +"checksum wayland-client 0.12.5 (registry+https://github.com/rust-lang/crates.io-index)" = "2b90adf943117ee4930d7944fe103dcb6f36ba05421f46521cb5adbf6bf0fbc8" +"checksum wayland-kbd 0.13.1 (registry+https://github.com/rust-lang/crates.io-index)" = "4fe0fb1c9917da9529d781659e456d84a693d74fe873d1658109758444616f76" +"checksum wayland-protocols 0.12.5 (registry+https://github.com/rust-lang/crates.io-index)" = "fb5942dd2fc79d934db437c9ea3aabffceb49b546046ea453bcba531005e5537" +"checksum wayland-scanner 0.12.5 (registry+https://github.com/rust-lang/crates.io-index)" = "dcffa55a621e6f2c3d436de64d840fc325e1d0a467b92ee5e7292e17552e08ad" +"checksum wayland-sys 0.12.5 (registry+https://github.com/rust-lang/crates.io-index)" = "377a2f83063c463e801ca10ae8cb9666e6e597eecac0049ac36cc7b9a83b0db3" +"checksum wayland-window 0.13.2 (registry+https://github.com/rust-lang/crates.io-index)" = "2d94d3c23f8f2e0a09d82c6ca765da3c1efe65ef0280f750d74a6c6c6bb4ca8f" "checksum winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)" = "167dc9d6949a9b857f3451275e911c3f44255842c1f7a76f33c55103a909087a" "checksum winapi 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "04e3bd221fcbe8a271359c04f21a76db7d0c6028862d1bb5512d85e1e2eb5bb3" "checksum winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "2d315eee3b34aca4797b2da6b13ed88266e6d612562a0c46390af8299fc699bc" "checksum winapi-i686-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" "checksum winapi-x86_64-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" +"checksum wincolor 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "0878187fa88838d2006c0a76f30d64797098426245b375383f60acb6aed8a203" +"checksum winit 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)" = "491e1305250e728fd9b8ef86ecef4e17a3293e87e51c7bc31e7a3913ec957d37" "checksum ws 0.7.3 (registry+https://github.com/rust-lang/crates.io-index)" = "89c48c53bf9dee34411a08993c10b879c36e105d609b46e25673befe3a5c1320" "checksum ws2_32-sys 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "d59cefebd0c892fa2dd6de581e937301d8552cb44489cdff035c6187cb63fa5e" "checksum x11-dl 2.12.0 (registry+https://github.com/rust-lang/crates.io-index)" = "bf1f9986368c9bbdd8191a783a7ceb42e0c9c6d3348616c873f829b3288a139c" diff --git a/webrender/Cargo.toml b/webrender/Cargo.toml index 328deafe3f..b00bb2365e 100644 --- a/webrender/Cargo.toml +++ b/webrender/Cargo.toml @@ -22,7 +22,7 @@ euclid = "0.16" fxhash = "0.2.1" gleam = "0.4.20" lazy_static = "1" -log = "0.3" +log = "0.4" num-traits = "0.1.32" time = "0.1" rayon = "0.8" @@ -41,9 +41,9 @@ ron = { optional = true, version = "0.1.7" } [dev-dependencies] angle = {git = "https://github.com/servo/angle", branch = "servo"} -env_logger = "0.4" +env_logger = "0.5" rand = "0.3" # for the benchmarks -servo-glutin = "0.14" # for the example apps +glutin = "0.12" # for the example apps [target.'cfg(any(target_os = "android", all(unix, not(target_os = "macos"))))'.dependencies] freetype = { version = "0.3", default-features = false } diff --git a/webrender/examples/alpha_perf.rs b/webrender/examples/alpha_perf.rs index 9a33832358..48d978373d 100644 --- a/webrender/examples/alpha_perf.rs +++ b/webrender/examples/alpha_perf.rs @@ -53,12 +53,19 @@ impl Example for App { fn on_event( &mut self, - event: glutin::Event, + event: glutin::WindowEvent, _api: &RenderApi, _document_id: DocumentId ) -> bool { match event { - glutin::Event::KeyboardInput(glutin::ElementState::Pressed, _, Some(key)) => { + glutin::WindowEvent::KeyboardInput { + input: glutin::KeyboardInput { + state: glutin::ElementState::Pressed, + virtual_keycode: Some(key), + .. + }, + .. + } => { match key { glutin::VirtualKeyCode::Right => { self.rect_count += 1; diff --git a/webrender/examples/animation.rs b/webrender/examples/animation.rs index f06d12fe7d..68270cc31c 100644 --- a/webrender/examples/animation.rs +++ b/webrender/examples/animation.rs @@ -71,9 +71,16 @@ impl Example for App { builder.pop_stacking_context(); } - fn on_event(&mut self, event: glutin::Event, api: &RenderApi, document_id: DocumentId) -> bool { - match event { - glutin::Event::KeyboardInput(glutin::ElementState::Pressed, _, Some(key)) => { + fn on_event(&mut self, win_event: glutin::WindowEvent, api: &RenderApi, document_id: DocumentId) -> bool { + match win_event { + glutin::WindowEvent::KeyboardInput { + input: glutin::KeyboardInput { + state: glutin::ElementState::Pressed, + virtual_keycode: Some(key), + .. + }, + .. + } => { let (offset_x, offset_y, angle, delta_opacity) = match key { glutin::VirtualKeyCode::Down => (0.0, 10.0, 0.0, 0.0), glutin::VirtualKeyCode::Up => (0.0, -10.0, 0.0, 0.0), diff --git a/webrender/examples/basic.rs b/webrender/examples/basic.rs index 81df0eb11e..acb516ee37 100644 --- a/webrender/examples/basic.rs +++ b/webrender/examples/basic.rs @@ -273,10 +273,10 @@ impl Example for App { builder.pop_stacking_context(); } - fn on_event(&mut self, event: glutin::Event, api: &RenderApi, document_id: DocumentId) -> bool { + fn on_event(&mut self, event: glutin::WindowEvent, api: &RenderApi, document_id: DocumentId) -> bool { let mut txn = Transaction::new(); match event { - glutin::Event::Touch(touch) => match self.touch_state.handle_event(touch) { + glutin::WindowEvent::Touch(touch) => match self.touch_state.handle_event(touch) { TouchResult::Pan(pan) => { txn.set_pan(pan); } diff --git a/webrender/examples/common/boilerplate.rs b/webrender/examples/common/boilerplate.rs index 5894fdec1e..b57f01776f 100644 --- a/webrender/examples/common/boilerplate.rs +++ b/webrender/examples/common/boilerplate.rs @@ -6,32 +6,32 @@ extern crate env_logger; extern crate euclid; use gleam::gl; -use glutin; +use glutin::{self, GlContext}; use std::env; use std::path::PathBuf; use webrender; use webrender::api::*; struct Notifier { - window_proxy: glutin::WindowProxy, + events_proxy: glutin::EventsLoopProxy, } impl Notifier { - fn new(window_proxy: glutin::WindowProxy) -> Notifier { - Notifier { window_proxy } + fn new(events_proxy: glutin::EventsLoopProxy) -> Notifier { + Notifier { events_proxy } } } impl RenderNotifier for Notifier { fn clone(&self) -> Box { Box::new(Notifier { - window_proxy: self.window_proxy.clone(), + events_proxy: self.events_proxy.clone(), }) } fn wake_up(&self) { #[cfg(not(target_os = "android"))] - self.window_proxy.wakeup_event_loop(); + let _ = self.events_proxy.wakeup(); } fn new_document_ready(&self, _: DocumentId, _scrolled: bool, _composite_needed: bool) { @@ -76,7 +76,7 @@ pub trait Example { pipeline_id: PipelineId, document_id: DocumentId, ); - fn on_event(&mut self, glutin::Event, &RenderApi, DocumentId) -> bool { + fn on_event(&mut self, glutin::WindowEvent, &RenderApi, DocumentId) -> bool { false } fn get_image_handlers( @@ -94,7 +94,7 @@ pub fn main_wrapper( example: &mut E, options: Option, ) { - env_logger::init().unwrap(); + env_logger::init(); let args: Vec = env::args().collect(); let res_path = if args.len() > 1 { @@ -103,15 +103,17 @@ pub fn main_wrapper( None }; - let window = glutin::WindowBuilder::new() - .with_title(E::TITLE) - .with_multitouch() - .with_dimensions(E::WIDTH, E::HEIGHT) + let mut events_loop = glutin::EventsLoop::new(); + let context_builder = glutin::ContextBuilder::new() .with_gl(glutin::GlRequest::GlThenGles { opengl_version: (3, 2), opengles_version: (3, 0), - }) - .build() + }); + let window_builder = glutin::WindowBuilder::new() + .with_title(E::TITLE) + .with_multitouch() + .with_dimensions(E::WIDTH, E::HEIGHT); + let window = glutin::GlWindow::new(window_builder, context_builder, &events_loop) .unwrap(); unsafe { @@ -145,10 +147,10 @@ pub fn main_wrapper( }; let framebuffer_size = { - let (width, height) = window.get_inner_size_pixels().unwrap(); + let (width, height) = window.get_inner_size().unwrap(); DeviceUintSize::new(width, height) }; - let notifier = Box::new(Notifier::new(window.create_window_proxy())); + let notifier = Box::new(Notifier::new(events_loop.create_proxy())); let (mut renderer, sender) = webrender::Renderer::new(gl.clone(), notifier, opts).unwrap(); let api = sender.create_api(); let document_id = api.add_document(framebuffer_size, 0); @@ -191,117 +193,81 @@ pub fn main_wrapper( api.send_transaction(document_id, txn); println!("Entering event loop"); - 'outer: for event in window.wait_events() { - let mut events = Vec::new(); - events.push(event); - events.extend(window.poll_events()); - + events_loop.run_forever(|event| { let mut txn = Transaction::new(); - for event in events { - match event { - glutin::Event::Closed | - glutin::Event::KeyboardInput(_, _, Some(glutin::VirtualKeyCode::Escape)) => break 'outer, + let mut custom_event = true; - glutin::Event::KeyboardInput( - glutin::ElementState::Pressed, - _, - Some(glutin::VirtualKeyCode::P), - ) => { - renderer.toggle_debug_flags(webrender::DebugFlags::PROFILER_DBG); - } - glutin::Event::KeyboardInput( - glutin::ElementState::Pressed, - _, - Some(glutin::VirtualKeyCode::O), - ) => { - renderer.toggle_debug_flags(webrender::DebugFlags::RENDER_TARGET_DBG); - } - glutin::Event::KeyboardInput( - glutin::ElementState::Pressed, - _, - Some(glutin::VirtualKeyCode::I), - ) => { - renderer.toggle_debug_flags(webrender::DebugFlags::TEXTURE_CACHE_DBG); - } - glutin::Event::KeyboardInput( - glutin::ElementState::Pressed, - _, - Some(glutin::VirtualKeyCode::S), - ) => { - renderer.toggle_debug_flags(webrender::DebugFlags::COMPACT_PROFILER); - } - glutin::Event::KeyboardInput( - glutin::ElementState::Pressed, - _, - Some(glutin::VirtualKeyCode::Q), - ) => { - renderer.toggle_debug_flags(webrender::DebugFlags::GPU_TIME_QUERIES - | webrender::DebugFlags::GPU_SAMPLE_QUERIES); - } - glutin::Event::KeyboardInput( - glutin::ElementState::Pressed, - _, - Some(glutin::VirtualKeyCode::Key1), - ) => { - txn.set_window_parameters( - framebuffer_size, - DeviceUintRect::new(DeviceUintPoint::zero(), framebuffer_size), - 1.0 - ); - } - glutin::Event::KeyboardInput( - glutin::ElementState::Pressed, - _, - Some(glutin::VirtualKeyCode::Key2), - ) => { - txn.set_window_parameters( - framebuffer_size, - DeviceUintRect::new(DeviceUintPoint::zero(), framebuffer_size), - 2.0 - ); - } - glutin::Event::KeyboardInput( - glutin::ElementState::Pressed, - _, - Some(glutin::VirtualKeyCode::M), - ) => { - api.notify_memory_pressure(); - } + match event { + glutin::Event::WindowEvent { event: glutin::WindowEvent::Closed, .. } => return glutin::ControlFlow::Break, + glutin::Event::WindowEvent { + event: glutin::WindowEvent::KeyboardInput { + input: glutin::KeyboardInput { + state: glutin::ElementState::Pressed, + virtual_keycode: Some(key), + .. + }, + .. + }, + .. + } => match key { + glutin::VirtualKeyCode::Escape => return glutin::ControlFlow::Break, + glutin::VirtualKeyCode::P => renderer.toggle_debug_flags(webrender::DebugFlags::PROFILER_DBG), + glutin::VirtualKeyCode::O => renderer.toggle_debug_flags(webrender::DebugFlags::RENDER_TARGET_DBG), + glutin::VirtualKeyCode::I => renderer.toggle_debug_flags(webrender::DebugFlags::TEXTURE_CACHE_DBG), + glutin::VirtualKeyCode::S => renderer.toggle_debug_flags(webrender::DebugFlags::COMPACT_PROFILER), + glutin::VirtualKeyCode::Q => renderer.toggle_debug_flags(webrender::DebugFlags::GPU_TIME_QUERIES | webrender::DebugFlags::GPU_SAMPLE_QUERIES), + glutin::VirtualKeyCode::Key1 => txn.set_window_parameters( + framebuffer_size, + DeviceUintRect::new(DeviceUintPoint::zero(), framebuffer_size), + 1.0 + ), + glutin::VirtualKeyCode::Key2 => txn.set_window_parameters( + framebuffer_size, + DeviceUintRect::new(DeviceUintPoint::zero(), framebuffer_size), + 2.0 + ), + glutin::VirtualKeyCode::M => api.notify_memory_pressure(), #[cfg(feature = "capture")] - glutin::Event::KeyboardInput( - glutin::ElementState::Pressed, - _, - Some(glutin::VirtualKeyCode::C), - ) => { + glutin::VirtualKeyCode::C => { let path: PathBuf = "../captures/example".into(); //TODO: switch between SCENE/FRAME capture types // based on "shift" modifier, when `glutin` is updated. let bits = CaptureBits::all(); api.save_capture(path, bits); - } - _ => if example.on_event(event, &api, document_id) { - let mut builder = DisplayListBuilder::new(pipeline_id, layout_size); - let mut resources = ResourceUpdates::new(); + }, + _ => { + let win_event = match event { + glutin::Event::WindowEvent { event, .. } => event, + _ => unreachable!() + }; + custom_event = example.on_event(win_event, &api, document_id) + }, + }, + glutin::Event::WindowEvent { event, .. } => custom_event = example.on_event(event, &api, document_id), + _ => return glutin::ControlFlow::Continue, + }; + + if custom_event { + let mut builder = DisplayListBuilder::new(pipeline_id, layout_size); + let mut resources = ResourceUpdates::new(); - example.render( - &api, - &mut builder, - &mut resources, - framebuffer_size, - pipeline_id, - document_id, - ); - txn.set_display_list( - epoch, - None, - layout_size, - builder.finalize(), - true, - ); - txn.update_resources(resources); - txn.generate_frame(); - } - } + example.render( + &api, + &mut builder, + &mut resources, + framebuffer_size, + pipeline_id, + document_id, + ); + txn.set_display_list( + epoch, + None, + layout_size, + builder.finalize(), + true, + ); + txn.update_resources(resources); + txn.generate_frame(); } api.send_transaction(document_id, txn); @@ -310,7 +276,9 @@ pub fn main_wrapper( let _ = renderer.flush_pipeline_info(); example.draw_custom(&*gl); window.swap_buffers().ok(); - } + + glutin::ControlFlow::Continue + }); renderer.deinit(); } diff --git a/webrender/examples/image_resize.rs b/webrender/examples/image_resize.rs index feb026a11f..6718cd1bab 100644 --- a/webrender/examples/image_resize.rs +++ b/webrender/examples/image_resize.rs @@ -79,34 +79,36 @@ impl Example for App { builder.pop_stacking_context(); } - fn on_event(&mut self, event: glutin::Event, api: &RenderApi, document_id: DocumentId) -> bool { + fn on_event(&mut self, event: glutin::WindowEvent, api: &RenderApi, document_id: DocumentId) -> bool { match event { - glutin::Event::KeyboardInput(glutin::ElementState::Pressed, _, Some(key)) => { - match key { - glutin::VirtualKeyCode::Space => { - let mut image_data = Vec::new(); - for y in 0 .. 64 { - for x in 0 .. 64 { - let r = 255 * ((y & 32) == 0) as u8; - let g = 255 * ((x & 32) == 0) as u8; - image_data.extend_from_slice(&[0, g, r, 0xff]); - } - } - - let mut updates = ResourceUpdates::new(); - updates.update_image( - self.image_key, - ImageDescriptor::new(64, 64, ImageFormat::BGRA8, true), - ImageData::new(image_data), - None, - ); - let mut txn = Transaction::new(); - txn.update_resources(updates); - txn.generate_frame(); - api.send_transaction(document_id, txn); + glutin::WindowEvent::KeyboardInput { + input: glutin::KeyboardInput { + state: glutin::ElementState::Pressed, + virtual_keycode: Some(glutin::VirtualKeyCode::Space), + .. + }, + .. + } => { + let mut image_data = Vec::new(); + for y in 0 .. 64 { + for x in 0 .. 64 { + let r = 255 * ((y & 32) == 0) as u8; + let g = 255 * ((x & 32) == 0) as u8; + image_data.extend_from_slice(&[0, g, r, 0xff]); } - _ => {} } + + let mut updates = ResourceUpdates::new(); + updates.update_image( + self.image_key, + ImageDescriptor::new(64, 64, ImageFormat::BGRA8, true), + ImageData::new(image_data), + None, + ); + let mut txn = Transaction::new(); + txn.update_resources(updates); + txn.generate_frame(); + api.send_transaction(document_id, txn); } _ => {} } diff --git a/webrender/examples/multiwindow.rs b/webrender/examples/multiwindow.rs index 977812c42d..83e2125698 100644 --- a/webrender/examples/multiwindow.rs +++ b/webrender/examples/multiwindow.rs @@ -8,32 +8,33 @@ extern crate gleam; extern crate glutin; extern crate webrender; -use app_units::Au; use std::fs::File; use std::io::Read; use webrender::api::*; +use app_units::Au; use gleam::gl; +use glutin::GlContext; struct Notifier { - window_proxy: glutin::WindowProxy, + events_proxy: glutin::EventsLoopProxy, } impl Notifier { - fn new(window_proxy: glutin::WindowProxy) -> Notifier { - Notifier { window_proxy } + fn new(events_proxy: glutin::EventsLoopProxy) -> Notifier { + Notifier { events_proxy } } } impl RenderNotifier for Notifier { fn clone(&self) -> Box { Box::new(Notifier { - window_proxy: self.window_proxy.clone(), + events_proxy: self.events_proxy.clone(), }) } fn wake_up(&self) { #[cfg(not(target_os = "android"))] - self.window_proxy.wakeup_event_loop(); + let _ = self.events_proxy.wakeup(); } fn new_document_ready(&self, _: DocumentId, _scrolled: bool, _composite_needed: bool) { @@ -42,7 +43,8 @@ impl RenderNotifier for Notifier { } struct Window { - window: glutin::Window, + events_loop: glutin::EventsLoop, //TODO: share events loop? + window: glutin::GlWindow, renderer: webrender::Renderer, name: &'static str, pipeline_id: PipelineId, @@ -53,16 +55,18 @@ struct Window { } impl Window { - fn new(name: &'static str, clear_color: ColorF) -> Window { - let window = glutin::WindowBuilder::new() - .with_title(name) - .with_multitouch() - .with_dimensions(800, 600) + fn new(name: &'static str, clear_color: ColorF) -> Self { + let events_loop = glutin::EventsLoop::new(); + let context_builder = glutin::ContextBuilder::new() .with_gl(glutin::GlRequest::GlThenGles { opengl_version: (3, 2), opengles_version: (3, 0), - }) - .build() + }); + let window_builder = glutin::WindowBuilder::new() + .with_title(name) + .with_multitouch() + .with_dimensions(800, 600); + let window = glutin::GlWindow::new(window_builder, context_builder, &events_loop) .unwrap(); unsafe { @@ -89,10 +93,10 @@ impl Window { }; let framebuffer_size = { - let (width, height) = window.get_inner_size_pixels().unwrap(); + let (width, height) = window.get_inner_size().unwrap(); DeviceUintSize::new(width, height) }; - let notifier = Box::new(Notifier::new(window.create_window_proxy())); + let notifier = Box::new(Notifier::new(events_loop.create_proxy())); let (renderer, sender) = webrender::Renderer::new(gl.clone(), notifier, opts).unwrap(); let api = sender.create_api(); let document_id = api.add_document(framebuffer_size, 0); @@ -113,6 +117,7 @@ impl Window { api.send_transaction(document_id, txn); Window { + events_loop, window, renderer, name, @@ -128,27 +133,43 @@ impl Window { unsafe { self.window.make_current().ok(); } - - for event in self.window.poll_events() { - match event { - glutin::Event::Closed | - glutin::Event::KeyboardInput(_, _, Some(glutin::VirtualKeyCode::Escape)) => return true, - - glutin::Event::KeyboardInput( - glutin::ElementState::Pressed, - _, - Some(glutin::VirtualKeyCode::P), - ) => { - println!("toggle flags {}", self.name); - self.renderer.toggle_debug_flags(webrender::DebugFlags::PROFILER_DBG); + let mut do_exit = false; + let my_name = &self.name; + let renderer = &mut self.renderer; + + self.events_loop.poll_events(|global_event| match global_event { + glutin::Event::WindowEvent { event, .. } => match event { + glutin::WindowEvent::Closed | + glutin::WindowEvent::KeyboardInput { + input: glutin::KeyboardInput { + virtual_keycode: Some(glutin::VirtualKeyCode::Escape), + .. + }, + .. + } => { + do_exit = true + } + glutin::WindowEvent::KeyboardInput { + input: glutin::KeyboardInput { + state: glutin::ElementState::Pressed, + virtual_keycode: Some(glutin::VirtualKeyCode::P), + .. + }, + .. + } => { + println!("toggle flags {}", my_name); + renderer.toggle_debug_flags(webrender::DebugFlags::PROFILER_DBG); } - _ => {} } + _ => {} + }); + if do_exit { + return true } let framebuffer_size = { - let (width, height) = self.window.get_inner_size_pixels().unwrap(); + let (width, height) = self.window.get_inner_size().unwrap(); DeviceUintSize::new(width, height) }; let device_pixel_ratio = self.window.hidpi_factor(); @@ -245,8 +266,8 @@ impl Window { txn.generate_frame(); self.api.send_transaction(self.document_id, txn); - self.renderer.update(); - self.renderer.render(framebuffer_size).unwrap(); + renderer.update(); + renderer.render(framebuffer_size).unwrap(); self.window.swap_buffers().ok(); false diff --git a/webrender/examples/scrolling.rs b/webrender/examples/scrolling.rs index 3475930092..b32c91f85d 100644 --- a/webrender/examples/scrolling.rs +++ b/webrender/examples/scrolling.rs @@ -135,10 +135,17 @@ impl Example for App { builder.pop_stacking_context(); } - fn on_event(&mut self, event: glutin::Event, api: &RenderApi, document_id: DocumentId) -> bool { + fn on_event(&mut self, event: glutin::WindowEvent, api: &RenderApi, document_id: DocumentId) -> bool { let mut txn = Transaction::new(); match event { - glutin::Event::KeyboardInput(glutin::ElementState::Pressed, _, Some(key)) => { + glutin::WindowEvent::KeyboardInput { + input: glutin::KeyboardInput { + state: glutin::ElementState::Pressed, + virtual_keycode: Some(key), + .. + }, + .. + } => { let offset = match key { glutin::VirtualKeyCode::Down => (0.0, -10.0), glutin::VirtualKeyCode::Up => (0.0, 10.0), @@ -153,14 +160,10 @@ impl Example for App { ScrollEventPhase::Start, ); } - glutin::Event::MouseMoved(x, y) => { + glutin::WindowEvent::CursorMoved { position: (x, y), .. } => { self.cursor_position = WorldPoint::new(x as f32, y as f32); } - glutin::Event::MouseWheel(delta, _, event_cursor_position) => { - if let Some((x, y)) = event_cursor_position { - self.cursor_position = WorldPoint::new(x as f32, y as f32); - } - + glutin::WindowEvent::MouseWheel { delta, .. } => { const LINE_HEIGHT: f32 = 38.0; let (dx, dy) = match delta { glutin::MouseScrollDelta::LineDelta(dx, dy) => (dx, dy * LINE_HEIGHT), diff --git a/webrender/examples/texture_cache_stress.rs b/webrender/examples/texture_cache_stress.rs index c6d842cf97..e5fab0acf1 100644 --- a/webrender/examples/texture_cache_stress.rs +++ b/webrender/examples/texture_cache_stress.rs @@ -186,12 +186,19 @@ impl Example for App { fn on_event( &mut self, - event: glutin::Event, + event: glutin::WindowEvent, api: &RenderApi, _document_id: DocumentId, ) -> bool { match event { - glutin::Event::KeyboardInput(glutin::ElementState::Pressed, _, Some(key)) => { + glutin::WindowEvent::KeyboardInput { + input: glutin::KeyboardInput { + state: glutin::ElementState::Pressed, + virtual_keycode: Some(key), + .. + }, + .. + } => { let mut updates = ResourceUpdates::new(); match key { diff --git a/webrender/examples/yuv.rs b/webrender/examples/yuv.rs index 5ae3326609..2a1c649fa3 100644 --- a/webrender/examples/yuv.rs +++ b/webrender/examples/yuv.rs @@ -240,10 +240,10 @@ impl Example for App { builder.pop_stacking_context(); } - fn on_event(&mut self, event: glutin::Event, api: &RenderApi, document_id: DocumentId) -> bool { + fn on_event(&mut self, event: glutin::WindowEvent, api: &RenderApi, document_id: DocumentId) -> bool { let mut txn = Transaction::new(); match event { - glutin::Event::Touch(touch) => match self.touch_state.handle_event(touch) { + glutin::WindowEvent::Touch(touch) => match self.touch_state.handle_event(touch) { TouchResult::Pan(pan) => { txn.set_pan(pan); } From 40fbaccf5c2d606f5dd0e1da212d3ba5bd5eafeb Mon Sep 17 00:00:00 2001 From: Dzmitry Malyshau Date: Tue, 6 Feb 2018 15:24:10 -0500 Subject: [PATCH 2/4] Port wrench to Glutin upstream --- .travis.yml | 1 + Cargo.lock | 51 +------------ webrender/examples/common/boilerplate.rs | 6 +- wrench/Cargo.toml | 7 +- wrench/README.md | 4 +- wrench/src/main.rs | 92 +++++++++++++----------- wrench/src/wrench.rs | 22 +++--- 7 files changed, 72 insertions(+), 111 deletions(-) diff --git a/.travis.yml b/.travis.yml index 2d51c19a1f..e42488133b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -49,6 +49,7 @@ script: - if [ $BUILD_KIND = DEBUG ]; then (cd webrender && cargo build --verbose --no-default-features); fi - if [ $BUILD_KIND = DEBUG ]; then (cd webrender && cargo build --verbose --features profiler,capture); fi - if [ $BUILD_KIND = DEBUG ]; then (cd webrender && cargo build --verbose --features replay); fi + - if [ $BUILD_KIND = DEBUG ]; then (cd wrench && cargo build --verbose --features env_logger); fi - if [ $BUILD_KIND = DEBUG ]; then (cargo test --all --verbose); fi - if [ $BUILD_KIND = RELEASE ]; then (cd wrench && python script/headless.py reftest); fi - if [ $BUILD_KIND = RELEASE ]; then (cd wrench && cargo build --release); fi diff --git a/Cargo.lock b/Cargo.lock index 090bb085c3..01ad8ebb7b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -162,18 +162,6 @@ dependencies = [ "objc 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "cocoa" -version = "0.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "bitflags 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "block 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", - "core-graphics 0.13.0 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.20 (registry+https://github.com/rust-lang/crates.io-index)", - "objc 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "color_quant" version = "1.0.0" @@ -309,15 +297,6 @@ dependencies = [ "num-traits 0.1.37 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "env_logger" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", - "regex 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "env_logger" version = "0.5.3" @@ -943,27 +922,6 @@ dependencies = [ "pkg-config 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "servo-glutin" -version = "0.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "android_glue 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", - "cgl 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", - "cocoa 0.14.0 (registry+https://github.com/rust-lang/crates.io-index)", - "core-foundation 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", - "core-graphics 0.13.0 (registry+https://github.com/rust-lang/crates.io-index)", - "gl_generator 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", - "image 0.17.0 (registry+https://github.com/rust-lang/crates.io-index)", - "lazy_static 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.20 (registry+https://github.com/rust-lang/crates.io-index)", - "objc 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", - "osmesa-sys 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", - "shared_library 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", - "x11-dl 2.12.0 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "sha1" version = "0.2.0" @@ -1364,19 +1322,19 @@ dependencies = [ "core-graphics 0.13.0 (registry+https://github.com/rust-lang/crates.io-index)", "crossbeam 0.2.12 (registry+https://github.com/rust-lang/crates.io-index)", "dwrote 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", - "env_logger 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", + "env_logger 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)", "euclid 0.16.0 (registry+https://github.com/rust-lang/crates.io-index)", "font-loader 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", "gleam 0.4.20 (registry+https://github.com/rust-lang/crates.io-index)", + "glutin 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)", "image 0.17.0 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", "osmesa-src 17.4.0-devel (git+https://github.com/servo/osmesa-src)", "osmesa-sys 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "ron 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.27 (registry+https://github.com/rust-lang/crates.io-index)", "serde_json 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", - "servo-glutin 0.14.0 (registry+https://github.com/rust-lang/crates.io-index)", "time 0.1.36 (registry+https://github.com/rust-lang/crates.io-index)", "webrender 0.57.0", "webrender_api 0.57.0", @@ -1461,7 +1419,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum cmake 0.1.20 (registry+https://github.com/rust-lang/crates.io-index)" = "a3a6805df695087e7c1bcd9a82e03ad6fb864c8e67ac41b1348229ce5b7f0407" "checksum coco 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "c06169f5beb7e31c7c67ebf5540b8b472d23e3eade3b2ec7d1f5b504a85f91bd" "checksum cocoa 0.13.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ac0d785ff4faf0ff23d7b5561346bb50dc7ef9a11cb0e65e07ef776b7752938f" -"checksum cocoa 0.14.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b0c23085dde1ef4429df6e5896b89356d35cdd321fb43afe3e378d010bb5adc6" "checksum color_quant 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "a475fc4af42d83d28adf72968d9bcfaf035a1a9381642d8e85d8a04957767b0d" "checksum core-foundation 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)" = "8047f547cd6856d45b1cdd75ef8d2f21f3d0e4bf1dab0a0041b0ae9a5dda9c0e" "checksum core-foundation 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "286e0b41c3a20da26536c6000a280585d519fd07b3956b43aed8a79e9edce980" @@ -1478,7 +1435,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum dwrote 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "a207eb7b40e25d1d28dc679f451d321fb6954b73ceaa47986702575865469461" "checksum either 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "18785c1ba806c258137c937e44ada9ee7e69a37e3c72077542cd2f069d78562a" "checksum enum_primitive 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "be4551092f4d519593039259a9ed8daedf0da12e5109c5280338073eaeb81180" -"checksum env_logger 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "e3856f1697098606fc6cb97a93de88ca3f3bc35bb878c725920e6e82ecf05e83" "checksum env_logger 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)" = "f15f0b172cb4f52ed5dbf47f774a387cd2315d1bf7894ab5af9b083ae27efa5a" "checksum euclid 0.16.0 (registry+https://github.com/rust-lang/crates.io-index)" = "926c639bfdff1f3063f76bb66245f6d2b691aa20fdbaabecc38b2947a13a4eba" "checksum expat-sys 2.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "cef36cd1a8a02d28b91d97347c63247b9e4cb8a8e36df36f8201dc87a1c0859c" @@ -1553,7 +1509,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum servo-fontconfig 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "a088f8d775a5c5314aae09bd77340bc9c67d72b9a45258be34c83548b4814cd9" "checksum servo-fontconfig-sys 4.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "6be80777ee6edecbbbf8774c76e19dddfe336256c57a4ded06d6ad3df7be358e" "checksum servo-freetype-sys 4.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "9232032c2e85118c0282c6562c84cab12316e655491ba0a5d1905b2320060d1b" -"checksum servo-glutin 0.14.0 (registry+https://github.com/rust-lang/crates.io-index)" = "4cb5211b22c2ef903a2ac7dd384dabdfaeb176128cbd7409ec49381f69887df1" "checksum sha1 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "cc30b1e1e8c40c121ca33b86c23308a090d19974ef001b4bf6e61fd1a0fb095c" "checksum shared_library 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "fb04126b6fcfd2710fb5b6d18f4207b6c535f2850a7e1a43bcd526d44f30a79a" "checksum shell32-sys 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "9ee04b46101f57121c9da2b151988283b6beb79b34f5bb29a58ee48cb695122c" diff --git a/webrender/examples/common/boilerplate.rs b/webrender/examples/common/boilerplate.rs index b57f01776f..5574b047ba 100644 --- a/webrender/examples/common/boilerplate.rs +++ b/webrender/examples/common/boilerplate.rs @@ -193,11 +193,11 @@ pub fn main_wrapper( api.send_transaction(document_id, txn); println!("Entering event loop"); - events_loop.run_forever(|event| { + events_loop.run_forever(|global_event| { let mut txn = Transaction::new(); let mut custom_event = true; - match event { + match global_event { glutin::Event::WindowEvent { event: glutin::WindowEvent::Closed, .. } => return glutin::ControlFlow::Break, glutin::Event::WindowEvent { event: glutin::WindowEvent::KeyboardInput { @@ -236,7 +236,7 @@ pub fn main_wrapper( api.save_capture(path, bits); }, _ => { - let win_event = match event { + let win_event = match global_event { glutin::Event::WindowEvent { event, .. } => event, _ => unreachable!() }; diff --git a/wrench/Cargo.toml b/wrench/Cargo.toml index e0cf01eced..c62c86eefb 100644 --- a/wrench/Cargo.toml +++ b/wrench/Cargo.toml @@ -9,15 +9,15 @@ license = "MPL-2.0" base64 = "0.3" bincode = "0.9" byteorder = "1.0" -env_logger = { version = "0.4", optional = true } +env_logger = { version = "0.5", optional = true } euclid = "0.16" gleam = "0.4" -servo-glutin = "0.14" +glutin = "0.12" app_units = "0.6" image = "0.17" clap = { version = "2", features = ["yaml"] } lazy_static = "1" -log = "0.3" +log = "0.4" yaml-rust = { git = "https://github.com/vvuk/yaml-rust", features = ["preserve_order"] } serde_json = "1.0" ron = "0.1.5" @@ -35,7 +35,6 @@ core-foundation = "0.5" [features] headless = [ "osmesa-sys", "osmesa-src" ] -logging = [ "env_logger" ] [target.'cfg(target_os = "windows")'.dependencies] dwrote = "0.4.1" diff --git a/wrench/README.md b/wrench/README.md index d8dc093700..1119a27112 100644 --- a/wrench/README.md +++ b/wrench/README.md @@ -29,7 +29,7 @@ static ENABLE_RECORDING: bool = true; ## `reftest` Wrench also has a reftest system for catching regressions. -* To run all reftests, run `./headless.py reftest` -* To run specific reftests, run `./headless.py reftest path/to/test/or/dir` +* To run all reftests, run `script/headless.py reftest` +* To run specific reftests, run `script/headless.py reftest path/to/test/or/dir` * To examine test failures, use the [reftest analyzer](https://hg.mozilla.org/mozilla-central/raw-file/tip/layout/tools/reftest/reftest-analyzer.xhtml) * To add a new reftest, create an example frame and a reference frame in `reftests/` and then add an entry to `reftests/reftest.list` diff --git a/wrench/src/main.rs b/wrench/src/main.rs index 4bbaf7d602..8ca5568bdc 100644 --- a/wrench/src/main.rs +++ b/wrench/src/main.rs @@ -57,7 +57,7 @@ mod cgfont_to_data; use binary_frame_reader::BinaryFrameReader; use gleam::gl; -use glutin::{ElementState, VirtualKeyCode, WindowProxy}; +use glutin::{GlContext, VirtualKeyCode}; use perf::PerfHarness; use png::save_flipped; use rawtest::RawtestHarness; @@ -157,7 +157,7 @@ impl HeadlessContext { } pub enum WindowWrapper { - Window(glutin::Window, Rc), + Window(glutin::GlWindow, Rc), Headless(HeadlessContext, Rc), } @@ -173,7 +173,15 @@ impl WindowWrapper { fn get_inner_size(&self) -> DeviceUintSize { let (w, h) = match *self { - WindowWrapper::Window(ref window, _) => window.get_inner_size_pixels().unwrap(), + //HACK: `winit` needs to figure out its hidpi story... + #[cfg(target_os = "macos")] + WindowWrapper::Window(ref window, _) => { + let (w, h) = window.get_inner_size().unwrap(); + let factor = window.hidpi_factor(); + ((w as f32 * factor) as _, (h as f32 * factor) as _) + }, + #[cfg(not(target_os = "macos"))] + WindowWrapper::Window(ref window, _) => window.get_inner_size().unwrap(), WindowWrapper::Headless(ref context, _) => (context.width, context.height), }; DeviceUintSize::new(w, h) @@ -193,13 +201,6 @@ impl WindowWrapper { } } - fn create_window_proxy(&mut self) -> Option { - match *self { - WindowWrapper::Window(ref window, _) => Some(window.create_window_proxy()), - WindowWrapper::Headless(..) => None, - } - } - fn set_title(&mut self, title: &str) { match *self { WindowWrapper::Window(ref window, _) => window.set_title(title), @@ -221,6 +222,7 @@ impl WindowWrapper { } fn make_window( + events_loop: &glutin::EventsLoop, size: DeviceUintSize, dp_ratio: Option, vsync: bool, @@ -241,14 +243,19 @@ fn make_window( }; WindowWrapper::Headless(HeadlessContext::new(size.width, size.height), gl) } else { - let mut builder = glutin::WindowBuilder::new() + let context_builder = glutin::ContextBuilder::new() .with_gl(glutin::GlRequest::GlThenGles { opengl_version: (3, 2), opengles_version: (3, 0), }) + .with_vsync(vsync); + let window_builder = glutin::WindowBuilder::new() + .with_title("WRech") + .with_multitouch() .with_dimensions(size.width, size.height); - builder.opengl.vsync = vsync; - let window = builder.build().unwrap(); + let window = glutin::GlWindow::new(window_builder, context_builder, &events_loop) + .unwrap(); + unsafe { window .make_current() @@ -313,7 +320,7 @@ fn create_notifier() -> (Box, Receiver<()>) { fn main() { #[cfg(feature = "logging")] - env_logger::init().unwrap(); + env_logger::init(); let args_yaml = load_yaml!("args.yaml"); let args = clap::App::from_yaml(args_yaml) @@ -348,7 +355,9 @@ fn main() { .unwrap_or(DeviceUintSize::new(1920, 1080)); let is_headless = args.is_present("headless"); let zoom_factor = args.value_of("zoom").map(|z| z.parse::().unwrap()); - let mut window = make_window(size, dp_ratio, args.is_present("vsync"), is_headless); + + let mut events_loop = glutin::EventsLoop::new(); + let mut window = make_window(&events_loop, size, dp_ratio, args.is_present("vsync"), is_headless); let dp_ratio = dp_ratio.unwrap_or(window.hidpi_factor()); let dim = window.get_inner_size(); @@ -363,6 +372,7 @@ fn main() { }; let mut wrench = Wrench::new( + events_loop.create_proxy(), &mut window, res_path, dp_ratio, @@ -447,42 +457,39 @@ fn main() { wrench.update(dim); thing.do_frame(&mut wrench); - 'outer: loop { + events_loop.run_forever(|global_event| { if let Some(window_title) = wrench.take_title() { window.set_title(&window_title); } - let mut events = Vec::new(); - - match window { - WindowWrapper::Headless(..) => { - events.push(glutin::Event::Awakened); - } - WindowWrapper::Window(ref window, _) => { - events.push(window.wait_events().next().unwrap()); - events.extend(window.poll_events()); - } - } - let mut do_frame = false; let mut do_render = false; - for event in events { - match event { - glutin::Event::Closed => { - break 'outer; + match global_event { + glutin::Event::Awakened => { + do_render = true; + } + glutin::Event::WindowEvent { event, .. } => match event { + glutin::WindowEvent::Closed => { + return glutin::ControlFlow::Break; } - glutin::Event::Refresh | - glutin::Event::Awakened | - glutin::Event::Focused(..) | - glutin::Event::MouseMoved(..) => { + glutin::WindowEvent::Refresh | + glutin::WindowEvent::Focused(..) | + glutin::WindowEvent::CursorMoved { .. } => { do_render = true; } - glutin::Event::KeyboardInput(ElementState::Pressed, _scan_code, Some(vk)) => match vk { + glutin::WindowEvent::KeyboardInput { + input: glutin::KeyboardInput { + state: glutin::ElementState::Pressed, + virtual_keycode: Some(vk), + .. + }, + .. + } => match vk { VirtualKeyCode::Escape => { - break 'outer; + return glutin::ControlFlow::Break; } VirtualKeyCode::P => { wrench.renderer.toggle_debug_flags(DebugFlags::PROFILER_DBG); @@ -556,8 +563,9 @@ fn main() { _ => {} } _ => {} - } - } + }, + _ => return glutin::ControlFlow::Continue, + }; let dim = window.get_inner_size(); wrench.update(dim); @@ -581,7 +589,9 @@ fn main() { thing.next_frame(); } } - } + + glutin::ControlFlow::Continue + }); if is_headless { let rect = DeviceUintRect::new(DeviceUintPoint::zero(), size); diff --git a/wrench/src/wrench.rs b/wrench/src/wrench.rs index 8dbad50729..03557a34c5 100644 --- a/wrench/src/wrench.rs +++ b/wrench/src/wrench.rs @@ -10,7 +10,7 @@ use crossbeam::sync::chase_lev; use dwrote; #[cfg(any(target_os = "linux", target_os = "macos"))] use font_loader::system_fonts; -use glutin::WindowProxy; +use glutin::EventsLoopProxy; use json_frame_writer::JsonFrameWriter; use ron_frame_writer::RonFrameWriter; use std::collections::HashMap; @@ -46,7 +46,7 @@ pub enum SaveType { } struct NotifierData { - window_proxy: Option, + events_loop_proxy: EventsLoopProxy, frames_notified: u32, timing_receiver: chase_lev::Stealer, verbose: bool, @@ -54,12 +54,12 @@ struct NotifierData { impl NotifierData { fn new( - window_proxy: Option, + events_loop_proxy: EventsLoopProxy, timing_receiver: chase_lev::Stealer, verbose: bool, ) -> Self { NotifierData { - window_proxy, + events_loop_proxy, frames_notified: 0, timing_receiver, verbose, @@ -91,10 +91,8 @@ impl Notifier { } } } - if let Some(ref window_proxy) = data.window_proxy { - #[cfg(not(target_os = "android"))] - window_proxy.wakeup_event_loop(); - } + #[cfg(not(target_os = "android"))] + let _ = data.events_loop_proxy.wakeup(); } } @@ -164,6 +162,7 @@ pub struct Wrench { impl Wrench { pub fn new( + proxy: EventsLoopProxy, window: &mut WindowWrapper, shader_override_path: Option, dp_ratio: f32, @@ -214,12 +213,9 @@ impl Wrench { ..Default::default() }; - let proxy = window.create_window_proxy(); // put an Awakened event into the queue to kick off the first frame - if let Some(ref wp) = proxy { - #[cfg(not(target_os = "android"))] - wp.wakeup_event_loop(); - } + #[cfg(not(target_os = "android"))] + let _ = proxy.wakeup(); let (timing_sender, timing_receiver) = chase_lev::deque(); let notifier = notifier.unwrap_or_else(|| { From 92901ad588ae1de69386311a1621b213c9e2f914 Mon Sep 17 00:00:00 2001 From: Dzmitry Malyshau Date: Wed, 7 Feb 2018 15:26:35 -0500 Subject: [PATCH 3/4] Don't create glutin EventsLoop on headless --- wrench/src/main.rs | 130 +++++++++++++++++++++++-------------------- wrench/src/wrench.rs | 19 ++++--- 2 files changed, 83 insertions(+), 66 deletions(-) diff --git a/wrench/src/main.rs b/wrench/src/main.rs index 8ca5568bdc..db289ef422 100644 --- a/wrench/src/main.rs +++ b/wrench/src/main.rs @@ -100,7 +100,7 @@ pub struct HeadlessContext { impl HeadlessContext { #[cfg(feature = "headless")] - fn new(width: u32, height: u32) -> HeadlessContext { + fn new(width: u32, height: u32) -> Self { let mut attribs = Vec::new(); attribs.push(osmesa_sys::OSMESA_PROFILE); @@ -140,7 +140,7 @@ impl HeadlessContext { } #[cfg(not(feature = "headless"))] - fn new(width: u32, height: u32) -> HeadlessContext { + fn new(width: u32, height: u32) -> Self { HeadlessContext { width, height } } @@ -167,7 +167,7 @@ impl WindowWrapper { fn swap_buffers(&self) { match *self { WindowWrapper::Window(ref window, _) => window.swap_buffers().unwrap(), - WindowWrapper::Headless(..) => {} + WindowWrapper::Headless(_, _) => {} } } @@ -190,7 +190,7 @@ impl WindowWrapper { fn hidpi_factor(&self) -> f32 { match *self { WindowWrapper::Window(ref window, _) => window.hidpi_factor(), - WindowWrapper::Headless(..) => 1.0, + WindowWrapper::Headless(_, _) => 1.0, } } @@ -204,7 +204,7 @@ impl WindowWrapper { fn set_title(&mut self, title: &str) { match *self { WindowWrapper::Window(ref window, _) => window.set_title(title), - WindowWrapper::Headless(..) => (), + WindowWrapper::Headless(_, _) => (), } } @@ -222,56 +222,58 @@ impl WindowWrapper { } fn make_window( - events_loop: &glutin::EventsLoop, size: DeviceUintSize, dp_ratio: Option, vsync: bool, - headless: bool, + events_loop: &Option, ) -> WindowWrapper { - let wrapper = if headless { - let gl = match gl::GlType::default() { - gl::GlType::Gl => unsafe { - gl::GlFns::load_with(|symbol| { - HeadlessContext::get_proc_address(symbol) as *const _ + let wrapper = match *events_loop { + Some(ref events_loop) => { + let context_builder = glutin::ContextBuilder::new() + .with_gl(glutin::GlRequest::GlThenGles { + opengl_version: (3, 2), + opengles_version: (3, 0), }) - }, - gl::GlType::Gles => unsafe { - gl::GlesFns::load_with(|symbol| { - HeadlessContext::get_proc_address(symbol) as *const _ - }) - }, - }; - WindowWrapper::Headless(HeadlessContext::new(size.width, size.height), gl) - } else { - let context_builder = glutin::ContextBuilder::new() - .with_gl(glutin::GlRequest::GlThenGles { - opengl_version: (3, 2), - opengles_version: (3, 0), - }) - .with_vsync(vsync); - let window_builder = glutin::WindowBuilder::new() - .with_title("WRech") - .with_multitouch() - .with_dimensions(size.width, size.height); - let window = glutin::GlWindow::new(window_builder, context_builder, &events_loop) - .unwrap(); + .with_vsync(vsync); + let window_builder = glutin::WindowBuilder::new() + .with_title("WRech") + .with_multitouch() + .with_dimensions(size.width, size.height); + let window = glutin::GlWindow::new(window_builder, context_builder, events_loop) + .unwrap(); - unsafe { - window - .make_current() - .expect("unable to make context current!"); - } + unsafe { + window + .make_current() + .expect("unable to make context current!"); + } - let gl = match window.get_api() { - glutin::Api::OpenGl => unsafe { - gl::GlFns::load_with(|symbol| window.get_proc_address(symbol) as *const _) - }, - glutin::Api::OpenGlEs => unsafe { - gl::GlesFns::load_with(|symbol| window.get_proc_address(symbol) as *const _) - }, - glutin::Api::WebGl => unimplemented!(), - }; - WindowWrapper::Window(window, gl) + let gl = match window.get_api() { + glutin::Api::OpenGl => unsafe { + gl::GlFns::load_with(|symbol| window.get_proc_address(symbol) as *const _) + }, + glutin::Api::OpenGlEs => unsafe { + gl::GlesFns::load_with(|symbol| window.get_proc_address(symbol) as *const _) + }, + glutin::Api::WebGl => unimplemented!(), + }; + WindowWrapper::Window(window, gl) + } + None => { + let gl = match gl::GlType::default() { + gl::GlType::Gl => unsafe { + gl::GlFns::load_with(|symbol| { + HeadlessContext::get_proc_address(symbol) as *const _ + }) + }, + gl::GlType::Gles => unsafe { + gl::GlesFns::load_with(|symbol| { + HeadlessContext::get_proc_address(symbol) as *const _ + }) + }, + }; + WindowWrapper::Headless(HeadlessContext::new(size.width, size.height), gl) + } }; wrapper.gl().clear_color(0.3, 0.0, 0.0, 1.0); @@ -353,11 +355,15 @@ fn main() { DeviceUintSize::new(w, h) }) .unwrap_or(DeviceUintSize::new(1920, 1080)); - let is_headless = args.is_present("headless"); let zoom_factor = args.value_of("zoom").map(|z| z.parse::().unwrap()); - let mut events_loop = glutin::EventsLoop::new(); - let mut window = make_window(&events_loop, size, dp_ratio, args.is_present("vsync"), is_headless); + let mut events_loop = if args.is_present("headless") { + None + } else { + Some(glutin::EventsLoop::new()) + }; + + let mut window = make_window(size, dp_ratio, args.is_present("vsync"), &events_loop); let dp_ratio = dp_ratio.unwrap_or(window.hidpi_factor()); let dim = window.get_inner_size(); @@ -372,8 +378,8 @@ fn main() { }; let mut wrench = Wrench::new( - events_loop.create_proxy(), &mut window, + events_loop.as_mut().map(|el| el.create_proxy()), res_path, dp_ratio, save_type, @@ -457,7 +463,7 @@ fn main() { wrench.update(dim); thing.do_frame(&mut wrench); - events_loop.run_forever(|global_event| { + let mut body = |wrench: &mut Wrench, global_event: glutin::Event| { if let Some(window_title) = wrench.take_title() { window.set_title(&window_title); } @@ -571,7 +577,7 @@ fn main() { wrench.update(dim); if do_frame { - let frame_num = thing.do_frame(&mut wrench); + let frame_num = thing.do_frame(wrench); unsafe { CURRENT_FRAME_NUMBER = frame_num; } @@ -591,12 +597,18 @@ fn main() { } glutin::ControlFlow::Continue - }); + }; - if is_headless { - let rect = DeviceUintRect::new(DeviceUintPoint::zero(), size); - let pixels = wrench.renderer.read_pixels_rgba8(rect); - save_flipped("screenshot.png", pixels, size); + match events_loop { + None => { + while body(&mut wrench, glutin::Event::Awakened) == glutin::ControlFlow::Continue {} + let rect = DeviceUintRect::new(DeviceUintPoint::zero(), size); + let pixels = wrench.renderer.read_pixels_rgba8(rect); + save_flipped("screenshot.png", pixels, size); + } + Some(ref mut events_loop) => { + events_loop.run_forever(|event| body(&mut wrench, event)); + } } wrench.renderer.deinit(); diff --git a/wrench/src/wrench.rs b/wrench/src/wrench.rs index 03557a34c5..c1abb791ac 100644 --- a/wrench/src/wrench.rs +++ b/wrench/src/wrench.rs @@ -46,7 +46,7 @@ pub enum SaveType { } struct NotifierData { - events_loop_proxy: EventsLoopProxy, + events_loop_proxy: Option, frames_notified: u32, timing_receiver: chase_lev::Stealer, verbose: bool, @@ -54,7 +54,7 @@ struct NotifierData { impl NotifierData { fn new( - events_loop_proxy: EventsLoopProxy, + events_loop_proxy: Option, timing_receiver: chase_lev::Stealer, verbose: bool, ) -> Self { @@ -91,8 +91,11 @@ impl Notifier { } } } - #[cfg(not(target_os = "android"))] - let _ = data.events_loop_proxy.wakeup(); + + if let Some(ref elp) = data.events_loop_proxy { + #[cfg(not(target_os = "android"))] + let _ = elp.wakeup(); + } } } @@ -162,8 +165,8 @@ pub struct Wrench { impl Wrench { pub fn new( - proxy: EventsLoopProxy, window: &mut WindowWrapper, + proxy: Option, shader_override_path: Option, dp_ratio: f32, save_type: Option, @@ -214,8 +217,10 @@ impl Wrench { }; // put an Awakened event into the queue to kick off the first frame - #[cfg(not(target_os = "android"))] - let _ = proxy.wakeup(); + if let Some(ref elp) = proxy { + #[cfg(not(target_os = "android"))] + let _ = elp.wakeup(); + } let (timing_sender, timing_receiver) = chase_lev::deque(); let notifier = notifier.unwrap_or_else(|| { From 884b5e9fd15514a1d730789b02d4fe68245d9934 Mon Sep 17 00:00:00 2001 From: Dzmitry Malyshau Date: Wed, 7 Feb 2018 15:39:10 -0500 Subject: [PATCH 4/4] TaskCluster syncup --- .taskcluster.yml | 8 ++++++-- webrender/Cargo.toml | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/.taskcluster.yml b/.taskcluster.yml index a589fded6f..ee3e737371 100644 --- a/.taskcluster.yml +++ b/.taskcluster.yml @@ -98,7 +98,9 @@ tasks: servo-tidy && (cd webrender_api && cargo test --verbose --features "ipc") && (cd webrender && cargo build --verbose --no-default-features) && - (cd webrender && cargo build --verbose --features profiler) && + (cd webrender && cargo build --verbose --features capture,profiler) && + (cd webrender && cargo build --verbose --features replay) && + (cd wrench && cargo build --verbose --features env_logger) && (cargo test --all --verbose) routes: - "index.garbage.webrender.ci.{{event.head.user.login}}.{{event.head.repo.branch}}.linux-debug" @@ -171,7 +173,9 @@ tasks: export PKG_CONFIG_PATH="/usr/local/opt/zlib/lib/pkgconfig:$PKG_CONFIG_PATH" && (cd webrender_api && cargo test --verbose --features "ipc") && (cd webrender && cargo build --verbose --no-default-features) && - (cd webrender && cargo build --verbose --features profiler) && + (cd webrender && cargo build --verbose --features capture,profiler) && + (cd webrender && cargo build --verbose --features replay) && + (cd wrench && cargo build --verbose --features env_logger) && (cargo test --all --verbose) routes: - "index.garbage.webrender.ci.{{event.head.user.login}}.{{event.head.repo.branch}}.osx-debug" diff --git a/webrender/Cargo.toml b/webrender/Cargo.toml index b00bb2365e..08f2af2b32 100644 --- a/webrender/Cargo.toml +++ b/webrender/Cargo.toml @@ -43,7 +43,7 @@ ron = { optional = true, version = "0.1.7" } angle = {git = "https://github.com/servo/angle", branch = "servo"} env_logger = "0.5" rand = "0.3" # for the benchmarks -glutin = "0.12" # for the example apps +glutin = "0.12" # for the example apps [target.'cfg(any(target_os = "android", all(unix, not(target_os = "macos"))))'.dependencies] freetype = { version = "0.3", default-features = false }