From d42609fdf52160f17fea3e3a402f4605c35c2d0f Mon Sep 17 00:00:00 2001 From: Martin Robinson Date: Wed, 12 Jul 2017 21:52:27 -0700 Subject: [PATCH] servo: Merge #17694 - Upgrade to the latest version of WebRender (from glennw:webrender-update); r=glennw Source-Repo: https://github.com/servo/servo Source-Revision: 173181a491f18a292ea80acbc25dd561e6e678d8 --HG-- extra : subtree_source : https%3A//hg.mozilla.org/projects/converted-servo-linear extra : subtree_revision : e76e3e725e124e01505676aedcf0d8f6e7d67971 --- servo/Cargo.lock | 162 +++++------ servo/components/canvas/Cargo.toml | 2 +- .../components/canvas/canvas_paint_thread.rs | 16 +- servo/components/canvas/lib.rs | 2 +- servo/components/canvas/webgl_paint_thread.rs | 28 +- servo/components/canvas_traits/Cargo.toml | 2 +- servo/components/canvas_traits/lib.rs | 6 +- servo/components/compositing/Cargo.toml | 2 +- servo/components/compositing/compositor.rs | 38 +-- .../compositing/compositor_thread.rs | 6 +- servo/components/compositing/lib.rs | 2 +- servo/components/compositing/windowing.rs | 2 +- servo/components/constellation/Cargo.toml | 2 +- .../components/constellation/constellation.rs | 6 +- servo/components/constellation/lib.rs | 2 +- servo/components/constellation/pipeline.rs | 6 +- servo/components/gfx/Cargo.toml | 4 +- servo/components/gfx/display_list/mod.rs | 65 +++-- servo/components/gfx/font.rs | 6 +- servo/components/gfx/font_cache_thread.rs | 10 +- servo/components/gfx/font_context.rs | 4 +- servo/components/gfx/lib.rs | 2 +- .../gfx/platform/freetype/font_template.rs | 2 +- .../gfx/platform/macos/font_template.rs | 2 +- .../gfx/platform/windows/font_template.rs | 2 +- servo/components/gfx/text/text_run.rs | 4 +- servo/components/layout/Cargo.toml | 2 +- .../components/layout/display_list_builder.rs | 139 +++++---- servo/components/layout/flow.rs | 2 +- servo/components/layout/lib.rs | 2 +- servo/components/layout/query.rs | 2 +- servo/components/layout/webrender_helpers.rs | 268 +++++++++--------- servo/components/layout_thread/Cargo.toml | 2 +- servo/components/layout_thread/lib.rs | 16 +- servo/components/layout_traits/Cargo.toml | 2 +- servo/components/layout_traits/lib.rs | 4 +- servo/components/msg/Cargo.toml | 2 +- servo/components/msg/constellation_msg.rs | 10 +- servo/components/msg/lib.rs | 2 +- servo/components/net/Cargo.toml | 2 +- servo/components/net/image_cache.rs | 34 +-- servo/components/net/lib.rs | 2 +- servo/components/net_traits/Cargo.toml | 2 +- servo/components/net_traits/image/base.rs | 6 +- servo/components/net_traits/image_cache.rs | 4 +- servo/components/net_traits/lib.rs | 2 +- servo/components/script/Cargo.toml | 2 +- servo/components/script/dom/bindings/trace.rs | 4 +- servo/components/script/dom/document.rs | 2 +- servo/components/script/dom/vrdisplay.rs | 2 +- .../ext/oesvertexarrayobject.rs | 4 +- .../ext/webglvertexarrayobjectoes.rs | 2 +- .../script/dom/webgl_extensions/extensions.rs | 2 +- .../dom/webgl_validations/tex_image_2d.rs | 2 +- servo/components/script/dom/webglbuffer.rs | 6 +- .../components/script/dom/webglframebuffer.rs | 6 +- servo/components/script/dom/webglprogram.rs | 19 +- .../script/dom/webglrenderbuffer.rs | 6 +- .../script/dom/webglrenderingcontext.rs | 32 +-- servo/components/script/dom/webglshader.rs | 8 +- servo/components/script/dom/webgltexture.rs | 6 +- .../script/dom/webgluniformlocation.rs | 2 +- servo/components/script/dom/window.rs | 2 +- servo/components/script/lib.rs | 2 +- .../script_layout_interface/Cargo.toml | 2 +- .../components/script_layout_interface/lib.rs | 2 +- .../components/script_layout_interface/rpc.rs | 2 +- .../script_layout_interface/wrapper_traits.rs | 2 +- servo/components/script_traits/Cargo.toml | 2 +- servo/components/script_traits/lib.rs | 4 +- servo/components/script_traits/script_msg.rs | 2 +- servo/components/servo/Cargo.toml | 2 +- servo/components/servo/lib.rs | 8 +- servo/components/style_traits/lib.rs | 2 +- servo/components/webvr/Cargo.toml | 2 +- servo/components/webvr/lib.rs | 2 +- servo/components/webvr/webvr_thread.rs | 20 +- servo/docs/ORGANIZATION.md | 2 +- servo/ports/cef/Cargo.toml | 2 +- servo/ports/cef/browser_host.rs | 2 +- servo/ports/cef/lib.rs | 2 +- servo/ports/glutin/Cargo.toml | 2 +- servo/ports/glutin/lib.rs | 2 +- servo/ports/glutin/window.rs | 2 +- servo/python/tidy/servo_tidy/licenseck.py | 2 +- .../python/tidy/servo_tidy_tests/rust_tidy.rs | 2 +- 86 files changed, 548 insertions(+), 521 deletions(-) diff --git a/servo/Cargo.lock b/servo/Cargo.lock index f125ab61e870..955269456cd1 100644 --- a/servo/Cargo.lock +++ b/servo/Cargo.lock @@ -108,14 +108,14 @@ dependencies = [ [[package]] name = "azure" -version = "0.19.0" -source = "git+https://github.com/servo/rust-azure#705542c54cda03a7b7f4edf12f60df8b08cc34e4" +version = "0.20.0" +source = "git+https://github.com/servo/rust-azure#71de5aa53e7c6faf10ceadce6538856649099263" dependencies = [ "cmake 0.1.22 (registry+https://github.com/rust-lang/crates.io-index)", "core-foundation 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "core-graphics 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)", - "core-text 5.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "euclid 0.15.0 (registry+https://github.com/rust-lang/crates.io-index)", + "core-text 6.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "euclid 0.15.1 (registry+https://github.com/rust-lang/crates.io-index)", "freetype 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.23 (registry+https://github.com/rust-lang/crates.io-index)", "servo-egl 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", @@ -323,17 +323,17 @@ source = "registry+https://github.com/rust-lang/crates.io-index" name = "canvas" version = "0.0.1" dependencies = [ - "azure 0.19.0 (git+https://github.com/servo/rust-azure)", + "azure 0.20.0 (git+https://github.com/servo/rust-azure)", "canvas_traits 0.0.1", "cssparser 0.17.0 (registry+https://github.com/rust-lang/crates.io-index)", - "euclid 0.15.0 (registry+https://github.com/rust-lang/crates.io-index)", - "gleam 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", + "euclid 0.15.1 (registry+https://github.com/rust-lang/crates.io-index)", + "gleam 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)", "ipc-channel 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", "num-traits 0.1.37 (registry+https://github.com/rust-lang/crates.io-index)", "offscreen_gl_context 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", "servo_config 0.0.1", - "webrender_traits 0.44.0 (git+https://github.com/servo/webrender)", + "webrender_api 0.47.0 (git+https://github.com/servo/webrender)", ] [[package]] @@ -341,12 +341,12 @@ name = "canvas_traits" version = "0.0.1" dependencies = [ "cssparser 0.17.0 (registry+https://github.com/rust-lang/crates.io-index)", - "euclid 0.15.0 (registry+https://github.com/rust-lang/crates.io-index)", + "euclid 0.15.1 (registry+https://github.com/rust-lang/crates.io-index)", "heapsize 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "heapsize_derive 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", "ipc-channel 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.8 (registry+https://github.com/rust-lang/crates.io-index)", - "webrender_traits 0.44.0 (git+https://github.com/servo/webrender)", + "webrender_api 0.47.0 (git+https://github.com/servo/webrender)", ] [[package]] @@ -376,7 +376,7 @@ name = "cgl" version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "gleam 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", + "gleam 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.23 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -482,9 +482,9 @@ dependencies = [ name = "compositing" version = "0.0.1" dependencies = [ - "euclid 0.15.0 (registry+https://github.com/rust-lang/crates.io-index)", + "euclid 0.15.1 (registry+https://github.com/rust-lang/crates.io-index)", "gfx_traits 0.0.1", - "gleam 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", + "gleam 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)", "image 0.12.4 (registry+https://github.com/rust-lang/crates.io-index)", "ipc-channel 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", @@ -497,8 +497,8 @@ dependencies = [ "servo_url 0.0.1", "style_traits 0.0.1", "time 0.1.37 (registry+https://github.com/rust-lang/crates.io-index)", - "webrender 0.44.0 (git+https://github.com/servo/webrender)", - "webrender_traits 0.44.0 (git+https://github.com/servo/webrender)", + "webrender 0.47.0 (git+https://github.com/servo/webrender)", + "webrender_api 0.47.0 (git+https://github.com/servo/webrender)", ] [[package]] @@ -513,7 +513,7 @@ dependencies = [ "compositing 0.0.1", "debugger 0.0.1", "devtools_traits 0.0.1", - "euclid 0.15.0 (registry+https://github.com/rust-lang/crates.io-index)", + "euclid 0.15.1 (registry+https://github.com/rust-lang/crates.io-index)", "gaol 0.0.1 (git+https://github.com/servo/gaol)", "gfx 0.0.1", "gfx_traits 0.0.1", @@ -534,7 +534,7 @@ dependencies = [ "servo_remutex 0.0.1", "servo_url 0.0.1", "style_traits 0.0.1", - "webrender_traits 0.44.0 (git+https://github.com/servo/webrender)", + "webrender_api 0.47.0 (git+https://github.com/servo/webrender)", "webvr_traits 0.0.1", ] @@ -575,7 +575,7 @@ dependencies = [ [[package]] name = "core-text" -version = "5.0.0" +version = "6.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "core-foundation 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -756,8 +756,8 @@ dependencies = [ "cocoa 0.9.2 (registry+https://github.com/rust-lang/crates.io-index)", "compositing 0.0.1", "devtools 0.0.1", - "euclid 0.15.0 (registry+https://github.com/rust-lang/crates.io-index)", - "gleam 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", + "euclid 0.15.1 (registry+https://github.com/rust-lang/crates.io-index)", + "gleam 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)", "glutin_app 0.0.1", "libc 0.2.23 (registry+https://github.com/rust-lang/crates.io-index)", "libservo 0.0.1", @@ -770,7 +770,7 @@ dependencies = [ "servo_geometry 0.0.1", "servo_url 0.0.1", "style_traits 0.0.1", - "webrender_traits 0.44.0 (git+https://github.com/servo/webrender)", + "webrender_api 0.47.0 (git+https://github.com/servo/webrender)", "x11 2.14.0 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -905,7 +905,7 @@ dependencies = [ [[package]] name = "euclid" -version = "0.15.0" +version = "0.15.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "heapsize 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1043,9 +1043,9 @@ dependencies = [ "byteorder 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "core-foundation 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "core-graphics 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)", - "core-text 5.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "core-text 6.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "dwrote 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", - "euclid 0.15.0 (registry+https://github.com/rust-lang/crates.io-index)", + "euclid 0.15.1 (registry+https://github.com/rust-lang/crates.io-index)", "fnv 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)", "fontsan 0.3.2 (git+https://github.com/servo/fontsan)", "freetype 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1074,7 +1074,7 @@ dependencies = [ "truetype 0.26.0 (registry+https://github.com/rust-lang/crates.io-index)", "unicode-bidi 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", "unicode-script 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", - "webrender_traits 0.44.0 (git+https://github.com/servo/webrender)", + "webrender_api 0.47.0 (git+https://github.com/servo/webrender)", "xi-unicode 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "xml5ever 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1120,7 +1120,7 @@ dependencies = [ [[package]] name = "gleam" -version = "0.4.6" +version = "0.4.7" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "gl_generator 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1138,9 +1138,9 @@ version = "0.0.1" dependencies = [ "bitflags 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", "compositing 0.0.1", - "euclid 0.15.0 (registry+https://github.com/rust-lang/crates.io-index)", + "euclid 0.15.1 (registry+https://github.com/rust-lang/crates.io-index)", "gdi32-sys 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", - "gleam 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", + "gleam 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", "msg 0.0.1", "net_traits 0.0.1", @@ -1154,7 +1154,7 @@ dependencies = [ "servo_url 0.0.1", "style_traits 0.0.1", "user32-sys 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", - "webrender_traits 0.44.0 (git+https://github.com/servo/webrender)", + "webrender_api 0.47.0 (git+https://github.com/servo/webrender)", "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", "x11 2.14.0 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1338,7 +1338,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "cgl 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "core-foundation 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", - "gleam 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", + "gleam 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)", "leaky-cow 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.23 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1439,7 +1439,7 @@ dependencies = [ "atomic_refcell 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "bitflags 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)", "canvas_traits 0.0.1", - "euclid 0.15.0 (registry+https://github.com/rust-lang/crates.io-index)", + "euclid 0.15.1 (registry+https://github.com/rust-lang/crates.io-index)", "fnv 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)", "gfx 0.0.1", "gfx_traits 0.0.1", @@ -1469,7 +1469,7 @@ dependencies = [ "style_traits 0.0.1", "unicode-bidi 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", "unicode-script 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", - "webrender_traits 0.44.0 (git+https://github.com/servo/webrender)", + "webrender_api 0.47.0 (git+https://github.com/servo/webrender)", ] [[package]] @@ -1485,7 +1485,7 @@ name = "layout_thread" version = "0.0.1" dependencies = [ "app_units 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", - "euclid 0.15.0 (registry+https://github.com/rust-lang/crates.io-index)", + "euclid 0.15.1 (registry+https://github.com/rust-lang/crates.io-index)", "fnv 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)", "gfx 0.0.1", "gfx_traits 0.0.1", @@ -1510,7 +1510,7 @@ dependencies = [ "servo_geometry 0.0.1", "servo_url 0.0.1", "style 0.0.1", - "webrender_traits 0.44.0 (git+https://github.com/servo/webrender)", + "webrender_api 0.47.0 (git+https://github.com/servo/webrender)", ] [[package]] @@ -1524,7 +1524,7 @@ dependencies = [ "profile_traits 0.0.1", "script_traits 0.0.1", "servo_url 0.0.1", - "webrender_traits 0.44.0 (git+https://github.com/servo/webrender)", + "webrender_api 0.47.0 (git+https://github.com/servo/webrender)", ] [[package]] @@ -1587,10 +1587,10 @@ dependencies = [ "devtools 0.0.1", "devtools_traits 0.0.1", "env_logger 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)", - "euclid 0.15.0 (registry+https://github.com/rust-lang/crates.io-index)", + "euclid 0.15.1 (registry+https://github.com/rust-lang/crates.io-index)", "gaol 0.0.1 (git+https://github.com/servo/gaol)", "gfx 0.0.1", - "gleam 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", + "gleam 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)", "ipc-channel 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", "layout_thread 0.0.1", "log 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1608,8 +1608,8 @@ dependencies = [ "style 0.0.1", "style_traits 0.0.1", "webdriver_server 0.0.1", - "webrender 0.44.0 (git+https://github.com/servo/webrender)", - "webrender_traits 0.44.0 (git+https://github.com/servo/webrender)", + "webrender 0.47.0 (git+https://github.com/servo/webrender)", + "webrender_api 0.47.0 (git+https://github.com/servo/webrender)", "webvr 0.0.1", "webvr_traits 0.0.1", ] @@ -1771,7 +1771,7 @@ dependencies = [ "heapsize 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "heapsize_derive 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.8 (registry+https://github.com/rust-lang/crates.io-index)", - "webrender_traits 0.44.0 (git+https://github.com/servo/webrender)", + "webrender_api 0.47.0 (git+https://github.com/servo/webrender)", ] [[package]] @@ -1821,7 +1821,7 @@ dependencies = [ "unicase 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "url 1.5.1 (registry+https://github.com/rust-lang/crates.io-index)", "uuid 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", - "webrender_traits 0.44.0 (git+https://github.com/servo/webrender)", + "webrender_api 0.47.0 (git+https://github.com/servo/webrender)", ] [[package]] @@ -1879,7 +1879,7 @@ dependencies = [ "servo_url 0.0.1", "url 1.5.1 (registry+https://github.com/rust-lang/crates.io-index)", "uuid 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", - "webrender_traits 0.44.0 (git+https://github.com/servo/webrender)", + "webrender_api 0.47.0 (git+https://github.com/servo/webrender)", ] [[package]] @@ -1983,10 +1983,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "cgl 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "core-foundation 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", - "euclid 0.15.0 (registry+https://github.com/rust-lang/crates.io-index)", + "euclid 0.15.1 (registry+https://github.com/rust-lang/crates.io-index)", "gdi32-sys 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "gl_generator 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)", - "gleam 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", + "gleam 0.4.7 (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 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", "libloading 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2165,7 +2165,7 @@ version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "binary-space-partition 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", - "euclid 0.15.0 (registry+https://github.com/rust-lang/crates.io-index)", + "euclid 0.15.1 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", "num-traits 0.1.37 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -2429,10 +2429,10 @@ dependencies = [ "dom_struct 0.0.1", "domobject_derive 0.0.1", "encoding 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)", - "euclid 0.15.0 (registry+https://github.com/rust-lang/crates.io-index)", + "euclid 0.15.1 (registry+https://github.com/rust-lang/crates.io-index)", "fnv 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)", "gfx_traits 0.0.1", - "gleam 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", + "gleam 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)", "half 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "heapsize 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "heapsize_derive 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2483,7 +2483,7 @@ dependencies = [ "url 1.5.1 (registry+https://github.com/rust-lang/crates.io-index)", "utf-8 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)", "uuid 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", - "webrender_traits 0.44.0 (git+https://github.com/servo/webrender)", + "webrender_api 0.47.0 (git+https://github.com/servo/webrender)", "webvr 0.0.1", "webvr_traits 0.0.1", "xml5ever 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2497,7 +2497,7 @@ dependencies = [ "atomic_refcell 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "canvas_traits 0.0.1", "cssparser 0.17.0 (registry+https://github.com/rust-lang/crates.io-index)", - "euclid 0.15.0 (registry+https://github.com/rust-lang/crates.io-index)", + "euclid 0.15.1 (registry+https://github.com/rust-lang/crates.io-index)", "gfx_traits 0.0.1", "heapsize 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "heapsize_derive 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2514,7 +2514,7 @@ dependencies = [ "servo_atoms 0.0.1", "servo_url 0.0.1", "style 0.0.1", - "webrender_traits 0.44.0 (git+https://github.com/servo/webrender)", + "webrender_api 0.47.0 (git+https://github.com/servo/webrender)", ] [[package]] @@ -2525,7 +2525,7 @@ version = "0.0.1" name = "script_tests" version = "0.0.1" dependencies = [ - "euclid 0.15.0 (registry+https://github.com/rust-lang/crates.io-index)", + "euclid 0.15.1 (registry+https://github.com/rust-lang/crates.io-index)", "msg 0.0.1", "script 0.0.1", "servo_url 0.0.1", @@ -2540,7 +2540,7 @@ dependencies = [ "canvas_traits 0.0.1", "cookie 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)", "devtools_traits 0.0.1", - "euclid 0.15.0 (registry+https://github.com/rust-lang/crates.io-index)", + "euclid 0.15.1 (registry+https://github.com/rust-lang/crates.io-index)", "gfx_traits 0.0.1", "heapsize 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "heapsize_derive 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2559,7 +2559,7 @@ dependencies = [ "style_traits 0.0.1", "time 0.1.37 (registry+https://github.com/rust-lang/crates.io-index)", "url 1.5.1 (registry+https://github.com/rust-lang/crates.io-index)", - "webrender_traits 0.44.0 (git+https://github.com/servo/webrender)", + "webrender_api 0.47.0 (git+https://github.com/servo/webrender)", "webvr_traits 0.0.1", ] @@ -2724,9 +2724,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "cgl 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "cmake 0.1.22 (registry+https://github.com/rust-lang/crates.io-index)", - "euclid 0.15.0 (registry+https://github.com/rust-lang/crates.io-index)", + "euclid 0.15.1 (registry+https://github.com/rust-lang/crates.io-index)", "expat-sys 2.1.4 (registry+https://github.com/rust-lang/crates.io-index)", - "gleam 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", + "gleam 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)", "glx 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "io-surface 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.23 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2777,7 +2777,7 @@ version = "0.0.1" dependencies = [ "android_injected_glue 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", "env_logger 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)", - "euclid 0.15.0 (registry+https://github.com/rust-lang/crates.io-index)", + "euclid 0.15.1 (registry+https://github.com/rust-lang/crates.io-index)", "getopts 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2802,7 +2802,7 @@ name = "servo_geometry" version = "0.0.1" dependencies = [ "app_units 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", - "euclid 0.15.0 (registry+https://github.com/rust-lang/crates.io-index)", + "euclid 0.15.1 (registry+https://github.com/rust-lang/crates.io-index)", "heapsize 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -2968,7 +2968,7 @@ dependencies = [ "cfg-if 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "cssparser 0.17.0 (registry+https://github.com/rust-lang/crates.io-index)", "encoding 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)", - "euclid 0.15.0 (registry+https://github.com/rust-lang/crates.io-index)", + "euclid 0.15.1 (registry+https://github.com/rust-lang/crates.io-index)", "fnv 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)", "heapsize 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "heapsize_derive 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", @@ -3021,7 +3021,7 @@ dependencies = [ "app_units 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", "byteorder 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "cssparser 0.17.0 (registry+https://github.com/rust-lang/crates.io-index)", - "euclid 0.15.0 (registry+https://github.com/rust-lang/crates.io-index)", + "euclid 0.15.1 (registry+https://github.com/rust-lang/crates.io-index)", "html5ever 0.18.0 (registry+https://github.com/rust-lang/crates.io-index)", "parking_lot 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)", "rayon 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)", @@ -3042,7 +3042,7 @@ dependencies = [ "app_units 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", "bitflags 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", "cssparser 0.17.0 (registry+https://github.com/rust-lang/crates.io-index)", - "euclid 0.15.0 (registry+https://github.com/rust-lang/crates.io-index)", + "euclid 0.15.1 (registry+https://github.com/rust-lang/crates.io-index)", "heapsize 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "heapsize_derive 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", "selectors 0.19.0", @@ -3056,7 +3056,7 @@ dependencies = [ "atomic_refcell 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "cssparser 0.17.0 (registry+https://github.com/rust-lang/crates.io-index)", "env_logger 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)", - "euclid 0.15.0 (registry+https://github.com/rust-lang/crates.io-index)", + "euclid 0.15.1 (registry+https://github.com/rust-lang/crates.io-index)", "geckoservo 0.0.1", "libc 0.2.23 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", @@ -3401,7 +3401,7 @@ version = "0.0.1" dependencies = [ "base64 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)", "cookie 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)", - "euclid 0.15.0 (registry+https://github.com/rust-lang/crates.io-index)", + "euclid 0.15.1 (registry+https://github.com/rust-lang/crates.io-index)", "hyper 0.10.10 (registry+https://github.com/rust-lang/crates.io-index)", "image 0.12.4 (registry+https://github.com/rust-lang/crates.io-index)", "ipc-channel 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -3420,22 +3420,22 @@ dependencies = [ [[package]] name = "webrender" -version = "0.44.0" -source = "git+https://github.com/servo/webrender#a787f8eea9b0d7e76783e9ad739a9298d903954f" +version = "0.47.0" +source = "git+https://github.com/servo/webrender#33e6e285553e8f5ab4b17f3ff8f4eeecd76d2264" dependencies = [ "app_units 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", "bincode 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", "bit-set 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", - "bitflags 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", + "bitflags 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)", "byteorder 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "core-graphics 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)", - "core-text 5.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "core-text 6.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "dwrote 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", - "euclid 0.15.0 (registry+https://github.com/rust-lang/crates.io-index)", + "euclid 0.15.1 (registry+https://github.com/rust-lang/crates.io-index)", "fnv 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)", "freetype 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "gamma-lut 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", - "gleam 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", + "gleam 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", "num-traits 0.1.37 (registry+https://github.com/rust-lang/crates.io-index)", @@ -3444,13 +3444,13 @@ dependencies = [ "rayon 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)", "thread_profiler 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", "time 0.1.37 (registry+https://github.com/rust-lang/crates.io-index)", - "webrender_traits 0.44.0 (git+https://github.com/servo/webrender)", + "webrender_api 0.47.0 (git+https://github.com/servo/webrender)", ] [[package]] -name = "webrender_traits" -version = "0.44.0" -source = "git+https://github.com/servo/webrender#a787f8eea9b0d7e76783e9ad739a9298d903954f" +name = "webrender_api" +version = "0.47.0" +source = "git+https://github.com/servo/webrender#33e6e285553e8f5ab4b17f3ff8f4eeecd76d2264" dependencies = [ "app_units 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", "bincode 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -3458,8 +3458,8 @@ dependencies = [ "core-foundation 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "core-graphics 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)", "dwrote 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", - "euclid 0.15.0 (registry+https://github.com/rust-lang/crates.io-index)", - "gleam 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", + "euclid 0.15.1 (registry+https://github.com/rust-lang/crates.io-index)", + "gleam 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)", "heapsize 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "ipc-channel 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", "offscreen_gl_context 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -3476,7 +3476,7 @@ dependencies = [ "msg 0.0.1", "script_traits 0.0.1", "servo_config 0.0.1", - "webrender_traits 0.44.0 (git+https://github.com/servo/webrender)", + "webrender_api 0.47.0 (git+https://github.com/servo/webrender)", "webvr_traits 0.0.1", ] @@ -3595,7 +3595,7 @@ dependencies = [ "checksum aster 0.41.0 (registry+https://github.com/rust-lang/crates.io-index)" = "4ccfdf7355d9db158df68f976ed030ab0f6578af811f5a7bb6dcf221ec24e0e0" "checksum atomic_refcell 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "fb2dcb6e6d35f20276943cc04bb98e538b348d525a04ac79c10021561d202f21" "checksum audio-video-metadata 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "3b6ef29ee98ad95a37f34547fd7fb40724772294110ed6ca0445fc2e964c29d1" -"checksum azure 0.19.0 (git+https://github.com/servo/rust-azure)" = "" +"checksum azure 0.20.0 (git+https://github.com/servo/rust-azure)" = "" "checksum backtrace 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "72f9b4182546f4b04ebc4ab7f84948953a118bd6021a1b6a6c909e3e94f6be76" "checksum backtrace-sys 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)" = "3a0d842ea781ce92be2bf78a9b38883948542749640b8378b3b2f03d1fd9f1ff" "checksum base64 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)" = "30e93c03064e7590d0466209155251b90c22e37fab1daf2771582598b5827557" @@ -3636,7 +3636,7 @@ dependencies = [ "checksum core-foundation 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "f51ce3b8ebe311c56de14231eb57572c15abebd2d32b3bcb99bcdb9c101f5ac3" "checksum core-foundation-sys 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "41115a6aa5d3e1e5ef98148373f25971d1fad53818553f216495f9e67e90a624" "checksum core-graphics 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)" = "a9f841e9637adec70838c537cae52cb4c751cc6514ad05669b51d107c2021c79" -"checksum core-text 5.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "74ba2a7abdccb94fb6c00822addef48504182b285aa45a30e78286487888fcb4" +"checksum core-text 6.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "16ce16d9ed00181016c11ff48e561314bec92bfbce9fe48f319366618d4e5de6" "checksum cssparser 0.17.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e7063452c60432cb306ed54d538178c20792d47fa960c240ce6c083239ee55ec" "checksum cssparser-macros 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "079adec4af52bb5275eadd004292028c79eb3c5f5b4ee8086a36d4197032f6df" "checksum dbghelp-sys 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "97590ba53bcb8ac28279161ca943a924d1fd4a8fb3fa63302591647c4fc5b850" @@ -3664,7 +3664,7 @@ dependencies = [ "checksum env_logger 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)" = "3ddf21e73e016298f5cb37d6ef8e8da8e39f91f9ec8b0df44b7deb16a9f8cd5b" "checksum error-chain 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d9435d864e017c3c6afeac1654189b06cdb491cf2ff73dbf0d73b0f292f42ff8" "checksum error-chain 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)" = "318cb3c71ee4cdea69fdc9e15c173b245ed6063e1709029e8fd32525a881120f" -"checksum euclid 0.15.0 (registry+https://github.com/rust-lang/crates.io-index)" = "afc5fcf274fa860e18379115ac336e9b41553f61c9ed34ad09e8101ed3defae2" +"checksum euclid 0.15.1 (registry+https://github.com/rust-lang/crates.io-index)" = "7be9fcb1ce77782eb620253eb02bc1f000545f3c360841a26cda572f10fad4ff" "checksum expat-sys 2.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "cef36cd1a8a02d28b91d97347c63247b9e4cb8a8e36df36f8201dc87a1c0859c" "checksum extra-default 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ca1434e1920ba21b45516c16b5edbd82e8f2e4349b12a7a53eb9903ed2928d56" "checksum flate2 0.2.19 (registry+https://github.com/rust-lang/crates.io-index)" = "36df0166e856739905cd3d7e0b210fe818592211a008862599845e012d8d304c" @@ -3681,7 +3681,7 @@ dependencies = [ "checksum getopts 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)" = "d9047cfbd08a437050b363d35ef160452c5fe8ea5187ae0a624708c91581d685" "checksum gif 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)" = "8a80d6fe9e52f637df9afd4779449a7be17c39cc9c35b01589bb833f956ba596" "checksum gl_generator 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)" = "0940975a4ca12b088d32b5d5134826c47d2e73de4b0b459b05244c01503eccbb" -"checksum gleam 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)" = "d985c68a0481482f9459e2d2aa8fe56c07088322a59c867117bfe41490d90a85" +"checksum gleam 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)" = "917ee404f414ed77756c12cb44fdcc7cd02f207bf91e1dc91a3ce7da794ec361" "checksum glob 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)" = "8be18de09a56b60ed0edf84bc9df007e30040691af7acd1c41874faac5895bfb" "checksum glx 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "b280007fa9c7442cfd1e0b1addb8d1a59240267110e8705f8f7e2c7bfb7e2f72" "checksum half 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "63d68db75012a85555434ee079e7e6337931f87a087ab2988becbadf64673a7f" @@ -3860,8 +3860,8 @@ dependencies = [ "checksum void 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "6a02e4885ed3bc0f2de90ea6dd45ebcbb66dacffe03547fadbb0eeae2770887d" "checksum walkdir 1.0.7 (registry+https://github.com/rust-lang/crates.io-index)" = "bb08f9e670fab86099470b97cd2b252d6527f0b3cc1401acdb595ffc9dd288ff" "checksum webdriver 0.22.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d548aabf87411b1b4ba91fd07eacd8b238135c7131a452b8a9f6386209167e18" -"checksum webrender 0.44.0 (git+https://github.com/servo/webrender)" = "" -"checksum webrender_traits 0.44.0 (git+https://github.com/servo/webrender)" = "" +"checksum webrender 0.47.0 (git+https://github.com/servo/webrender)" = "" +"checksum webrender_api 0.47.0 (git+https://github.com/servo/webrender)" = "" "checksum winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)" = "167dc9d6949a9b857f3451275e911c3f44255842c1f7a76f33c55103a909087a" "checksum winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "2d315eee3b34aca4797b2da6b13ed88266e6d612562a0c46390af8299fc699bc" "checksum ws 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "04614a58714f3fd4a8b1da4bcae9f031c532d35988c3d39627619248113f8be8" diff --git a/servo/components/canvas/Cargo.toml b/servo/components/canvas/Cargo.toml index cb9b9801937a..0c376db0d2dc 100644 --- a/servo/components/canvas/Cargo.toml +++ b/servo/components/canvas/Cargo.toml @@ -20,4 +20,4 @@ log = "0.3.5" num-traits = "0.1.32" offscreen_gl_context = { version = "0.11", features = ["serde"] } servo_config = {path = "../config"} -webrender_traits = {git = "https://github.com/servo/webrender", features = ["ipc"]} +webrender_api = {git = "https://github.com/servo/webrender", features = ["ipc"]} diff --git a/servo/components/canvas/canvas_paint_thread.rs b/servo/components/canvas/canvas_paint_thread.rs index 344e7d18430d..e2937b097965 100644 --- a/servo/components/canvas/canvas_paint_thread.rs +++ b/servo/components/canvas/canvas_paint_thread.rs @@ -17,7 +17,7 @@ use std::borrow::ToOwned; use std::mem; use std::sync::Arc; use std::thread; -use webrender_traits; +use webrender_api; impl<'a> CanvasPaintThread<'a> { /// It reads image data from the canvas @@ -57,8 +57,8 @@ pub struct CanvasPaintThread<'a> { path_builder: PathBuilder, state: CanvasPaintState<'a>, saved_states: Vec>, - webrender_api: webrender_traits::RenderApi, - image_key: Option, + webrender_api: webrender_api::RenderApi, + image_key: Option, } #[derive(Clone)] @@ -99,7 +99,7 @@ impl<'a> CanvasPaintState<'a> { impl<'a> CanvasPaintThread<'a> { fn new(size: Size2D, - webrender_api_sender: webrender_traits::RenderApiSender, + webrender_api_sender: webrender_api::RenderApiSender, antialias: bool) -> CanvasPaintThread<'a> { let draw_target = CanvasPaintThread::create(size); let path_builder = draw_target.create_path_builder(); @@ -117,7 +117,7 @@ impl<'a> CanvasPaintThread<'a> { /// Creates a new `CanvasPaintThread` and returns an `IpcSender` to /// communicate with it. pub fn start(size: Size2D, - webrender_api_sender: webrender_traits::RenderApiSender, + webrender_api_sender: webrender_api::RenderApiSender, antialias: bool) -> IpcSender { let (sender, receiver) = ipc::channel::().unwrap(); @@ -562,15 +562,15 @@ impl<'a> CanvasPaintThread<'a> { self.drawtarget.snapshot().get_data_surface().with_data(|element| { let size = self.drawtarget.get_size(); - let descriptor = webrender_traits::ImageDescriptor { + let descriptor = webrender_api::ImageDescriptor { width: size.width as u32, height: size.height as u32, stride: None, - format: webrender_traits::ImageFormat::BGRA8, + format: webrender_api::ImageFormat::BGRA8, offset: 0, is_opaque: false, }; - let data = webrender_traits::ImageData::Raw(Arc::new(element.into())); + let data = webrender_api::ImageData::Raw(Arc::new(element.into())); match self.image_key { Some(image_key) => { diff --git a/servo/components/canvas/lib.rs b/servo/components/canvas/lib.rs index b96c07ccba36..a3d90909637a 100644 --- a/servo/components/canvas/lib.rs +++ b/servo/components/canvas/lib.rs @@ -15,7 +15,7 @@ extern crate log; extern crate num_traits; extern crate offscreen_gl_context; extern crate servo_config; -extern crate webrender_traits; +extern crate webrender_api; pub mod canvas_paint_thread; pub mod webgl_paint_thread; diff --git a/servo/components/canvas/webgl_paint_thread.rs b/servo/components/canvas/webgl_paint_thread.rs index 350b5702d9cc..e0fd8b7b8486 100644 --- a/servo/components/canvas/webgl_paint_thread.rs +++ b/servo/components/canvas/webgl_paint_thread.rs @@ -14,7 +14,7 @@ use std::borrow::ToOwned; use std::sync::Arc; use std::sync::mpsc::channel; use std::thread; -use webrender_traits; +use webrender_api; enum GLContextWrapper { Native(GLContext), @@ -88,7 +88,7 @@ impl GLContextWrapper { } } - pub fn apply_command(&self, cmd: webrender_traits::WebGLCommand) { + pub fn apply_command(&self, cmd: webrender_api::WebGLCommand) { match *self { GLContextWrapper::Native(ref ctx) => { cmd.apply(ctx); @@ -101,8 +101,8 @@ impl GLContextWrapper { } enum WebGLPaintTaskData { - WebRender(webrender_traits::RenderApi, webrender_traits::WebGLContextId), - Readback(GLContextWrapper, webrender_traits::RenderApi, Option), + WebRender(webrender_api::RenderApi, webrender_api::WebGLContextId), + Readback(GLContextWrapper, webrender_api::RenderApi, Option), } pub struct WebGLPaintThread { @@ -112,7 +112,7 @@ pub struct WebGLPaintThread { fn create_readback_painter(size: Size2D, attrs: GLContextAttributes, - webrender_api: webrender_traits::RenderApi, + webrender_api: webrender_api::RenderApi, gl_type: gl::GlType) -> Result<(WebGLPaintThread, GLLimits), String> { let context = GLContextWrapper::new(size, attrs, gl_type)?; @@ -128,11 +128,11 @@ fn create_readback_painter(size: Size2D, impl WebGLPaintThread { fn new(size: Size2D, attrs: GLContextAttributes, - webrender_api_sender: webrender_traits::RenderApiSender, + webrender_api_sender: webrender_api::RenderApiSender, gl_type: gl::GlType) -> Result<(WebGLPaintThread, GLLimits), String> { let wr_api = webrender_api_sender.create_api(); - let device_size = webrender_traits::DeviceIntSize::from_untyped(&size); + let device_size = webrender_api::DeviceIntSize::from_untyped(&size); match wr_api.request_webgl_context(&device_size, attrs) { Ok((id, limits)) => { let painter = WebGLPaintThread { @@ -148,7 +148,7 @@ impl WebGLPaintThread { } } - fn handle_webgl_message(&self, message: webrender_traits::WebGLCommand) { + fn handle_webgl_message(&self, message: webrender_api::WebGLCommand) { debug!("WebGL message: {:?}", message); match self.data { WebGLPaintTaskData::WebRender(ref api, id) => { @@ -160,7 +160,7 @@ impl WebGLPaintThread { } } - fn handle_webvr_message(&self, message: webrender_traits::VRCompositorCommand) { + fn handle_webvr_message(&self, message: webrender_api::VRCompositorCommand) { match self.data { WebGLPaintTaskData::WebRender(ref api, id) => { api.send_vr_compositor_command(id, message); @@ -176,7 +176,7 @@ impl WebGLPaintThread { /// communicate with it. pub fn start(size: Size2D, attrs: GLContextAttributes, - webrender_api_sender: webrender_traits::RenderApiSender) + webrender_api_sender: webrender_api::RenderApiSender) -> Result<(IpcSender, GLLimits), String> { let (sender, receiver) = ipc::channel::().unwrap(); let (result_chan, result_port) = channel(); @@ -250,15 +250,15 @@ impl WebGLPaintThread { // rgba -> bgra byte_swap(&mut pixels); - let descriptor = webrender_traits::ImageDescriptor { + let descriptor = webrender_api::ImageDescriptor { width: width as u32, height: height as u32, stride: None, - format: webrender_traits::ImageFormat::BGRA8, + format: webrender_api::ImageFormat::BGRA8, offset: 0, is_opaque: false, }; - let data = webrender_traits::ImageData::Raw(Arc::new(pixels)); + let data = webrender_api::ImageData::Raw(Arc::new(pixels)); match *image_key { Some(image_key) => { @@ -305,7 +305,7 @@ impl WebGLPaintThread { } } WebGLPaintTaskData::WebRender(ref api, id) => { - let device_size = webrender_traits::DeviceIntSize::from_untyped(&size); + let device_size = webrender_api::DeviceIntSize::from_untyped(&size); api.resize_webgl_context(id, &device_size); } } diff --git a/servo/components/canvas_traits/Cargo.toml b/servo/components/canvas_traits/Cargo.toml index d9cbf34cb75e..e939ca3f50c8 100644 --- a/servo/components/canvas_traits/Cargo.toml +++ b/servo/components/canvas_traits/Cargo.toml @@ -16,4 +16,4 @@ heapsize = "0.4" heapsize_derive = "0.1" ipc-channel = "0.8" serde = "1.0" -webrender_traits = {git = "https://github.com/servo/webrender", features = ["ipc"]} +webrender_api = {git = "https://github.com/servo/webrender", features = ["ipc"]} diff --git a/servo/components/canvas_traits/lib.rs b/servo/components/canvas_traits/lib.rs index 8ca3249379ed..1f6d9eda087b 100644 --- a/servo/components/canvas_traits/lib.rs +++ b/servo/components/canvas_traits/lib.rs @@ -13,14 +13,14 @@ extern crate heapsize; #[macro_use] extern crate heapsize_derive; extern crate ipc_channel; #[macro_use] extern crate serde; -extern crate webrender_traits; +extern crate webrender_api; use cssparser::RGBA; use euclid::{Transform2D, Point2D, Vector2D, Rect, Size2D}; use ipc_channel::ipc::IpcSender; use std::default::Default; use std::str::FromStr; -use webrender_traits::{WebGLCommand, WebGLContextId, VRCompositorCommand}; +use webrender_api::{WebGLCommand, WebGLContextId, VRCompositorCommand}; #[derive(Clone, Deserialize, Serialize)] pub enum FillRule { @@ -52,7 +52,7 @@ pub enum CanvasData { #[derive(Clone, Deserialize, Serialize)] pub struct CanvasImageData { - pub image_key: webrender_traits::ImageKey, + pub image_key: webrender_api::ImageKey, } #[derive(Clone, Deserialize, Serialize)] diff --git a/servo/components/compositing/Cargo.toml b/servo/components/compositing/Cargo.toml index de4b6caf22d2..b4f173a8b2ff 100644 --- a/servo/components/compositing/Cargo.toml +++ b/servo/components/compositing/Cargo.toml @@ -26,4 +26,4 @@ servo_url = {path = "../url"} style_traits = {path = "../style_traits"} time = "0.1.17" webrender = {git = "https://github.com/servo/webrender"} -webrender_traits = {git = "https://github.com/servo/webrender", features = ["ipc"]} +webrender_api = {git = "https://github.com/servo/webrender", features = ["ipc"]} diff --git a/servo/components/compositing/compositor.rs b/servo/components/compositing/compositor.rs index 337bf23a4115..e4382f125f08 100644 --- a/servo/components/compositing/compositor.rs +++ b/servo/components/compositing/compositor.rs @@ -34,7 +34,7 @@ use style_traits::viewport::ViewportConstraints; use time::{precise_time_ns, precise_time_s}; use touch::{TouchHandler, TouchAction}; use webrender; -use webrender_traits::{self, ClipId, LayoutPoint, LayoutVector2D, ScrollEventPhase, ScrollLocation, ScrollClamping}; +use webrender_api::{self, ClipId, LayoutPoint, LayoutVector2D, ScrollEventPhase, ScrollLocation, ScrollClamping}; use windowing::{self, MouseWindowEvent, WindowEvent, WindowMethods, WindowNavigateMsg}; #[derive(Debug, PartialEq)] @@ -58,7 +58,7 @@ trait ConvertPipelineIdFromWebRender { fn from_webrender(&self) -> PipelineId; } -impl ConvertPipelineIdFromWebRender for webrender_traits::PipelineId { +impl ConvertPipelineIdFromWebRender for webrender_api::PipelineId { fn from_webrender(&self) -> PipelineId { PipelineId { namespace_id: PipelineNamespaceId(self.0), @@ -180,7 +180,7 @@ pub struct IOCompositor { webrender: webrender::Renderer, /// The webrender interface, if enabled. - webrender_api: webrender_traits::RenderApi, + webrender_api: webrender_api::RenderApi, /// GL functions interface (may be GL or GLES) gl: Rc, @@ -315,7 +315,7 @@ impl RenderNotifier { } } -impl webrender_traits::RenderNotifier for RenderNotifier { +impl webrender_api::RenderNotifier for RenderNotifier { fn new_frame_ready(&mut self) { self.compositor_proxy.recomposite(CompositingReason::NewWebRenderFrame); } @@ -330,7 +330,7 @@ struct CompositorThreadDispatcher { compositor_proxy: CompositorProxy } -impl webrender_traits::RenderDispatcher for CompositorThreadDispatcher { +impl webrender_api::RenderDispatcher for CompositorThreadDispatcher { fn dispatch(&self, f: Box) { self.compositor_proxy.send(Msg::Dispatch(f)); } @@ -704,12 +704,12 @@ impl IOCompositor { let dppx = self.page_zoom * self.hidpi_factor(); let window_rect = { - let offset = webrender_traits::DeviceUintPoint::new(self.window_rect.origin.x, self.window_rect.origin.y); - let size = webrender_traits::DeviceUintSize::new(self.window_rect.size.width, self.window_rect.size.height); - webrender_traits::DeviceUintRect::new(offset, size) + let offset = webrender_api::DeviceUintPoint::new(self.window_rect.origin.x, self.window_rect.origin.y); + let size = webrender_api::DeviceUintSize::new(self.window_rect.size.width, self.window_rect.size.height); + webrender_api::DeviceUintRect::new(offset, size) }; - let frame_size = webrender_traits::DeviceUintSize::new(self.frame_size.width, self.frame_size.height); + let frame_size = webrender_api::DeviceUintSize::new(self.frame_size.width, self.frame_size.height); self.webrender_api.set_window_parameters(frame_size, window_rect); let initial_viewport = self.window_rect.size.to_f32() / dppx; @@ -988,7 +988,7 @@ impl IOCompositor { let cursor = TypedPoint2D::new(-1, -1); // Make sure this hits the base layer. self.pending_scroll_zoom_events.push(ScrollZoomEvent { magnification: magnification, - scroll_location: ScrollLocation::Delta(webrender_traits::LayoutVector2D::from_untyped( + scroll_location: ScrollLocation::Delta(webrender_api::LayoutVector2D::from_untyped( &scroll_delta.to_untyped())), cursor: cursor, phase: ScrollEventPhase::Move(true), @@ -1128,8 +1128,8 @@ impl IOCompositor { let cursor = (combined_event.cursor.to_f32() / self.scale).to_untyped(); - let location = webrender_traits::ScrollLocation::Delta(delta); - let cursor = webrender_traits::WorldPoint::from_untyped(&cursor); + let location = webrender_api::ScrollLocation::Delta(delta); + let cursor = webrender_api::WorldPoint::from_untyped(&cursor); self.webrender_api.scroll(location, cursor, combined_event.phase); last_combined_event = None } @@ -1139,7 +1139,7 @@ impl IOCompositor { (last_combined_event @ &mut None, _) => { *last_combined_event = Some(ScrollZoomEvent { magnification: scroll_event.magnification, - scroll_location: ScrollLocation::Delta(webrender_traits::LayoutVector2D::from_untyped( + scroll_location: ScrollLocation::Delta(webrender_api::LayoutVector2D::from_untyped( &this_delta.to_untyped())), cursor: this_cursor, phase: scroll_event.phase, @@ -1178,14 +1178,14 @@ impl IOCompositor { ScrollLocation::Delta(delta) => { let scaled_delta = (TypedVector2D::from_untyped(&delta.to_untyped()) / self.scale) .to_untyped(); - let calculated_delta = webrender_traits::LayoutVector2D::from_untyped(&scaled_delta); + let calculated_delta = webrender_api::LayoutVector2D::from_untyped(&scaled_delta); ScrollLocation::Delta(calculated_delta) }, // Leave ScrollLocation unchanged if it is Start or End location. sl @ ScrollLocation::Start | sl @ ScrollLocation::End => sl, }; let cursor = (combined_event.cursor.to_f32() / self.scale).to_untyped(); - let cursor = webrender_traits::WorldPoint::from_untyped(&cursor); + let cursor = webrender_api::WorldPoint::from_untyped(&cursor); self.webrender_api.scroll(scroll_location, cursor, combined_event.phase); self.waiting_for_results_of_scroll = true } @@ -1283,7 +1283,7 @@ impl IOCompositor { } fn update_page_zoom_for_webrender(&mut self) { - let page_zoom = webrender_traits::ZoomFactor::new(self.page_zoom.get()); + let page_zoom = webrender_api::ZoomFactor::new(self.page_zoom.get()); self.webrender_api.set_page_zoom(page_zoom); } @@ -1381,8 +1381,8 @@ impl IOCompositor { let mut pipeline_epochs = HashMap::new(); for (id, _) in &self.pipeline_details { let webrender_pipeline_id = id.to_webrender(); - if let Some(webrender_traits::Epoch(epoch)) = self.webrender - .current_epoch(webrender_pipeline_id) { + if let Some(webrender_api::Epoch(epoch)) = self.webrender + .current_epoch(webrender_pipeline_id) { let epoch = Epoch(epoch); pipeline_epochs.insert(*id, epoch); } @@ -1475,7 +1475,7 @@ impl IOCompositor { debug!("compositor: compositing"); // Paint the scene. - let size = webrender_traits::DeviceUintSize::from_untyped(&self.frame_size.to_untyped()); + let size = webrender_api::DeviceUintSize::from_untyped(&self.frame_size.to_untyped()); self.webrender.render(size); }); diff --git a/servo/components/compositing/compositor_thread.rs b/servo/components/compositing/compositor_thread.rs index 7bf54e3ad6a3..5ceb7054d9e2 100644 --- a/servo/components/compositing/compositor_thread.rs +++ b/servo/components/compositing/compositor_thread.rs @@ -19,7 +19,7 @@ use std::sync::mpsc::{Receiver, Sender}; use style_traits::cursor::Cursor; use style_traits::viewport::ViewportConstraints; use webrender; -use webrender_traits; +use webrender_api; /// Used to wake up the event loop, provided by the servo port/embedder. @@ -85,7 +85,7 @@ pub enum Msg { ShutdownComplete, /// Scroll a page in a window - ScrollFragmentPoint(webrender_traits::ClipId, Point2D, bool), + ScrollFragmentPoint(webrender_api::ClipId, Point2D, bool), /// Alerts the compositor that the current page has changed its title. ChangePageTitle(PipelineId, Option), /// Alerts the compositor that the given pipeline has changed whether it is running animations. @@ -194,5 +194,5 @@ pub struct InitialCompositorState { pub mem_profiler_chan: mem::ProfilerChan, /// Instance of webrender API pub webrender: webrender::Renderer, - pub webrender_api_sender: webrender_traits::RenderApiSender, + pub webrender_api_sender: webrender_api::RenderApiSender, } diff --git a/servo/components/compositing/lib.rs b/servo/components/compositing/lib.rs index 8b8fa28b703f..bb1c769eaaf3 100644 --- a/servo/components/compositing/lib.rs +++ b/servo/components/compositing/lib.rs @@ -22,7 +22,7 @@ extern crate servo_url; extern crate style_traits; extern crate time; extern crate webrender; -extern crate webrender_traits; +extern crate webrender_api; pub use compositor_thread::CompositorProxy; pub use compositor::IOCompositor; diff --git a/servo/components/compositing/windowing.rs b/servo/components/compositing/windowing.rs index 94dfca5268ee..32262e5fae35 100644 --- a/servo/components/compositing/windowing.rs +++ b/servo/components/compositing/windowing.rs @@ -16,7 +16,7 @@ use servo_url::ServoUrl; use std::fmt::{Debug, Error, Formatter}; use std::rc::Rc; use style_traits::cursor::Cursor; -use webrender_traits::ScrollLocation; +use webrender_api::ScrollLocation; #[derive(Clone)] pub enum MouseWindowEvent { diff --git a/servo/components/constellation/Cargo.toml b/servo/components/constellation/Cargo.toml index b340a535b003..499a4c2dd057 100644 --- a/servo/components/constellation/Cargo.toml +++ b/servo/components/constellation/Cargo.toml @@ -39,7 +39,7 @@ servo_rand = {path = "../rand"} servo_remutex = {path = "../remutex"} servo_url = {path = "../url"} webvr_traits = {path = "../webvr_traits"} -webrender_traits = {git = "https://github.com/servo/webrender", features = ["ipc"]} +webrender_api = {git = "https://github.com/servo/webrender", features = ["ipc"]} [target.'cfg(not(target_os = "windows"))'.dependencies] gaol = {git = "https://github.com/servo/gaol"} diff --git a/servo/components/constellation/constellation.rs b/servo/components/constellation/constellation.rs index 271db06fa01d..4981980b7245 100644 --- a/servo/components/constellation/constellation.rs +++ b/servo/components/constellation/constellation.rs @@ -128,7 +128,7 @@ use style_traits::CSSPixel; use style_traits::cursor::Cursor; use style_traits::viewport::ViewportConstraints; use timer_scheduler::TimerScheduler; -use webrender_traits; +use webrender_api; use webvr_traits::{WebVREvent, WebVRMsg}; /// The `Constellation` itself. In the servo browser, there is one @@ -230,7 +230,7 @@ pub struct Constellation { /// A channel for the constellation to send messages to the /// Webrender thread. - webrender_api_sender: webrender_traits::RenderApiSender, + webrender_api_sender: webrender_api::RenderApiSender, /// The set of all event loops in the browser. We generate a new /// event loop for each registered domain name (aka eTLD+1) in @@ -326,7 +326,7 @@ pub struct InitialConstellationState { pub mem_profiler_chan: mem::ProfilerChan, /// Webrender API. - pub webrender_api_sender: webrender_traits::RenderApiSender, + pub webrender_api_sender: webrender_api::RenderApiSender, /// Whether the constellation supports the clipboard. /// TODO: this field is not used, remove it? diff --git a/servo/components/constellation/lib.rs b/servo/components/constellation/lib.rs index 608656bb30c2..ec0c513dace3 100644 --- a/servo/components/constellation/lib.rs +++ b/servo/components/constellation/lib.rs @@ -38,7 +38,7 @@ extern crate servo_rand; extern crate servo_remutex; extern crate servo_url; extern crate style_traits; -extern crate webrender_traits; +extern crate webrender_api; extern crate webvr_traits; mod browsingcontext; diff --git a/servo/components/constellation/pipeline.rs b/servo/components/constellation/pipeline.rs index cc6d92bb070e..dd99446bd345 100644 --- a/servo/components/constellation/pipeline.rs +++ b/servo/components/constellation/pipeline.rs @@ -37,7 +37,7 @@ use std::rc::Rc; use std::sync::Arc; use std::sync::mpsc::Sender; use style_traits::CSSPixel; -use webrender_traits; +use webrender_api; use webvr_traits::WebVRMsg; /// A `Pipeline` is the constellation's view of a `Document`. Each pipeline has an @@ -164,7 +164,7 @@ pub struct InitialPipelineState { pub prev_visibility: Option, /// Webrender api. - pub webrender_api_sender: webrender_traits::RenderApiSender, + pub webrender_api_sender: webrender_api::RenderApiSender, /// Whether this pipeline is considered private. pub is_private: bool, @@ -465,7 +465,7 @@ pub struct UnprivilegedPipelineContent { layout_content_process_shutdown_port: IpcReceiver<()>, script_content_process_shutdown_chan: IpcSender<()>, script_content_process_shutdown_port: IpcReceiver<()>, - webrender_api_sender: webrender_traits::RenderApiSender, + webrender_api_sender: webrender_api::RenderApiSender, webvr_thread: Option>, } diff --git a/servo/components/gfx/Cargo.toml b/servo/components/gfx/Cargo.toml index 01250b1dbbbb..443cc44d5671 100644 --- a/servo/components/gfx/Cargo.toml +++ b/servo/components/gfx/Cargo.toml @@ -38,14 +38,14 @@ style_traits = {path = "../style_traits"} time = "0.1.12" unicode-bidi = {version = "0.3", features = ["with_serde"]} unicode-script = {version = "0.1", features = ["harfbuzz"]} -webrender_traits = {git = "https://github.com/servo/webrender", features = ["ipc"]} +webrender_api = {git = "https://github.com/servo/webrender", features = ["ipc"]} xi-unicode = "0.1.0" [target.'cfg(target_os = "macos")'.dependencies] byteorder = "1.0" core-foundation = "0.3" core-graphics = "0.8" -core-text = "5.0" +core-text = "6.0" [target.'cfg(any(target_os = "linux", target_os = "android"))'.dependencies] freetype = "0.2" diff --git a/servo/components/gfx/display_list/mod.rs b/servo/components/gfx/display_list/mod.rs index c8430ab61ad7..9a7d21c468f2 100644 --- a/servo/components/gfx/display_list/mod.rs +++ b/servo/components/gfx/display_list/mod.rs @@ -33,7 +33,8 @@ use style::values::computed::Filter; use style_traits::cursor::Cursor; use text::TextRun; use text::glyph::ByteIndex; -use webrender_traits::{self, ClipId, ColorF, GradientStop, MixBlendMode, ScrollPolicy, TransformStyle, WebGLContextId}; +use webrender_api::{self, ClipId, ColorF, GradientStop, LocalClip, MixBlendMode, ScrollPolicy}; +use webrender_api::{TransformStyle, WebGLContextId}; pub use style::dom::OpaqueNode; @@ -556,6 +557,12 @@ impl fmt::Debug for StackingContext { } } +#[derive(Clone, Debug, HeapSizeOf, Deserialize, Serialize)] +pub enum ScrollRootType { + ScrollFrame, + Clip, +} + /// Defines a stacking context. #[derive(Clone, Debug, HeapSizeOf, Deserialize, Serialize)] pub struct ScrollRoot { @@ -571,6 +578,9 @@ pub struct ScrollRoot { /// The rect of the contents that can be scrolled inside of the scroll root. pub content_rect: Rect, + + /// The type of this ScrollRoot. + pub root_type: ScrollRootType } impl ScrollRoot { @@ -610,8 +620,8 @@ pub struct BaseDisplayItem { /// Metadata attached to this display item. pub metadata: DisplayItemMetadata, - /// The region to clip to. - pub clip: ClippingRegion, + /// The local clip for this item. + pub local_clip: LocalClip, /// The section of the display list that this item belongs to. pub section: DisplayListSection, @@ -627,22 +637,15 @@ impl BaseDisplayItem { #[inline(always)] pub fn new(bounds: &Rect, metadata: DisplayItemMetadata, - clip: &ClippingRegion, + local_clip: LocalClip, section: DisplayListSection, stacking_context_id: StackingContextId, scroll_root_id: ClipId) -> BaseDisplayItem { - // Detect useless clipping regions here and optimize them to `ClippingRegion::max()`. - // The painting backend may want to optimize out clipping regions and this makes it easier - // for it to do so. BaseDisplayItem { bounds: *bounds, metadata: metadata, - clip: if clip.does_not_clip_rect(&bounds) { - ClippingRegion::max() - } else { - (*clip).clone() - }, + local_clip: local_clip, section: section, stacking_context_id: stacking_context_id, scroll_root_id: scroll_root_id, @@ -657,7 +660,7 @@ impl BaseDisplayItem { node: OpaqueNode(0), pointing: None, }, - clip: ClippingRegion::max(), + local_clip: LocalClip::from(max_rect().to_rectf()), section: DisplayListSection::Content, stacking_context_id: StackingContextId::root(), scroll_root_id: pipeline_id.root_scroll_node(), @@ -1023,10 +1026,10 @@ pub struct ImageBorder { pub fill: bool, /// How to repeat or stretch horizontal edges (border-image-repeat). - pub repeat_horizontal: webrender_traits::RepeatMode, + pub repeat_horizontal: webrender_api::RepeatMode, /// How to repeat or stretch vertical edges (border-image-repeat). - pub repeat_vertical: webrender_traits::RepeatMode, + pub repeat_vertical: webrender_api::RepeatMode, } /// A border that is made of linear gradient @@ -1273,7 +1276,7 @@ impl DisplayItem { let point = Point2D::new(point.x - Au::from_f32_px(scroll_offset.x), point.y - Au::from_f32_px(scroll_offset.y)); - if !base_item.clip.might_intersect_point(&point) { + if !base_item.local_clip.clip_rect().contains(&point.to_pointf()) { // Clipped out. return None; } @@ -1356,7 +1359,7 @@ impl fmt::Debug for DisplayItem { DisplayItem::DefineClip(_) => "".to_owned(), }, self.bounds(), - self.base().clip + self.base().local_clip ) } } @@ -1366,7 +1369,7 @@ pub struct WebRenderImageInfo { pub width: u32, pub height: u32, pub format: PixelFormat, - pub key: Option, + pub key: Option, } impl WebRenderImageInfo { @@ -1399,3 +1402,29 @@ impl SimpleMatrixDetection for Transform3D { self.m44 == _1 } } + +trait ToPointF { + fn to_pointf(&self) -> webrender_api::LayoutPoint; +} + +impl ToPointF for Point2D { + fn to_pointf(&self) -> webrender_api::LayoutPoint { + webrender_api::LayoutPoint::new(self.x.to_f32_px(), self.y.to_f32_px()) + } +} + +trait ToRectF { + fn to_rectf(&self) -> webrender_api::LayoutRect; +} + +impl ToRectF for Rect { + fn to_rectf(&self) -> webrender_api::LayoutRect { + let x = self.origin.x.to_f32_px(); + let y = self.origin.y.to_f32_px(); + let w = self.size.width.to_f32_px(); + let h = self.size.height.to_f32_px(); + let point = webrender_api::LayoutPoint::new(x, y); + let size = webrender_api::LayoutSize::new(w, h); + webrender_api::LayoutRect::new(point, size) + } +} diff --git a/servo/components/gfx/font.rs b/servo/components/gfx/font.rs index f2a6acf1c30e..357f61a2d7ab 100644 --- a/servo/components/gfx/font.rs +++ b/servo/components/gfx/font.rs @@ -24,7 +24,7 @@ use text::glyph::{ByteIndex, GlyphData, GlyphId, GlyphStore}; use text::shaping::ShaperMethods; use time; use unicode_script::Script; -use webrender_traits; +use webrender_api; macro_rules! ot_tag { ($t1:expr, $t2:expr, $t3:expr, $t4:expr) => ( @@ -112,7 +112,7 @@ pub struct Font { shaper: Option, shape_cache: RefCell>>, glyph_advance_cache: RefCell>, - pub font_key: webrender_traits::FontKey, + pub font_key: webrender_api::FontKey, } impl Font { @@ -121,7 +121,7 @@ impl Font { descriptor: FontTemplateDescriptor, requested_pt_size: Au, actual_pt_size: Au, - font_key: webrender_traits::FontKey) -> Font { + font_key: webrender_api::FontKey) -> Font { let metrics = handle.metrics(); Font { handle: handle, diff --git a/servo/components/gfx/font_cache_thread.rs b/servo/components/gfx/font_cache_thread.rs index 08863259521d..ac4809023160 100644 --- a/servo/components/gfx/font_cache_thread.rs +++ b/servo/components/gfx/font_cache_thread.rs @@ -26,7 +26,7 @@ use std::thread; use std::u32; use style::font_face::{EffectiveSources, Source}; use style::properties::longhands::font_family::computed_value::{FontFamily, FamilyName}; -use webrender_traits; +use webrender_api; /// A list of font templates that make up a given font family. struct FontTemplates { @@ -36,7 +36,7 @@ struct FontTemplates { #[derive(Serialize, Deserialize, Debug)] pub struct FontTemplateInfo { pub font_template: Arc, - pub font_key: Option, + pub font_key: Option, } impl FontTemplates { @@ -127,8 +127,8 @@ struct FontCache { web_families: HashMap, font_context: FontContextHandle, core_resource_thread: CoreResourceThread, - webrender_api: Option, - webrender_fonts: HashMap, + webrender_api: Option, + webrender_fonts: HashMap, } fn populate_generic_fonts() -> HashMap { @@ -400,7 +400,7 @@ pub struct FontCacheThread { impl FontCacheThread { pub fn new(core_resource_thread: CoreResourceThread, - webrender_api: Option) -> FontCacheThread { + webrender_api: Option) -> FontCacheThread { let (chan, port) = ipc::channel().unwrap(); let channel_to_self = chan.clone(); diff --git a/servo/components/gfx/font_context.rs b/servo/components/gfx/font_context.rs index 20c89f613829..de18c7dcf0a5 100644 --- a/servo/components/gfx/font_context.rs +++ b/servo/components/gfx/font_context.rs @@ -22,7 +22,7 @@ use std::sync::atomic::{AtomicUsize, Ordering, ATOMIC_USIZE_INIT}; use style::computed_values::{font_style, font_variant_caps}; use style::properties::style_structs; use style::stylearc::Arc as StyleArc; -use webrender_traits; +use webrender_api; static SMALL_CAPS_SCALE_FACTOR: f32 = 0.8; // Matches FireFox (see gfxFont.h) @@ -79,7 +79,7 @@ impl FontContext { descriptor: FontTemplateDescriptor, pt_size: Au, variant: font_variant_caps::T, - font_key: webrender_traits::FontKey) -> Result { + font_key: webrender_api::FontKey) -> Result { // TODO: (Bug #3463): Currently we only support fake small-caps // painting. We should also support true small-caps (where the // font supports it) in the future. diff --git a/servo/components/gfx/lib.rs b/servo/components/gfx/lib.rs index 10ba03c0dbc4..b1b9614f7878 100644 --- a/servo/components/gfx/lib.rs +++ b/servo/components/gfx/lib.rs @@ -68,7 +68,7 @@ extern crate style_traits; extern crate time; extern crate unicode_bidi; extern crate unicode_script; -extern crate webrender_traits; +extern crate webrender_api; extern crate xi_unicode; #[cfg(target_os = "android")] extern crate xml5ever; diff --git a/servo/components/gfx/platform/freetype/font_template.rs b/servo/components/gfx/platform/freetype/font_template.rs index 7fab5b9741e2..f61c0a07732a 100644 --- a/servo/components/gfx/platform/freetype/font_template.rs +++ b/servo/components/gfx/platform/freetype/font_template.rs @@ -5,7 +5,7 @@ use servo_atoms::Atom; use std::fs::File; use std::io::{Read, Error}; -use webrender_traits::NativeFontHandle; +use webrender_api::NativeFontHandle; /// Platform specific font representation for Linux. /// The identifier is an absolute path, and the bytes diff --git a/servo/components/gfx/platform/macos/font_template.rs b/servo/components/gfx/platform/macos/font_template.rs index 52d1b4fce57f..643c00a84358 100644 --- a/servo/components/gfx/platform/macos/font_template.rs +++ b/servo/components/gfx/platform/macos/font_template.rs @@ -18,7 +18,7 @@ use std::fs::File; use std::io::{Read, Error as IoError}; use std::ops::Deref; use std::sync::Mutex; -use webrender_traits::NativeFontHandle; +use webrender_api::NativeFontHandle; /// Platform specific font representation for mac. /// The identifier is a PostScript font name. The diff --git a/servo/components/gfx/platform/windows/font_template.rs b/servo/components/gfx/platform/windows/font_template.rs index 30d6a640cf10..d3cc237cd8b8 100644 --- a/servo/components/gfx/platform/windows/font_template.rs +++ b/servo/components/gfx/platform/windows/font_template.rs @@ -5,7 +5,7 @@ use platform::windows::font_list::{descriptor_from_atom, font_from_atom}; use servo_atoms::Atom; use std::io; -use webrender_traits::NativeFontHandle; +use webrender_api::NativeFontHandle; #[derive(Deserialize, Serialize, Debug)] pub struct FontTemplateData { diff --git a/servo/components/gfx/text/text_run.rs b/servo/components/gfx/text/text_run.rs index b65700221f73..05538a45b260 100644 --- a/servo/components/gfx/text/text_run.rs +++ b/servo/components/gfx/text/text_run.rs @@ -14,7 +14,7 @@ use std::sync::Arc; use style::str::char_is_whitespace; use text::glyph::{ByteIndex, GlyphStore}; use unicode_bidi as bidi; -use webrender_traits; +use webrender_api; use xi_unicode::LineBreakIterator; thread_local! { @@ -30,7 +30,7 @@ pub struct TextRun { pub font_template: Arc, pub actual_pt_size: Au, pub font_metrics: FontMetrics, - pub font_key: webrender_traits::FontKey, + pub font_key: webrender_api::FontKey, /// The glyph runs that make up this text run. pub glyphs: Arc>, pub bidi_level: bidi::Level, diff --git a/servo/components/layout/Cargo.toml b/servo/components/layout/Cargo.toml index 63b48fdede5b..35860b3f236a 100644 --- a/servo/components/layout/Cargo.toml +++ b/servo/components/layout/Cargo.toml @@ -44,4 +44,4 @@ style = {path = "../style"} style_traits = {path = "../style_traits"} unicode-bidi = {version = "0.3", features = ["with_serde"]} unicode-script = {version = "0.1", features = ["harfbuzz"]} -webrender_traits = {git = "https://github.com/servo/webrender", features = ["ipc"]} +webrender_api = {git = "https://github.com/servo/webrender", features = ["ipc"]} diff --git a/servo/components/layout/display_list_builder.rs b/servo/components/layout/display_list_builder.rs index 32439819d9b5..dad561ce2ad3 100644 --- a/servo/components/layout/display_list_builder.rs +++ b/servo/components/layout/display_list_builder.rs @@ -21,14 +21,14 @@ use flow_ref::FlowRef; use fragment::{CoordinateSystem, Fragment, ImageFragmentInfo, ScannedTextFragmentInfo}; use fragment::{SpecificFragmentInfo, TruncatedFragmentInfo}; use gfx::display_list; -use gfx::display_list::{BLUR_INFLATION_FACTOR, BaseDisplayItem, BorderDetails}; -use gfx::display_list::{BorderDisplayItem, ImageBorder, NormalBorder}; +use gfx::display_list::{BLUR_INFLATION_FACTOR, BaseDisplayItem, BorderDetails, BorderDisplayItem}; use gfx::display_list::{BorderRadii, BoxShadowClipMode, BoxShadowDisplayItem, ClippingRegion}; use gfx::display_list::{DisplayItem, DisplayItemMetadata, DisplayList, DisplayListSection}; -use gfx::display_list::{GradientDisplayItem, RadialGradientDisplayItem, IframeDisplayItem, ImageDisplayItem}; -use gfx::display_list::{LineDisplayItem, OpaqueNode}; -use gfx::display_list::{SolidColorDisplayItem, ScrollRoot, StackingContext, StackingContextType}; -use gfx::display_list::{TextDisplayItem, TextOrientation, WebGLDisplayItem, WebRenderImageInfo}; +use gfx::display_list::{GradientDisplayItem, IframeDisplayItem, ImageBorder, ImageDisplayItem}; +use gfx::display_list::{LineDisplayItem, NormalBorder, OpaqueNode, RadialGradientDisplayItem}; +use gfx::display_list::{ScrollRoot, ScrollRootType, SolidColorDisplayItem, StackingContext}; +use gfx::display_list::{StackingContextType, TextDisplayItem, TextOrientation, WebGLDisplayItem}; +use gfx::display_list::WebRenderImageInfo; use gfx_traits::{combine_id_with_fragment_type, FragmentType, StackingContextId}; use inline::{FIRST_FRAGMENT_OF_ELEMENT, InlineFlow, LAST_FRAGMENT_OF_ELEMENT}; use ipc_channel::ipc; @@ -71,8 +71,9 @@ use style::values::specified::position::{X, Y}; use style_traits::CSSPixel; use style_traits::cursor::Cursor; use table_cell::CollapsedBordersForCell; -use webrender_helpers::{ToMixBlendMode, ToTransformStyle}; -use webrender_traits::{ColorF, ClipId, GradientStop, RepeatMode, ScrollPolicy, TransformStyle}; +use webrender_api::{ClipId, ColorF, ComplexClipRegion, GradientStop, LocalClip, RepeatMode}; +use webrender_api::{ScrollPolicy, TransformStyle}; +use webrender_helpers::{ToBorderRadius, ToMixBlendMode, ToRectF, ToTransformStyle}; trait ResolvePercentage { fn resolve(&self, length: u32) -> u32; @@ -250,7 +251,7 @@ impl<'a> DisplayListBuildState<'a> { fn create_base_display_item(&self, bounds: &Rect, - clip: &ClippingRegion, + clip: LocalClip, node: OpaqueNode, cursor: Option, section: DisplayListSection) @@ -394,7 +395,7 @@ pub trait FragmentDisplayListBuilding { style: &ServoComputedValues, display_list_section: DisplayListSection, absolute_bounds: &Rect, - clip: &ClippingRegion, + clip: &LocalClip, image_url: &ServoUrl, background_index: usize); @@ -405,7 +406,7 @@ pub trait FragmentDisplayListBuilding { style: &ServoComputedValues, display_list_section: DisplayListSection, absolute_bounds: &Rect, - clip: &ClippingRegion, + clip: &LocalClip, webrender_image: WebRenderImageInfo, index: usize); @@ -416,7 +417,7 @@ pub trait FragmentDisplayListBuilding { style: &ServoComputedValues, display_list_section: DisplayListSection, absolute_bounds: &Rect, - clip: &ClippingRegion, + clip: &LocalClip, paint_worklet: &PaintWorklet, index: usize); @@ -441,8 +442,7 @@ pub trait FragmentDisplayListBuilding { state: &mut DisplayListBuildState, display_list_section: DisplayListSection, absolute_bounds: &Rect, - clip_bounds: &Rect, - clip: &ClippingRegion, + clip: &LocalClip, gradient: &Gradient, style: &ServoComputedValues); @@ -837,18 +837,11 @@ impl FragmentDisplayListBuilding for Fragment { style: &ServoComputedValues, display_list_section: DisplayListSection, absolute_bounds: &Rect) { - // Adjust the clipping region as necessary to account for `border-radius`. - let border_radii = build_border_radius(absolute_bounds, style.get_border()); - let mut clip = ClippingRegion::max(); - if !border_radii.is_square() { - clip.intersect_with_rounded_rect(absolute_bounds, &border_radii); - }; - let background = style.get_background(); - // FIXME: This causes a lot of background colors to be displayed when they are clearly not // needed. We could use display list optimization to clean this up, but it still seems // inefficient. What we really want is something like "nearest ancestor element that // doesn't have a fragment". + let background = style.get_background(); let background_color = style.resolve_color(background.background_color); // 'background-clip' determines the area within which the background is painted. @@ -877,8 +870,20 @@ impl FragmentDisplayListBuilding for Fragment { } } + // Adjust the clipping region as necessary to account for `border-radius`. + let border_radii = build_border_radius(absolute_bounds, style.get_border()); + let clip = if !border_radii.is_square() { + LocalClip::RoundedRect(bounds.to_rectf(), ComplexClipRegion::new( + bounds.to_rectf(), + border_radii.to_border_radius(), + )) + } else { + LocalClip::Rect(bounds.to_rectf()) + }; + + let base = state.create_base_display_item(&bounds, - &clip, + clip, self.node, style.get_cursor(Cursor::Default), display_list_section); @@ -899,7 +904,6 @@ impl FragmentDisplayListBuilding for Fragment { self.build_display_list_for_background_gradient(state, display_list_section, &absolute_bounds, - &bounds, &clip, gradient, style); @@ -984,7 +988,7 @@ impl FragmentDisplayListBuilding for Fragment { style: &ServoComputedValues, display_list_section: DisplayListSection, absolute_bounds: &Rect, - clip: &ClippingRegion, + clip: &LocalClip, image_url: &ServoUrl, index: usize) { let webrender_image = state.layout_context @@ -1008,7 +1012,7 @@ impl FragmentDisplayListBuilding for Fragment { style: &ServoComputedValues, display_list_section: DisplayListSection, absolute_bounds: &Rect, - clip: &ClippingRegion, + clip: &LocalClip, webrender_image: WebRenderImageInfo, index: usize) { debug!("(building display list) building background image"); @@ -1019,12 +1023,6 @@ impl FragmentDisplayListBuilding for Fragment { let image_size = self.compute_background_image_size(style, &bounds, &webrender_image, index); - // Clip. - // - // TODO: Check the bounds to see if a clip item is actually required. - let mut clip = clip.clone(); - clip.intersect_rect(&bounds); - // Background image should be positioned on the padding box basis. let border = style.logical_border_width().to_physical(style.writing_mode); @@ -1129,7 +1127,7 @@ impl FragmentDisplayListBuilding for Fragment { // Create the image display item. let base = state.create_base_display_item(&bounds, - &clip, + *clip, self.node, style.get_cursor(Cursor::Default), display_list_section); @@ -1151,7 +1149,7 @@ impl FragmentDisplayListBuilding for Fragment { style: &ServoComputedValues, display_list_section: DisplayListSection, absolute_bounds: &Rect, - clip: &ClippingRegion, + clip: &LocalClip, paint_worklet: &PaintWorklet, index: usize) { @@ -1315,13 +1313,9 @@ impl FragmentDisplayListBuilding for Fragment { state: &mut DisplayListBuildState, display_list_section: DisplayListSection, absolute_bounds: &Rect, - clip_bounds: &Rect, - clip: &ClippingRegion, + clip: &LocalClip, gradient: &Gradient, style: &ServoComputedValues) { - let mut clip = clip.clone(); - clip.intersect_rect(clip_bounds); - let border = self.border_width().to_physical(style.writing_mode); let mut bounds = *absolute_bounds; bounds.origin.x = bounds.origin.x + border.left; @@ -1330,7 +1324,7 @@ impl FragmentDisplayListBuilding for Fragment { bounds.size.height = bounds.size.height - border.vertical(); let base = state.create_base_display_item(&bounds, - &clip, + *clip, self.node, style.get_cursor(Cursor::Default), display_list_section); @@ -1380,7 +1374,7 @@ impl FragmentDisplayListBuilding for Fragment { // TODO(pcwalton): Multiple border radii; elliptical border radii. let base = state.create_base_display_item(&bounds, - &ClippingRegion::from_rect(&clip), + LocalClip::from(clip.to_rectf()), self.node, style.get_cursor(Cursor::Default), display_list_section); @@ -1452,7 +1446,7 @@ impl FragmentDisplayListBuilding for Fragment { // Append the border to the display list. let base = state.create_base_display_item(&bounds, - &ClippingRegion::from_rect(&clip), + LocalClip::from(clip.to_rectf()), self.node, style.get_cursor(Cursor::Default), display_list_section); @@ -1581,7 +1575,7 @@ impl FragmentDisplayListBuilding for Fragment { // Append the outline to the display list. let color = style.resolve_color(style.get_outline().outline_color).to_gfx_color(); let base = state.create_base_display_item(&bounds, - &ClippingRegion::from_rect(&clip), + LocalClip::from(clip.to_rectf()), self.node, style.get_cursor(Cursor::Default), DisplayListSection::Outlines); @@ -1608,7 +1602,7 @@ impl FragmentDisplayListBuilding for Fragment { // Compute the text fragment bounds and draw a border surrounding them. let base = state.create_base_display_item(stacking_relative_border_box, - &ClippingRegion::from_rect(&clip), + LocalClip::from(clip.to_rectf()), self.node, style.get_cursor(Cursor::Default), DisplayListSection::Content); @@ -1631,7 +1625,7 @@ impl FragmentDisplayListBuilding for Fragment { let baseline = baseline.to_physical(self.style.writing_mode, container_size); let base = state.create_base_display_item(&baseline, - &ClippingRegion::from_rect(&clip), + LocalClip::from(clip.to_rectf()), self.node, style.get_cursor(Cursor::Default), DisplayListSection::Content); @@ -1648,7 +1642,7 @@ impl FragmentDisplayListBuilding for Fragment { clip: &Rect) { // This prints a debug border around the border of this fragment. let base = state.create_base_display_item(stacking_relative_border_box, - &ClippingRegion::from_rect(&clip), + LocalClip::from(clip.to_rectf()), self.node, self.style.get_cursor(Cursor::Default), DisplayListSection::Content); @@ -1682,7 +1676,7 @@ impl FragmentDisplayListBuilding for Fragment { let style = self.selected_style(); let background_color = style.resolve_color(style.get_background().background_color); let base = state.create_base_display_item(stacking_relative_border_box, - &ClippingRegion::from_rect(&clip), + LocalClip::from(clip.to_rectf()), self.node, self.style.get_cursor(Cursor::Default), display_list_section); @@ -1721,7 +1715,7 @@ impl FragmentDisplayListBuilding for Fragment { }; let base = state.create_base_display_item(&insertion_point_bounds, - &ClippingRegion::from_rect(&clip), + LocalClip::from(clip.to_rectf()), self.node, self.style.get_cursor(cursor), display_list_section); @@ -1913,7 +1907,7 @@ impl FragmentDisplayListBuilding for Fragment { if !stacking_relative_content_box.is_empty() { let base = state.create_base_display_item( &stacking_relative_content_box, - &ClippingRegion::from_rect(clip), + LocalClip::from(clip.to_rectf()), self.node, self.style.get_cursor(Cursor::Default), DisplayListSection::Content); @@ -1934,7 +1928,7 @@ impl FragmentDisplayListBuilding for Fragment { if let Some(ref image) = image_fragment.image { let base = state.create_base_display_item( &stacking_relative_content_box, - &ClippingRegion::from_rect(clip), + LocalClip::from(clip.to_rectf()), self.node, self.style.get_cursor(Cursor::Default), DisplayListSection::Content); @@ -1965,7 +1959,7 @@ impl FragmentDisplayListBuilding for Fragment { let base = state.create_base_display_item( &stacking_relative_content_box, - &ClippingRegion::from_rect(clip), + LocalClip::from(clip.to_rectf()), self.node, self.style.get_cursor(Cursor::Default), DisplayListSection::Content); @@ -2100,7 +2094,7 @@ impl FragmentDisplayListBuilding for Fragment { // Create the text display item. let base = state.create_base_display_item(&stacking_relative_content_box, - &ClippingRegion::from_rect(&clip), + LocalClip::from(clip.to_rectf()), self.node, self.style().get_cursor(cursor), DisplayListSection::Content); @@ -2178,7 +2172,7 @@ impl FragmentDisplayListBuilding for Fragment { container_size); let base = state.create_base_display_item( &shadow_bounds(&stacking_relative_box, blur_radius, Au(0)), - &ClippingRegion::from_rect(&clip), + LocalClip::from(clip.to_rectf()), self.node, self.style.get_cursor(Cursor::Default), DisplayListSection::Content); @@ -2496,35 +2490,32 @@ impl BlockFlowDisplayListBuilding for BlockFlow { return; } - let clip_rect = Rect::new(Point2D::zero(), content_box.size); - let mut clip = ClippingRegion::from_rect(&clip_rect); - - let border_radii = build_border_radius_for_inner_rect(&border_box, - &self.fragment.style); - if !border_radii.is_square() { - clip.intersect_with_rounded_rect(&clip_rect, &border_radii) - } + let overflow_x = self.fragment.style.get_box().overflow_x; + let overflow_y = self.fragment.style.get_box().overflow_y; let content_size = self.base.overflow.scroll.origin + self.base.overflow.scroll.size; let mut content_size = Size2D::new(content_size.x, content_size.y); - if overflow_x::T::hidden == self.fragment.style.get_box().overflow_x { + if overflow_x::T::hidden == overflow_x { content_size.width = content_box.size.width; } - if overflow_x::T::hidden == self.fragment.style.get_box().overflow_y { + if overflow_x::T::hidden == overflow_y { content_size.height = content_box.size.height; } - if overflow_x::T::hidden == self.fragment.style.get_box().overflow_y || - overflow_x::T::hidden == self.fragment.style.get_box().overflow_x { + if overflow_x::T::hidden == overflow_y || overflow_x::T::hidden == overflow_x { preserved_state.push_clip(state, &border_box, self.positioning()); } - let clip_rect = Rect::new(Point2D::zero(), content_box.size); - let mut clip = ClippingRegion::from_rect(&clip_rect); + let mut root_type = ScrollRootType::ScrollFrame; + if overflow_x::T::hidden == overflow_y && overflow_x::T::hidden == overflow_x { + root_type = ScrollRootType::Clip; + } + + let mut clip = ClippingRegion::from_rect(&content_box); let radii = build_border_radius_for_inner_rect(&border_box, &self.fragment.style); if !radii.is_square() { - clip.intersect_with_rounded_rect(&clip_rect, &radii) + clip.intersect_with_rounded_rect(&content_box, &radii) } let parent_id = self.scroll_root_id(state.layout_context.id); @@ -2534,6 +2525,7 @@ impl BlockFlowDisplayListBuilding for BlockFlow { parent_id: parent_id, clip: clip, content_rect: Rect::new(content_box.origin, content_size), + root_type, }, self.base.stacking_context_id ); @@ -2576,16 +2568,17 @@ impl BlockFlowDisplayListBuilding for BlockFlow { return; } - let content_rect = Rect::new(clip_origin, clip_size); - preserved_state.push_clip(state, &content_rect, self.positioning()); + let clip_rect = Rect::new(clip_origin, clip_size); + preserved_state.push_clip(state, &clip_rect, self.positioning()); let parent_id = self.scroll_root_id(state.layout_context.id); state.add_scroll_root( ScrollRoot { id: new_scroll_root_id, parent_id: parent_id, - clip: ClippingRegion::from_rect(&Rect::new(Point2D::zero(), clip_size)), - content_rect: content_rect, + clip: ClippingRegion::from_rect(&clip_rect), + content_rect: Rect::zero(), // content_rect isn't important for clips. + root_type: ScrollRootType::Clip, }, self.base.stacking_context_id ); @@ -2853,7 +2846,7 @@ impl BaseFlowDisplayListBuilding for BaseFlow { color.a = 1.0; let base = state.create_base_display_item( &stacking_context_relative_bounds.inflate(Au::from_px(2), Au::from_px(2)), - &ClippingRegion::from_rect(&self.clip), + LocalClip::from(self.clip.to_rectf()), node, None, DisplayListSection::Content); diff --git a/servo/components/layout/flow.rs b/servo/components/layout/flow.rs index 7d734bd13433..240942ec843b 100644 --- a/servo/components/layout/flow.rs +++ b/servo/components/layout/flow.rs @@ -63,7 +63,7 @@ use table_colgroup::TableColGroupFlow; use table_row::TableRowFlow; use table_rowgroup::TableRowGroupFlow; use table_wrapper::TableWrapperFlow; -use webrender_traits::ClipId; +use webrender_api::ClipId; /// Virtual methods that make up a float context. /// diff --git a/servo/components/layout/lib.rs b/servo/components/layout/lib.rs index f7ed79be750d..868892ea0a59 100644 --- a/servo/components/layout/lib.rs +++ b/servo/components/layout/lib.rs @@ -46,7 +46,7 @@ extern crate style; extern crate style_traits; extern crate unicode_bidi; extern crate unicode_script; -extern crate webrender_traits; +extern crate webrender_api; #[macro_use] pub mod layout_debug; diff --git a/servo/components/layout/query.rs b/servo/components/layout/query.rs index e96d50890be5..252071e9bcd7 100644 --- a/servo/components/layout/query.rs +++ b/servo/components/layout/query.rs @@ -36,7 +36,7 @@ use style::properties::longhands::{display, position}; use style::selector_parser::PseudoElement; use style_traits::ToCss; use style_traits::cursor::Cursor; -use webrender_traits::ClipId; +use webrender_api::ClipId; use wrapper::LayoutNodeLayoutData; /// Mutable data belonging to the LayoutThread. diff --git a/servo/components/layout/webrender_helpers.rs b/servo/components/layout/webrender_helpers.rs index d556bd4c92ef..2c8cfa198069 100644 --- a/servo/components/layout/webrender_helpers.rs +++ b/servo/components/layout/webrender_helpers.rs @@ -10,13 +10,14 @@ use app_units::Au; use euclid::{Point2D, Vector2D, Rect, SideOffsets2D, Size2D}; use gfx::display_list::{BorderDetails, BorderRadii, BoxShadowClipMode, ClippingRegion}; -use gfx::display_list::{DisplayItem, DisplayList, DisplayListTraversal, StackingContextType}; +use gfx::display_list::{DisplayItem, DisplayList, DisplayListTraversal, ScrollRootType}; +use gfx::display_list::StackingContextType; use msg::constellation_msg::PipelineId; use style::computed_values::{image_rendering, mix_blend_mode, transform_style}; use style::values::computed::{BorderStyle, Filter}; use style::values::generics::effects::Filter as GenericFilter; -use webrender_traits::{self, DisplayListBuilder, ExtendMode}; -use webrender_traits::{LayoutTransform, ClipId, ClipRegionToken}; +use webrender_api::{self, ComplexClipRegion, DisplayListBuilder, ExtendMode}; +use webrender_api::{LayoutTransform, ClipId}; pub trait WebRenderDisplayListConverter { fn convert_to_webrender(&self, pipeline_id: PipelineId) -> DisplayListBuilder; @@ -29,33 +30,33 @@ trait WebRenderDisplayItemConverter { } trait ToBorderStyle { - fn to_border_style(&self) -> webrender_traits::BorderStyle; + fn to_border_style(&self) -> webrender_api::BorderStyle; } impl ToBorderStyle for BorderStyle { - fn to_border_style(&self) -> webrender_traits::BorderStyle { + fn to_border_style(&self) -> webrender_api::BorderStyle { match *self { - BorderStyle::none => webrender_traits::BorderStyle::None, - BorderStyle::solid => webrender_traits::BorderStyle::Solid, - BorderStyle::double => webrender_traits::BorderStyle::Double, - BorderStyle::dotted => webrender_traits::BorderStyle::Dotted, - BorderStyle::dashed => webrender_traits::BorderStyle::Dashed, - BorderStyle::hidden => webrender_traits::BorderStyle::Hidden, - BorderStyle::groove => webrender_traits::BorderStyle::Groove, - BorderStyle::ridge => webrender_traits::BorderStyle::Ridge, - BorderStyle::inset => webrender_traits::BorderStyle::Inset, - BorderStyle::outset => webrender_traits::BorderStyle::Outset, + BorderStyle::none => webrender_api::BorderStyle::None, + BorderStyle::solid => webrender_api::BorderStyle::Solid, + BorderStyle::double => webrender_api::BorderStyle::Double, + BorderStyle::dotted => webrender_api::BorderStyle::Dotted, + BorderStyle::dashed => webrender_api::BorderStyle::Dashed, + BorderStyle::hidden => webrender_api::BorderStyle::Hidden, + BorderStyle::groove => webrender_api::BorderStyle::Groove, + BorderStyle::ridge => webrender_api::BorderStyle::Ridge, + BorderStyle::inset => webrender_api::BorderStyle::Inset, + BorderStyle::outset => webrender_api::BorderStyle::Outset, } } } trait ToBorderWidths { - fn to_border_widths(&self) -> webrender_traits::BorderWidths; + fn to_border_widths(&self) -> webrender_api::BorderWidths; } impl ToBorderWidths for SideOffsets2D { - fn to_border_widths(&self) -> webrender_traits::BorderWidths { - webrender_traits::BorderWidths { + fn to_border_widths(&self) -> webrender_api::BorderWidths { + webrender_api::BorderWidths { left: self.left.to_f32_px(), top: self.top.to_f32_px(), right: self.right.to_f32_px(), @@ -65,89 +66,72 @@ impl ToBorderWidths for SideOffsets2D { } trait ToBoxShadowClipMode { - fn to_clip_mode(&self) -> webrender_traits::BoxShadowClipMode; + fn to_clip_mode(&self) -> webrender_api::BoxShadowClipMode; } impl ToBoxShadowClipMode for BoxShadowClipMode { - fn to_clip_mode(&self) -> webrender_traits::BoxShadowClipMode { + fn to_clip_mode(&self) -> webrender_api::BoxShadowClipMode { match *self { - BoxShadowClipMode::None => webrender_traits::BoxShadowClipMode::None, - BoxShadowClipMode::Inset => webrender_traits::BoxShadowClipMode::Inset, - BoxShadowClipMode::Outset => webrender_traits::BoxShadowClipMode::Outset, + BoxShadowClipMode::None => webrender_api::BoxShadowClipMode::None, + BoxShadowClipMode::Inset => webrender_api::BoxShadowClipMode::Inset, + BoxShadowClipMode::Outset => webrender_api::BoxShadowClipMode::Outset, } } } trait ToSizeF { - fn to_sizef(&self) -> webrender_traits::LayoutSize; + fn to_sizef(&self) -> webrender_api::LayoutSize; } trait ToPointF { - fn to_pointf(&self) -> webrender_traits::LayoutPoint; + fn to_pointf(&self) -> webrender_api::LayoutPoint; } trait ToVectorF { - fn to_vectorf(&self) -> webrender_traits::LayoutVector2D; + fn to_vectorf(&self) -> webrender_api::LayoutVector2D; } impl ToPointF for Point2D { - fn to_pointf(&self) -> webrender_traits::LayoutPoint { - webrender_traits::LayoutPoint::new(self.x.to_f32_px(), self.y.to_f32_px()) + fn to_pointf(&self) -> webrender_api::LayoutPoint { + webrender_api::LayoutPoint::new(self.x.to_f32_px(), self.y.to_f32_px()) } } impl ToVectorF for Vector2D { - fn to_vectorf(&self) -> webrender_traits::LayoutVector2D { - webrender_traits::LayoutVector2D::new(self.x.to_f32_px(), self.y.to_f32_px()) + fn to_vectorf(&self) -> webrender_api::LayoutVector2D { + webrender_api::LayoutVector2D::new(self.x.to_f32_px(), self.y.to_f32_px()) } } impl ToSizeF for Size2D { - fn to_sizef(&self) -> webrender_traits::LayoutSize { - webrender_traits::LayoutSize::new(self.width.to_f32_px(), self.height.to_f32_px()) + fn to_sizef(&self) -> webrender_api::LayoutSize { + webrender_api::LayoutSize::new(self.width.to_f32_px(), self.height.to_f32_px()) } } -trait ToRectF { - fn to_rectf(&self) -> webrender_traits::LayoutRect; +pub trait ToRectF { + fn to_rectf(&self) -> webrender_api::LayoutRect; } impl ToRectF for Rect { - fn to_rectf(&self) -> webrender_traits::LayoutRect { + fn to_rectf(&self) -> webrender_api::LayoutRect { let x = self.origin.x.to_f32_px(); let y = self.origin.y.to_f32_px(); let w = self.size.width.to_f32_px(); let h = self.size.height.to_f32_px(); - let point = webrender_traits::LayoutPoint::new(x, y); - let size = webrender_traits::LayoutSize::new(w, h); - webrender_traits::LayoutRect::new(point, size) + let point = webrender_api::LayoutPoint::new(x, y); + let size = webrender_api::LayoutSize::new(w, h); + webrender_api::LayoutRect::new(point, size) } } -trait ToClipRegion { - fn push_clip_region(&self, builder: &mut DisplayListBuilder) -> ClipRegionToken; -} - -impl ToClipRegion for ClippingRegion { - fn push_clip_region(&self, builder: &mut DisplayListBuilder) -> ClipRegionToken { - builder.push_clip_region(&self.main.to_rectf(), - self.complex.iter().map(|complex_clipping_region| { - webrender_traits::ComplexClipRegion::new( - complex_clipping_region.rect.to_rectf(), - complex_clipping_region.radii.to_border_radius(), - ) - }), - None) - } -} - -trait ToBorderRadius { - fn to_border_radius(&self) -> webrender_traits::BorderRadius; +pub trait ToBorderRadius { + fn to_border_radius(&self) -> webrender_api::BorderRadius; } impl ToBorderRadius for BorderRadii { - fn to_border_radius(&self) -> webrender_traits::BorderRadius { - webrender_traits::BorderRadius { + fn to_border_radius(&self) -> webrender_api::BorderRadius { + webrender_api::BorderRadius { top_left: self.top_left.to_sizef(), top_right: self.top_right.to_sizef(), bottom_left: self.bottom_left.to_sizef(), @@ -157,64 +141,64 @@ impl ToBorderRadius for BorderRadii { } pub trait ToMixBlendMode { - fn to_mix_blend_mode(&self) -> webrender_traits::MixBlendMode; + fn to_mix_blend_mode(&self) -> webrender_api::MixBlendMode; } impl ToMixBlendMode for mix_blend_mode::T { - fn to_mix_blend_mode(&self) -> webrender_traits::MixBlendMode { + fn to_mix_blend_mode(&self) -> webrender_api::MixBlendMode { match *self { - mix_blend_mode::T::normal => webrender_traits::MixBlendMode::Normal, - mix_blend_mode::T::multiply => webrender_traits::MixBlendMode::Multiply, - mix_blend_mode::T::screen => webrender_traits::MixBlendMode::Screen, - mix_blend_mode::T::overlay => webrender_traits::MixBlendMode::Overlay, - mix_blend_mode::T::darken => webrender_traits::MixBlendMode::Darken, - mix_blend_mode::T::lighten => webrender_traits::MixBlendMode::Lighten, - mix_blend_mode::T::color_dodge => webrender_traits::MixBlendMode::ColorDodge, - mix_blend_mode::T::color_burn => webrender_traits::MixBlendMode::ColorBurn, - mix_blend_mode::T::hard_light => webrender_traits::MixBlendMode::HardLight, - mix_blend_mode::T::soft_light => webrender_traits::MixBlendMode::SoftLight, - mix_blend_mode::T::difference => webrender_traits::MixBlendMode::Difference, - mix_blend_mode::T::exclusion => webrender_traits::MixBlendMode::Exclusion, - mix_blend_mode::T::hue => webrender_traits::MixBlendMode::Hue, - mix_blend_mode::T::saturation => webrender_traits::MixBlendMode::Saturation, - mix_blend_mode::T::color => webrender_traits::MixBlendMode::Color, - mix_blend_mode::T::luminosity => webrender_traits::MixBlendMode::Luminosity, + mix_blend_mode::T::normal => webrender_api::MixBlendMode::Normal, + mix_blend_mode::T::multiply => webrender_api::MixBlendMode::Multiply, + mix_blend_mode::T::screen => webrender_api::MixBlendMode::Screen, + mix_blend_mode::T::overlay => webrender_api::MixBlendMode::Overlay, + mix_blend_mode::T::darken => webrender_api::MixBlendMode::Darken, + mix_blend_mode::T::lighten => webrender_api::MixBlendMode::Lighten, + mix_blend_mode::T::color_dodge => webrender_api::MixBlendMode::ColorDodge, + mix_blend_mode::T::color_burn => webrender_api::MixBlendMode::ColorBurn, + mix_blend_mode::T::hard_light => webrender_api::MixBlendMode::HardLight, + mix_blend_mode::T::soft_light => webrender_api::MixBlendMode::SoftLight, + mix_blend_mode::T::difference => webrender_api::MixBlendMode::Difference, + mix_blend_mode::T::exclusion => webrender_api::MixBlendMode::Exclusion, + mix_blend_mode::T::hue => webrender_api::MixBlendMode::Hue, + mix_blend_mode::T::saturation => webrender_api::MixBlendMode::Saturation, + mix_blend_mode::T::color => webrender_api::MixBlendMode::Color, + mix_blend_mode::T::luminosity => webrender_api::MixBlendMode::Luminosity, } } } trait ToImageRendering { - fn to_image_rendering(&self) -> webrender_traits::ImageRendering; + fn to_image_rendering(&self) -> webrender_api::ImageRendering; } impl ToImageRendering for image_rendering::T { - fn to_image_rendering(&self) -> webrender_traits::ImageRendering { + fn to_image_rendering(&self) -> webrender_api::ImageRendering { match *self { - image_rendering::T::crisp_edges => webrender_traits::ImageRendering::CrispEdges, - image_rendering::T::auto => webrender_traits::ImageRendering::Auto, - image_rendering::T::pixelated => webrender_traits::ImageRendering::Pixelated, + image_rendering::T::crisp_edges => webrender_api::ImageRendering::CrispEdges, + image_rendering::T::auto => webrender_api::ImageRendering::Auto, + image_rendering::T::pixelated => webrender_api::ImageRendering::Pixelated, } } } trait ToFilterOps { - fn to_filter_ops(&self) -> Vec; + fn to_filter_ops(&self) -> Vec; } impl ToFilterOps for Vec { - fn to_filter_ops(&self) -> Vec { + fn to_filter_ops(&self) -> Vec { let mut result = Vec::with_capacity(self.len()); for filter in self.iter() { match *filter { - GenericFilter::Blur(radius) => result.push(webrender_traits::FilterOp::Blur(radius)), - GenericFilter::Brightness(amount) => result.push(webrender_traits::FilterOp::Brightness(amount)), - GenericFilter::Contrast(amount) => result.push(webrender_traits::FilterOp::Contrast(amount)), - GenericFilter::Grayscale(amount) => result.push(webrender_traits::FilterOp::Grayscale(amount)), - GenericFilter::HueRotate(angle) => result.push(webrender_traits::FilterOp::HueRotate(angle.radians())), - GenericFilter::Invert(amount) => result.push(webrender_traits::FilterOp::Invert(amount)), - GenericFilter::Opacity(amount) => result.push(webrender_traits::FilterOp::Opacity(amount.into())), - GenericFilter::Saturate(amount) => result.push(webrender_traits::FilterOp::Saturate(amount)), - GenericFilter::Sepia(amount) => result.push(webrender_traits::FilterOp::Sepia(amount)), + GenericFilter::Blur(radius) => result.push(webrender_api::FilterOp::Blur(radius)), + GenericFilter::Brightness(amount) => result.push(webrender_api::FilterOp::Brightness(amount)), + GenericFilter::Contrast(amount) => result.push(webrender_api::FilterOp::Contrast(amount)), + GenericFilter::Grayscale(amount) => result.push(webrender_api::FilterOp::Grayscale(amount)), + GenericFilter::HueRotate(angle) => result.push(webrender_api::FilterOp::HueRotate(angle.radians())), + GenericFilter::Invert(amount) => result.push(webrender_api::FilterOp::Invert(amount)), + GenericFilter::Opacity(amount) => result.push(webrender_api::FilterOp::Opacity(amount.into())), + GenericFilter::Saturate(amount) => result.push(webrender_api::FilterOp::Saturate(amount)), + GenericFilter::Sepia(amount) => result.push(webrender_api::FilterOp::Sepia(amount)), GenericFilter::DropShadow(ref shadow) => match *shadow {}, } } @@ -223,14 +207,14 @@ impl ToFilterOps for Vec { } pub trait ToTransformStyle { - fn to_transform_style(&self) -> webrender_traits::TransformStyle; + fn to_transform_style(&self) -> webrender_api::TransformStyle; } impl ToTransformStyle for transform_style::T { - fn to_transform_style(&self) -> webrender_traits::TransformStyle { + fn to_transform_style(&self) -> webrender_api::TransformStyle { match *self { - transform_style::T::auto | transform_style::T::flat => webrender_traits::TransformStyle::Flat, - transform_style::T::preserve_3d => webrender_traits::TransformStyle::Preserve3D, + transform_style::T::auto | transform_style::T::flat => webrender_api::TransformStyle::Flat, + transform_style::T::preserve_3d => webrender_api::TransformStyle::Preserve3D, } } } @@ -267,8 +251,9 @@ impl WebRenderDisplayItemConverter for DisplayItem { DisplayItem::SolidColor(ref item) => { let color = item.color; if color.a > 0.0 { - let clip = item.base.clip.push_clip_region(builder); - builder.push_rect(item.base.bounds.to_rectf(), clip, color); + builder.push_rect(item.base.bounds.to_rectf(), + Some(item.base.local_clip), + color); } } DisplayItem::Text(ref item) => { @@ -286,8 +271,8 @@ impl WebRenderDisplayItemConverter for DisplayItem { let glyph_offset = glyph.offset().unwrap_or(Point2D::zero()); let x = (origin.x + glyph_offset.x).to_f32_px(); let y = (origin.y + glyph_offset.y).to_f32_px(); - let point = webrender_traits::LayoutPoint::new(x, y); - let glyph = webrender_traits::GlyphInstance { + let point = webrender_api::LayoutPoint::new(x, y); + let glyph = webrender_api::GlyphInstance { index: glyph.id(), point: point, }; @@ -298,9 +283,8 @@ impl WebRenderDisplayItemConverter for DisplayItem { } if glyphs.len() > 0 { - let clip = item.base.clip.push_clip_region(builder); builder.push_text(item.base.bounds.to_rectf(), - clip, + Some(item.base.local_clip), &glyphs, item.text_run.font_key, item.text_color, @@ -313,9 +297,8 @@ impl WebRenderDisplayItemConverter for DisplayItem { if let Some(id) = item.webrender_image.key { if item.stretch_size.width > Au(0) && item.stretch_size.height > Au(0) { - let clip = item.base.clip.push_clip_region(builder); builder.push_image(item.base.bounds.to_rectf(), - clip, + Some(item.base.local_clip), item.stretch_size.to_sizef(), item.tile_spacing.to_sizef(), item.image_rendering.to_image_rendering(), @@ -324,34 +307,34 @@ impl WebRenderDisplayItemConverter for DisplayItem { } } DisplayItem::WebGL(ref item) => { - let clip = item.base.clip.push_clip_region(builder); - builder.push_webgl_canvas(item.base.bounds.to_rectf(), clip, item.context_id); + builder.push_webgl_canvas(item.base.bounds.to_rectf(), + Some(item.base.local_clip), + item.context_id); } DisplayItem::Border(ref item) => { let rect = item.base.bounds.to_rectf(); let widths = item.border_widths.to_border_widths(); - let clip = item.base.clip.push_clip_region(builder); let details = match item.details { BorderDetails::Normal(ref border) => { - let left = webrender_traits::BorderSide { + let left = webrender_api::BorderSide { color: border.color.left, style: border.style.left.to_border_style(), }; - let top = webrender_traits::BorderSide { + let top = webrender_api::BorderSide { color: border.color.top, style: border.style.top.to_border_style(), }; - let right = webrender_traits::BorderSide { + let right = webrender_api::BorderSide { color: border.color.right, style: border.style.right.to_border_style(), }; - let bottom = webrender_traits::BorderSide { + let bottom = webrender_api::BorderSide { color: border.color.bottom, style: border.style.bottom.to_border_style(), }; let radius = border.radius.to_border_radius(); - webrender_traits::BorderDetails::Normal(webrender_traits::NormalBorder { + webrender_api::BorderDetails::Normal(webrender_api::NormalBorder { left: left, top: top, right: right, @@ -363,9 +346,9 @@ impl WebRenderDisplayItemConverter for DisplayItem { match image.image.key { None => return, Some(key) => { - webrender_traits::BorderDetails::Image(webrender_traits::ImageBorder { + webrender_api::BorderDetails::Image(webrender_api::ImageBorder { image_key: key, - patch: webrender_traits::NinePatchDescriptor { + patch: webrender_api::NinePatchDescriptor { width: image.image.width, height: image.image.height, slice: image.slice, @@ -384,7 +367,7 @@ impl WebRenderDisplayItemConverter for DisplayItem { } else { ExtendMode::Clamp }; - webrender_traits::BorderDetails::Gradient(webrender_traits::GradientBorder { + webrender_api::BorderDetails::Gradient(webrender_api::GradientBorder { gradient: builder.create_gradient( gradient.gradient.start_point.to_pointf(), gradient.gradient.end_point.to_pointf(), @@ -399,7 +382,7 @@ impl WebRenderDisplayItemConverter for DisplayItem { } else { ExtendMode::Clamp }; - webrender_traits::BorderDetails::RadialGradient(webrender_traits::RadialGradientBorder { + webrender_api::BorderDetails::RadialGradient(webrender_api::RadialGradientBorder { gradient: builder.create_radial_gradient( gradient.gradient.center.to_pointf(), gradient.gradient.radius.to_sizef(), @@ -410,13 +393,12 @@ impl WebRenderDisplayItemConverter for DisplayItem { } }; - builder.push_border(rect, clip, widths, details); + builder.push_border(rect, Some(item.base.local_clip), widths, details); } DisplayItem::Gradient(ref item) => { let rect = item.base.bounds.to_rectf(); let start_point = item.gradient.start_point.to_pointf(); let end_point = item.gradient.end_point.to_pointf(); - let clip = item.base.clip.push_clip_region(builder); let extend_mode = if item.gradient.repeating { ExtendMode::Repeat } else { @@ -427,16 +409,15 @@ impl WebRenderDisplayItemConverter for DisplayItem { item.gradient.stops.clone(), extend_mode); builder.push_gradient(rect, - clip, + Some(item.base.local_clip), gradient, rect.size, - webrender_traits::LayoutSize::zero()); + webrender_api::LayoutSize::zero()); } DisplayItem::RadialGradient(ref item) => { let rect = item.base.bounds.to_rectf(); let center = item.gradient.center.to_pointf(); let radius = item.gradient.radius.to_sizef(); - let clip = item.base.clip.push_clip_region(builder); let extend_mode = if item.gradient.repeating { ExtendMode::Repeat } else { @@ -447,10 +428,10 @@ impl WebRenderDisplayItemConverter for DisplayItem { item.gradient.stops.clone(), extend_mode); builder.push_radial_gradient(rect, - clip, + Some(item.base.local_clip), gradient, rect.size, - webrender_traits::LayoutSize::zero()); + webrender_api::LayoutSize::zero()); } DisplayItem::Line(..) => { println!("TODO DisplayItem::Line"); @@ -458,9 +439,8 @@ impl WebRenderDisplayItemConverter for DisplayItem { DisplayItem::BoxShadow(ref item) => { let rect = item.base.bounds.to_rectf(); let box_bounds = item.box_bounds.to_rectf(); - let clip = item.base.clip.push_clip_region(builder); builder.push_box_shadow(rect, - clip, + Some(item.base.local_clip), box_bounds, item.offset.to_vectorf(), item.color, @@ -472,8 +452,7 @@ impl WebRenderDisplayItemConverter for DisplayItem { DisplayItem::Iframe(ref item) => { let rect = item.base.bounds.to_rectf(); let pipeline_id = item.iframe.to_webrender(); - let clip = item.base.clip.push_clip_region(builder); - builder.push_iframe(rect, clip, pipeline_id); + builder.push_iframe(rect, pipeline_id); } DisplayItem::PushStackingContext(ref item) => { let stacking_context = &item.stacking_context; @@ -499,9 +478,21 @@ impl WebRenderDisplayItemConverter for DisplayItem { builder.push_clip_id(item.scroll_root.parent_id); let our_id = item.scroll_root.id; - let clip = item.scroll_root.clip.push_clip_region(builder); - let content_rect = item.scroll_root.content_rect.to_rectf(); - let webrender_id = builder.define_clip(content_rect, clip, Some(our_id)); + let webrender_id = match item.scroll_root.root_type { + ScrollRootType::Clip => { + builder.define_clip(Some(our_id), + item.scroll_root.clip.main.to_rectf(), + item.scroll_root.clip.get_complex_clips(), + None) + } + ScrollRootType::ScrollFrame => { + builder.define_scroll_frame(Some(our_id), + item.scroll_root.content_rect.to_rectf(), + item.scroll_root.clip.main.to_rectf(), + item.scroll_root.clip.get_complex_clips(), + None) + } + }; debug_assert!(our_id == webrender_id); builder.pop_clip_id(); @@ -509,3 +500,18 @@ impl WebRenderDisplayItemConverter for DisplayItem { } } } + +trait ToWebRenderClip { + fn get_complex_clips(&self) -> Vec; +} + +impl ToWebRenderClip for ClippingRegion { + fn get_complex_clips(&self) -> Vec { + self.complex.iter().map(|complex_clipping_region| { + ComplexClipRegion::new( + complex_clipping_region.rect.to_rectf(), + complex_clipping_region.radii.to_border_radius(), + ) + }).collect() + } +} diff --git a/servo/components/layout_thread/Cargo.toml b/servo/components/layout_thread/Cargo.toml index ebc9b33dfefc..9ad239eb0071 100644 --- a/servo/components/layout_thread/Cargo.toml +++ b/servo/components/layout_thread/Cargo.toml @@ -36,4 +36,4 @@ servo_config = {path = "../config"} servo_geometry = {path = "../geometry"} servo_url = {path = "../url"} style = {path = "../style"} -webrender_traits = {git = "https://github.com/servo/webrender", features = ["ipc"]} +webrender_api = {git = "https://github.com/servo/webrender", features = ["ipc"]} diff --git a/servo/components/layout_thread/lib.rs b/servo/components/layout_thread/lib.rs index f7a306ce0893..b6f520ff2ee3 100644 --- a/servo/components/layout_thread/lib.rs +++ b/servo/components/layout_thread/lib.rs @@ -38,7 +38,7 @@ extern crate servo_config; extern crate servo_geometry; extern crate servo_url; extern crate style; -extern crate webrender_traits; +extern crate webrender_api; use app_units::Au; use euclid::{Point2D, Rect, Size2D, ScaleFactor}; @@ -229,7 +229,7 @@ pub struct LayoutThread { registered_painters: Arc>>, /// Webrender interface. - webrender_api: webrender_traits::RenderApi, + webrender_api: webrender_api::RenderApi, /// The timer object to control the timing of the animations. This should /// only be a test-mode timer during testing for animations. @@ -260,7 +260,7 @@ impl LayoutThreadFactory for LayoutThread { time_profiler_chan: time::ProfilerChan, mem_profiler_chan: mem::ProfilerChan, content_process_shutdown_chan: Option>, - webrender_api_sender: webrender_traits::RenderApiSender, + webrender_api_sender: webrender_api::RenderApiSender, layout_threads: usize) { thread::Builder::new().name(format!("LayoutThread {:?}", id)).spawn(move || { thread_state::initialize(thread_state::LAYOUT); @@ -443,7 +443,7 @@ impl LayoutThread { font_cache_thread: FontCacheThread, time_profiler_chan: time::ProfilerChan, mem_profiler_chan: mem::ProfilerChan, - webrender_api_sender: webrender_traits::RenderApiSender, + webrender_api_sender: webrender_api::RenderApiSender, layout_threads: usize) -> LayoutThread { let device = Device::new( @@ -1011,10 +1011,10 @@ impl LayoutThread { epoch.next(); self.epoch.set(epoch); - let viewport_size = webrender_traits::LayoutSize::from_untyped(&viewport_size); + let viewport_size = webrender_api::LayoutSize::from_untyped(&viewport_size); self.webrender_api.set_display_list( Some(get_root_flow_background_color(layout_root)), - webrender_traits::Epoch(epoch.0), + webrender_api::Epoch(epoch.0), viewport_size, builder.finalize(), true); @@ -1657,8 +1657,8 @@ impl LayoutThread { // clearing the frame buffer to white. This ensures that setting a background // color on an iframe element, while the iframe content itself has a default // transparent background color is handled correctly. -fn get_root_flow_background_color(flow: &mut Flow) -> webrender_traits::ColorF { - let transparent = webrender_traits::ColorF { r: 0.0, g: 0.0, b: 0.0, a: 0.0 }; +fn get_root_flow_background_color(flow: &mut Flow) -> webrender_api::ColorF { + let transparent = webrender_api::ColorF { r: 0.0, g: 0.0, b: 0.0, a: 0.0 }; if !flow.is_block_like() { return transparent; } diff --git a/servo/components/layout_traits/Cargo.toml b/servo/components/layout_traits/Cargo.toml index 0a6d38dc3165..0368f1058bda 100644 --- a/servo/components/layout_traits/Cargo.toml +++ b/servo/components/layout_traits/Cargo.toml @@ -17,4 +17,4 @@ net_traits = {path = "../net_traits"} profile_traits = {path = "../profile_traits"} script_traits = {path = "../script_traits"} servo_url = {path = "../url"} -webrender_traits = {git = "https://github.com/servo/webrender", features = ["ipc"]} +webrender_api = {git = "https://github.com/servo/webrender", features = ["ipc"]} diff --git a/servo/components/layout_traits/lib.rs b/servo/components/layout_traits/lib.rs index 61fa3ad24496..eced3137e109 100644 --- a/servo/components/layout_traits/lib.rs +++ b/servo/components/layout_traits/lib.rs @@ -11,7 +11,7 @@ extern crate net_traits; extern crate profile_traits; extern crate script_traits; extern crate servo_url; -extern crate webrender_traits; +extern crate webrender_api; // This module contains traits in layout used generically // in the rest of Servo. @@ -47,6 +47,6 @@ pub trait LayoutThreadFactory { time_profiler_chan: time::ProfilerChan, mem_profiler_chan: mem::ProfilerChan, content_process_shutdown_chan: Option>, - webrender_api_sender: webrender_traits::RenderApiSender, + webrender_api_sender: webrender_api::RenderApiSender, layout_threads: usize); } diff --git a/servo/components/msg/Cargo.toml b/servo/components/msg/Cargo.toml index c09d9b40bcbe..2cebc58c228f 100644 --- a/servo/components/msg/Cargo.toml +++ b/servo/components/msg/Cargo.toml @@ -14,4 +14,4 @@ bitflags = "0.7" heapsize = "0.4" heapsize_derive = "0.1" serde = "1.0" -webrender_traits = {git = "https://github.com/servo/webrender", features = ["ipc"]} +webrender_api = {git = "https://github.com/servo/webrender", features = ["ipc"]} diff --git a/servo/components/msg/constellation_msg.rs b/servo/components/msg/constellation_msg.rs index f27c6772b1f6..5522a324b089 100644 --- a/servo/components/msg/constellation_msg.rs +++ b/servo/components/msg/constellation_msg.rs @@ -7,7 +7,7 @@ use std::cell::Cell; use std::fmt; -use webrender_traits; +use webrender_api; #[derive(PartialEq, Eq, Copy, Clone, Debug, Deserialize, Serialize)] pub enum KeyState { @@ -239,14 +239,14 @@ impl PipelineId { }) } - pub fn to_webrender(&self) -> webrender_traits::PipelineId { + pub fn to_webrender(&self) -> webrender_api::PipelineId { let PipelineNamespaceId(namespace_id) = self.namespace_id; let PipelineIndex(index) = self.index; - webrender_traits::PipelineId(namespace_id, index) + webrender_api::PipelineId(namespace_id, index) } - pub fn root_scroll_node(&self) -> webrender_traits::ClipId { - webrender_traits::ClipId::root_scroll_node(self.to_webrender()) + pub fn root_scroll_node(&self) -> webrender_api::ClipId { + webrender_api::ClipId::root_scroll_node(self.to_webrender()) } } diff --git a/servo/components/msg/lib.rs b/servo/components/msg/lib.rs index 074b62a96760..03fd010d4611 100644 --- a/servo/components/msg/lib.rs +++ b/servo/components/msg/lib.rs @@ -9,6 +9,6 @@ extern crate bitflags; extern crate heapsize; #[macro_use] extern crate heapsize_derive; #[macro_use] extern crate serde; -extern crate webrender_traits; +extern crate webrender_api; pub mod constellation_msg; diff --git a/servo/components/net/Cargo.toml b/servo/components/net/Cargo.toml index eac810a498d4..d86b6ac0ba16 100644 --- a/servo/components/net/Cargo.toml +++ b/servo/components/net/Cargo.toml @@ -40,7 +40,7 @@ time = "0.1.17" unicase = "1.4.0" url = {version = "1.2", features = ["heap_size"]} uuid = {version = "0.5", features = ["v4"]} -webrender_traits = {git = "https://github.com/servo/webrender", features = ["ipc"]} +webrender_api = {git = "https://github.com/servo/webrender", features = ["ipc"]} [target.'cfg(any(target_os = "macos", target_os = "linux", target_os = "windows"))'.dependencies] tinyfiledialogs = "2.5.9" diff --git a/servo/components/net/image_cache.rs b/servo/components/net/image_cache.rs index 516101f7b34d..4cb5e09e2f35 100644 --- a/servo/components/net/image_cache.rs +++ b/servo/components/net/image_cache.rs @@ -18,7 +18,7 @@ use std::mem; use std::path::PathBuf; use std::sync::{Arc, Mutex}; use std::thread; -use webrender_traits; +use webrender_api; /// /// TODO(gw): Remaining work on image cache: @@ -34,13 +34,13 @@ use webrender_traits; // Helper functions. // ====================================================================== -fn convert_format(format: PixelFormat) -> webrender_traits::ImageFormat { +fn convert_format(format: PixelFormat) -> webrender_api::ImageFormat { match format { PixelFormat::K8 | PixelFormat::KA8 => { panic!("Not support by webrender yet"); } - PixelFormat::RGB8 => webrender_traits::ImageFormat::RGB8, - PixelFormat::BGRA8 => webrender_traits::ImageFormat::BGRA8, + PixelFormat::RGB8 => webrender_api::ImageFormat::RGB8, + PixelFormat::BGRA8 => webrender_api::ImageFormat::BGRA8, } } @@ -52,7 +52,7 @@ fn decode_bytes_sync(key: LoadKey, bytes: &[u8]) -> DecoderMsg { } } -fn get_placeholder_image(webrender_api: &webrender_traits::RenderApi, path: &PathBuf) -> io::Result> { +fn get_placeholder_image(webrender_api: &webrender_api::RenderApi, path: &PathBuf) -> io::Result> { let mut file = File::open(path)?; let mut image_data = vec![]; file.read_to_end(&mut image_data)?; @@ -61,15 +61,15 @@ fn get_placeholder_image(webrender_api: &webrender_traits::RenderApi, path: &Pat Ok(Arc::new(image)) } -fn set_webrender_image_key(webrender_api: &webrender_traits::RenderApi, image: &mut Image) { +fn set_webrender_image_key(webrender_api: &webrender_api::RenderApi, image: &mut Image) { if image.id.is_some() { return; } let format = convert_format(image.format); let mut bytes = Vec::new(); bytes.extend_from_slice(&*image.bytes); - if format == webrender_traits::ImageFormat::BGRA8 { + if format == webrender_api::ImageFormat::BGRA8 { premultiply(bytes.as_mut_slice()); } - let descriptor = webrender_traits::ImageDescriptor { + let descriptor = webrender_api::ImageDescriptor { width: image.width, height: image.height, stride: None, @@ -77,7 +77,7 @@ fn set_webrender_image_key(webrender_api: &webrender_traits::RenderApi, image: & offset: 0, is_opaque: is_image_opaque(format, &bytes), }; - let data = webrender_traits::ImageData::new(bytes); + let data = webrender_api::ImageData::new(bytes); let image_key = webrender_api.generate_image_key(); webrender_api.add_image(image_key, descriptor, data, None); image.id = Some(image_key); @@ -85,9 +85,9 @@ fn set_webrender_image_key(webrender_api: &webrender_traits::RenderApi, image: & // TODO(gw): This is a port of the old is_image_opaque code from WR. // Consider using SIMD to speed this up if it shows in profiles. -fn is_image_opaque(format: webrender_traits::ImageFormat, bytes: &[u8]) -> bool { +fn is_image_opaque(format: webrender_api::ImageFormat, bytes: &[u8]) -> bool { match format { - webrender_traits::ImageFormat::BGRA8 => { + webrender_api::ImageFormat::BGRA8 => { let mut is_opaque = true; for i in 0..(bytes.len() / 4) { if bytes[i * 4 + 3] != 255 { @@ -97,10 +97,10 @@ fn is_image_opaque(format: webrender_traits::ImageFormat, bytes: &[u8]) -> bool } is_opaque } - webrender_traits::ImageFormat::RGB8 => true, - webrender_traits::ImageFormat::RG8 => true, - webrender_traits::ImageFormat::A8 => false, - webrender_traits::ImageFormat::Invalid | webrender_traits::ImageFormat::RGBAF32 => unreachable!(), + webrender_api::ImageFormat::RGB8 => true, + webrender_api::ImageFormat::RG8 => true, + webrender_api::ImageFormat::A8 => false, + webrender_api::ImageFormat::Invalid | webrender_api::ImageFormat::RGBAF32 => unreachable!(), } } @@ -334,7 +334,7 @@ struct ImageCacheStore { placeholder_url: ServoUrl, // Webrender API instance. - webrender_api: webrender_traits::RenderApi, + webrender_api: webrender_api::RenderApi, } impl ImageCacheStore { @@ -403,7 +403,7 @@ pub struct ImageCacheImpl { } impl ImageCache for ImageCacheImpl { - fn new(webrender_api: webrender_traits::RenderApi) -> ImageCacheImpl { + fn new(webrender_api: webrender_api::RenderApi) -> ImageCacheImpl { debug!("New image cache"); let mut placeholder_path = resources_dir_path().expect("Can't figure out resources path."); diff --git a/servo/components/net/lib.rs b/servo/components/net/lib.rs index 14df9dcc684a..c22825ad0663 100644 --- a/servo/components/net/lib.rs +++ b/servo/components/net/lib.rs @@ -38,7 +38,7 @@ extern crate tinyfiledialogs; extern crate unicase; extern crate url; extern crate uuid; -extern crate webrender_traits; +extern crate webrender_api; extern crate websocket; mod blob_loader; diff --git a/servo/components/net_traits/Cargo.toml b/servo/components/net_traits/Cargo.toml index 91c00ed33dc0..b88bcca19c20 100644 --- a/servo/components/net_traits/Cargo.toml +++ b/servo/components/net_traits/Cargo.toml @@ -27,4 +27,4 @@ servo_config = {path = "../config"} servo_url = {path = "../url"} url = {version = "1.2", features = ["heap_size"]} uuid = {version = "0.5", features = ["v4", "serde"]} -webrender_traits = {git = "https://github.com/servo/webrender", features = ["ipc"]} +webrender_api = {git = "https://github.com/servo/webrender", features = ["ipc"]} diff --git a/servo/components/net_traits/image/base.rs b/servo/components/net_traits/image/base.rs index 0753bbafbd2f..16a438b9cd85 100644 --- a/servo/components/net_traits/image/base.rs +++ b/servo/components/net_traits/image/base.rs @@ -5,7 +5,7 @@ use ipc_channel::ipc::IpcSharedMemory; use piston_image::{self, DynamicImage, ImageFormat}; use std::fmt; -use webrender_traits; +use webrender_api; #[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize, HeapSizeOf)] pub enum PixelFormat { @@ -26,8 +26,8 @@ pub struct Image { pub format: PixelFormat, #[ignore_heap_size_of = "Defined in ipc-channel"] pub bytes: IpcSharedMemory, - #[ignore_heap_size_of = "Defined in webrender_traits"] - pub id: Option, + #[ignore_heap_size_of = "Defined in webrender_api"] + pub id: Option, } impl fmt::Debug for Image { diff --git a/servo/components/net_traits/image_cache.rs b/servo/components/net_traits/image_cache.rs index 47ebc5c3eeb4..c86785a845af 100644 --- a/servo/components/net_traits/image_cache.rs +++ b/servo/components/net_traits/image_cache.rs @@ -7,7 +7,7 @@ use image::base::{Image, ImageMetadata}; use ipc_channel::ipc::IpcSender; use servo_url::ServoUrl; use std::sync::Arc; -use webrender_traits; +use webrender_api; // ====================================================================== // Aux structs and enums. @@ -101,7 +101,7 @@ pub enum UsePlaceholder { // ====================================================================== pub trait ImageCache: Sync + Send { - fn new(webrender_api: webrender_traits::RenderApi) -> Self where Self: Sized; + fn new(webrender_api: webrender_api::RenderApi) -> Self where Self: Sized; /// Return any available metadata or image for the given URL, /// or an indication that the image is not yet available if it is in progress, diff --git a/servo/components/net_traits/lib.rs b/servo/components/net_traits/lib.rs index 91a112f1f6fe..8cece70866a4 100644 --- a/servo/components/net_traits/lib.rs +++ b/servo/components/net_traits/lib.rs @@ -23,7 +23,7 @@ extern crate servo_config; extern crate servo_url; extern crate url; extern crate uuid; -extern crate webrender_traits; +extern crate webrender_api; use cookie_rs::Cookie; use filemanager_thread::FileManagerThreadMsg; diff --git a/servo/components/script/Cargo.toml b/servo/components/script/Cargo.toml index 56b2490f4866..cc9ae75842a7 100644 --- a/servo/components/script/Cargo.toml +++ b/servo/components/script/Cargo.toml @@ -92,6 +92,6 @@ url = {version = "1.2", features = ["heap_size", "query_encoding"]} utf-8 = "0.7" uuid = {version = "0.5", features = ["v4"]} xml5ever = {version = "0.8", features = ["unstable"]} -webrender_traits = {git = "https://github.com/servo/webrender", features = ["ipc"]} +webrender_api = {git = "https://github.com/servo/webrender", features = ["ipc"]} webvr = {path = "../webvr"} webvr_traits = {path = "../webvr_traits"} diff --git a/servo/components/script/dom/bindings/trace.rs b/servo/components/script/dom/bindings/trace.rs index 5fccae624278..d73d65026f92 100644 --- a/servo/components/script/dom/bindings/trace.rs +++ b/servo/components/script/dom/bindings/trace.rs @@ -104,8 +104,8 @@ use style::stylesheets::keyframes_rule::Keyframe; use style::values::specified::Length; use time::Duration; use uuid::Uuid; -use webrender_traits::{WebGLBufferId, WebGLError, WebGLFramebufferId, WebGLProgramId}; -use webrender_traits::{WebGLRenderbufferId, WebGLShaderId, WebGLTextureId, WebGLVertexArrayId}; +use webrender_api::{WebGLBufferId, WebGLError, WebGLFramebufferId, WebGLProgramId}; +use webrender_api::{WebGLRenderbufferId, WebGLShaderId, WebGLTextureId, WebGLVertexArrayId}; use webvr_traits::WebVRGamepadHand; /// A trait to allow tracing (only) DOM objects. diff --git a/servo/components/script/dom/document.rs b/servo/components/script/dom/document.rs index ef3c53d42e31..27bd4f100041 100644 --- a/servo/components/script/dom/document.rs +++ b/servo/components/script/dom/document.rs @@ -144,7 +144,7 @@ use time; use timers::OneshotTimerCallback; use url::Host; use url::percent_encoding::percent_decode; -use webrender_traits::ClipId; +use webrender_api::ClipId; /// The number of times we are allowed to see spurious `requestAnimationFrame()` calls before /// falling back to fake ones. diff --git a/servo/components/script/dom/vrdisplay.rs b/servo/components/script/dom/vrdisplay.rs index 37960ea5d6cd..3f73a577fad7 100644 --- a/servo/components/script/dom/vrdisplay.rs +++ b/servo/components/script/dom/vrdisplay.rs @@ -43,7 +43,7 @@ use std::mem; use std::rc::Rc; use std::sync::mpsc; use std::thread; -use webrender_traits::VRCompositorCommand; +use webrender_api::VRCompositorCommand; use webvr_traits::{WebVRDisplayData, WebVRDisplayEvent, WebVRFrameData, WebVRLayer, WebVRMsg}; #[dom_struct] diff --git a/servo/components/script/dom/webgl_extensions/ext/oesvertexarrayobject.rs b/servo/components/script/dom/webgl_extensions/ext/oesvertexarrayobject.rs index 596af11ceff2..097742f5441e 100644 --- a/servo/components/script/dom/webgl_extensions/ext/oesvertexarrayobject.rs +++ b/servo/components/script/dom/webgl_extensions/ext/oesvertexarrayobject.rs @@ -15,7 +15,7 @@ use js::jsapi::JSContext; use js::jsval::{JSVal, NullValue}; use std::iter; use super::{WebGLExtension, WebGLExtensions}; -use webrender_traits::{self, WebGLCommand, WebGLError}; +use webrender_api::{self, WebGLCommand, WebGLError}; #[dom_struct] pub struct OESVertexArrayObject { @@ -48,7 +48,7 @@ impl OESVertexArrayObject { impl OESVertexArrayObjectMethods for OESVertexArrayObject { // https://www.khronos.org/registry/webgl/extensions/OES_vertex_array_object/ fn CreateVertexArrayOES(&self) -> Option> { - let (sender, receiver) = webrender_traits::channel::msg_channel().unwrap(); + let (sender, receiver) = webrender_api::channel::msg_channel().unwrap(); self.ctx.send_renderer_message(CanvasMsg::WebGL(WebGLCommand::CreateVertexArray(sender))); let result = receiver.recv().unwrap(); diff --git a/servo/components/script/dom/webgl_extensions/ext/webglvertexarrayobjectoes.rs b/servo/components/script/dom/webgl_extensions/ext/webglvertexarrayobjectoes.rs index f15a797bf5a5..e44b7c9bc422 100644 --- a/servo/components/script/dom/webgl_extensions/ext/webglvertexarrayobjectoes.rs +++ b/servo/components/script/dom/webgl_extensions/ext/webglvertexarrayobjectoes.rs @@ -15,7 +15,7 @@ use dom::webglobject::WebGLObject; use dom_struct::dom_struct; use std::cell::Cell; use std::collections::HashMap; -use webrender_traits::WebGLVertexArrayId; +use webrender_api::WebGLVertexArrayId; #[dom_struct] pub struct WebGLVertexArrayObjectOES { diff --git a/servo/components/script/dom/webgl_extensions/extensions.rs b/servo/components/script/dom/webgl_extensions/extensions.rs index 575597b84f3a..28c32dede640 100644 --- a/servo/components/script/dom/webgl_extensions/extensions.rs +++ b/servo/components/script/dom/webgl_extensions/extensions.rs @@ -19,7 +19,7 @@ use std::cell::Ref; use std::collections::{HashMap, HashSet}; use super::{ext, WebGLExtension}; use super::wrapper::{WebGLExtensionWrapper, TypedWebGLExtensionWrapper}; -use webrender_traits::WebGLError; +use webrender_api::WebGLError; // Data types that are implemented for texImage2D and texSubImage2D in WebGLRenderingContext // but must trigger a InvalidValue error until the related WebGL Extensions are enabled. diff --git a/servo/components/script/dom/webgl_validations/tex_image_2d.rs b/servo/components/script/dom/webgl_validations/tex_image_2d.rs index 0694af9512bb..41b2795bc144 100644 --- a/servo/components/script/dom/webgl_validations/tex_image_2d.rs +++ b/servo/components/script/dom/webgl_validations/tex_image_2d.rs @@ -8,7 +8,7 @@ use dom::webgltexture::WebGLTexture; use std::{self, fmt}; use super::WebGLValidator; use super::types::{TexImageTarget, TexDataType, TexFormat}; -use webrender_traits::WebGLError::*; +use webrender_api::WebGLError::*; /// The errors that the texImage* family of functions can generate. #[derive(Debug)] diff --git a/servo/components/script/dom/webglbuffer.rs b/servo/components/script/dom/webglbuffer.rs index 13598135176b..448956a9b909 100644 --- a/servo/components/script/dom/webglbuffer.rs +++ b/servo/components/script/dom/webglbuffer.rs @@ -14,8 +14,8 @@ use dom_struct::dom_struct; use ipc_channel::ipc::IpcSender; use std::cell::Cell; use std::collections::HashSet; -use webrender_traits; -use webrender_traits::{WebGLBufferId, WebGLCommand, WebGLError, WebGLResult, WebGLVertexArrayId}; +use webrender_api; +use webrender_api::{WebGLBufferId, WebGLCommand, WebGLError, WebGLResult, WebGLVertexArrayId}; #[dom_struct] pub struct WebGLBuffer { @@ -50,7 +50,7 @@ impl WebGLBuffer { pub fn maybe_new(window: &Window, renderer: IpcSender) -> Option> { - let (sender, receiver) = webrender_traits::channel::msg_channel().unwrap(); + let (sender, receiver) = webrender_api::channel::msg_channel().unwrap(); renderer.send(CanvasMsg::WebGL(WebGLCommand::CreateBuffer(sender))).unwrap(); let result = receiver.recv().unwrap(); diff --git a/servo/components/script/dom/webglframebuffer.rs b/servo/components/script/dom/webglframebuffer.rs index 8d2c0f7b89ca..bb486c80c384 100644 --- a/servo/components/script/dom/webglframebuffer.rs +++ b/servo/components/script/dom/webglframebuffer.rs @@ -16,8 +16,8 @@ use dom::window::Window; use dom_struct::dom_struct; use ipc_channel::ipc::IpcSender; use std::cell::Cell; -use webrender_traits; -use webrender_traits::{WebGLCommand, WebGLFramebufferBindingRequest, WebGLFramebufferId, WebGLResult, WebGLError}; +use webrender_api; +use webrender_api::{WebGLCommand, WebGLFramebufferBindingRequest, WebGLFramebufferId, WebGLResult, WebGLError}; #[must_root] #[derive(JSTraceable, Clone, HeapSizeOf)] @@ -67,7 +67,7 @@ impl WebGLFramebuffer { pub fn maybe_new(window: &Window, renderer: IpcSender) -> Option> { - let (sender, receiver) = webrender_traits::channel::msg_channel().unwrap(); + let (sender, receiver) = webrender_api::channel::msg_channel().unwrap(); renderer.send(CanvasMsg::WebGL(WebGLCommand::CreateFramebuffer(sender))).unwrap(); let result = receiver.recv().unwrap(); diff --git a/servo/components/script/dom/webglprogram.rs b/servo/components/script/dom/webglprogram.rs index 3b2710a5d91b..c76a2f3da187 100644 --- a/servo/components/script/dom/webglprogram.rs +++ b/servo/components/script/dom/webglprogram.rs @@ -17,9 +17,8 @@ use dom::window::Window; use dom_struct::dom_struct; use ipc_channel::ipc::IpcSender; use std::cell::Cell; -use webrender_traits; -use webrender_traits::{WebGLCommand, WebGLError, WebGLParameter}; -use webrender_traits::{WebGLProgramId, WebGLResult}; +use webrender_api; +use webrender_api::{WebGLCommand, WebGLError, WebGLParameter, WebGLProgramId, WebGLResult}; #[dom_struct] pub struct WebGLProgram { @@ -52,7 +51,7 @@ impl WebGLProgram { pub fn maybe_new(window: &Window, renderer: IpcSender) -> Option> { - let (sender, receiver) = webrender_traits::channel::msg_channel().unwrap(); + let (sender, receiver) = webrender_api::channel::msg_channel().unwrap(); renderer.send(CanvasMsg::WebGL(WebGLCommand::CreateProgram(sender))).unwrap(); let result = receiver.recv().unwrap(); @@ -226,7 +225,7 @@ impl WebGLProgram { if self.is_deleted() { return Err(WebGLError::InvalidValue); } - let (sender, receiver) = webrender_traits::channel::msg_channel().unwrap(); + let (sender, receiver) = webrender_api::channel::msg_channel().unwrap(); self.renderer .send(CanvasMsg::WebGL(WebGLCommand::GetActiveUniform(self.id, index, sender))) .unwrap(); @@ -240,7 +239,7 @@ impl WebGLProgram { if self.is_deleted() { return Err(WebGLError::InvalidValue); } - let (sender, receiver) = webrender_traits::channel::msg_channel().unwrap(); + let (sender, receiver) = webrender_api::channel::msg_channel().unwrap(); self.renderer .send(CanvasMsg::WebGL(WebGLCommand::GetActiveAttrib(self.id, index, sender))) .unwrap(); @@ -267,7 +266,7 @@ impl WebGLProgram { return Ok(None); } - let (sender, receiver) = webrender_traits::channel::msg_channel().unwrap(); + let (sender, receiver) = webrender_api::channel::msg_channel().unwrap(); self.renderer .send(CanvasMsg::WebGL(WebGLCommand::GetAttribLocation(self.id, String::from(name), sender))) .unwrap(); @@ -288,7 +287,7 @@ impl WebGLProgram { return Ok(None); } - let (sender, receiver) = webrender_traits::channel::msg_channel().unwrap(); + let (sender, receiver) = webrender_api::channel::msg_channel().unwrap(); self.renderer .send(CanvasMsg::WebGL(WebGLCommand::GetUniformLocation(self.id, String::from(name), sender))) .unwrap(); @@ -309,14 +308,14 @@ impl WebGLProgram { return Ok("One or more shaders failed to compile".to_string()); } } - let (sender, receiver) = webrender_traits::channel::msg_channel().unwrap(); + let (sender, receiver) = webrender_api::channel::msg_channel().unwrap(); self.renderer.send(CanvasMsg::WebGL(WebGLCommand::GetProgramInfoLog(self.id, sender))).unwrap(); Ok(receiver.recv().unwrap()) } /// glGetProgramParameter pub fn parameter(&self, param_id: u32) -> WebGLResult { - let (sender, receiver) = webrender_traits::channel::msg_channel().unwrap(); + let (sender, receiver) = webrender_api::channel::msg_channel().unwrap(); self.renderer.send(CanvasMsg::WebGL(WebGLCommand::GetProgramParameter(self.id, param_id, sender))).unwrap(); receiver.recv().unwrap() } diff --git a/servo/components/script/dom/webglrenderbuffer.rs b/servo/components/script/dom/webglrenderbuffer.rs index 7094a6b37341..03589365c43d 100644 --- a/servo/components/script/dom/webglrenderbuffer.rs +++ b/servo/components/script/dom/webglrenderbuffer.rs @@ -13,8 +13,8 @@ use dom::window::Window; use dom_struct::dom_struct; use ipc_channel::ipc::IpcSender; use std::cell::Cell; -use webrender_traits; -use webrender_traits::{WebGLCommand, WebGLRenderbufferId, WebGLResult, WebGLError}; +use webrender_api; +use webrender_api::{WebGLCommand, WebGLRenderbufferId, WebGLResult, WebGLError}; #[dom_struct] pub struct WebGLRenderbuffer { @@ -45,7 +45,7 @@ impl WebGLRenderbuffer { pub fn maybe_new(window: &Window, renderer: IpcSender) -> Option> { - let (sender, receiver) = webrender_traits::channel::msg_channel().unwrap(); + let (sender, receiver) = webrender_api::channel::msg_channel().unwrap(); renderer.send(CanvasMsg::WebGL(WebGLCommand::CreateRenderbuffer(sender))).unwrap(); let result = receiver.recv().unwrap(); diff --git a/servo/components/script/dom/webglrenderingcontext.rs b/servo/components/script/dom/webglrenderingcontext.rs index c8bbba63f53d..73d4ddba1b90 100644 --- a/servo/components/script/dom/webglrenderingcontext.rs +++ b/servo/components/script/dom/webglrenderingcontext.rs @@ -54,9 +54,9 @@ use script_traits::ScriptMsg as ConstellationMsg; use servo_config::prefs::PREFS; use std::cell::Cell; use std::collections::HashMap; -use webrender_traits; -use webrender_traits::{WebGLCommand, WebGLError, WebGLFramebufferBindingRequest, WebGLParameter}; -use webrender_traits::WebGLError::*; +use webrender_api; +use webrender_api::{WebGLCommand, WebGLError, WebGLFramebufferBindingRequest, WebGLParameter}; +use webrender_api::WebGLError::*; type ImagePixelResult = Result<(Vec, Size2D, bool), ()>; pub const MAX_UNIFORM_AND_ATTRIBUTE_LEN: usize = 256; @@ -140,7 +140,7 @@ pub struct WebGLRenderingContext { #[ignore_heap_size_of = "Defined in offscreen_gl_context"] limits: GLLimits, canvas: JS, - #[ignore_heap_size_of = "Defined in webrender_traits"] + #[ignore_heap_size_of = "Defined in webrender_api"] last_error: Cell>, texture_unpacking_settings: Cell, texture_unpacking_alignment: Cell, @@ -1035,7 +1035,7 @@ impl WebGLRenderingContext { } fn get_gl_extensions(&self) -> String { - let (sender, receiver) = webrender_traits::channel::msg_channel().unwrap(); + let (sender, receiver) = webrender_api::channel::msg_channel().unwrap(); self.ipc_renderer .send(CanvasMsg::WebGL(WebGLCommand::GetExtensions(sender))) .unwrap(); @@ -1108,7 +1108,7 @@ impl WebGLRenderingContextMethods for WebGLRenderingContext { // https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.11 fn Finish(&self) { - let (sender, receiver) = webrender_traits::channel::msg_channel().unwrap(); + let (sender, receiver) = webrender_api::channel::msg_channel().unwrap(); self.ipc_renderer .send(CanvasMsg::WebGL(WebGLCommand::Finish(sender))) .unwrap(); @@ -1117,7 +1117,7 @@ impl WebGLRenderingContextMethods for WebGLRenderingContext { // https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.1 fn DrawingBufferWidth(&self) -> i32 { - let (sender, receiver) = webrender_traits::channel::msg_channel().unwrap(); + let (sender, receiver) = webrender_api::channel::msg_channel().unwrap(); self.ipc_renderer .send(CanvasMsg::WebGL(WebGLCommand::DrawingBufferWidth(sender))) .unwrap(); @@ -1126,7 +1126,7 @@ impl WebGLRenderingContextMethods for WebGLRenderingContext { // https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.1 fn DrawingBufferHeight(&self) -> i32 { - let (sender, receiver) = webrender_traits::channel::msg_channel().unwrap(); + let (sender, receiver) = webrender_api::channel::msg_channel().unwrap(); self.ipc_renderer .send(CanvasMsg::WebGL(WebGLCommand::DrawingBufferHeight(sender))) .unwrap(); @@ -1136,7 +1136,7 @@ impl WebGLRenderingContextMethods for WebGLRenderingContext { #[allow(unsafe_code)] // https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.5 unsafe fn GetBufferParameter(&self, _cx: *mut JSContext, target: u32, parameter: u32) -> JSVal { - let (sender, receiver) = webrender_traits::channel::msg_channel().unwrap(); + let (sender, receiver) = webrender_api::channel::msg_channel().unwrap(); self.ipc_renderer .send(CanvasMsg::WebGL(WebGLCommand::GetBufferParameter(target, parameter, sender))) .unwrap(); @@ -1205,7 +1205,7 @@ impl WebGLRenderingContextMethods for WebGLRenderingContext { } } - let (sender, receiver) = webrender_traits::channel::msg_channel().unwrap(); + let (sender, receiver) = webrender_api::channel::msg_channel().unwrap(); self.ipc_renderer .send(CanvasMsg::WebGL(WebGLCommand::GetParameter(parameter, sender))) .unwrap(); @@ -1243,7 +1243,7 @@ impl WebGLRenderingContextMethods for WebGLRenderingContext { // https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.2 fn GetContextAttributes(&self) -> Option { - let (sender, receiver) = webrender_traits::channel::msg_channel().unwrap(); + let (sender, receiver) = webrender_api::channel::msg_channel().unwrap(); // If the send does not succeed, assume context lost if let Err(_) = self.ipc_renderer @@ -2223,7 +2223,7 @@ impl WebGLRenderingContextMethods for WebGLRenderingContext { shader_type: u32, precision_type: u32) -> Option> { - let (sender, receiver) = webrender_traits::channel::msg_channel().unwrap(); + let (sender, receiver) = webrender_api::channel::msg_channel().unwrap(); self.ipc_renderer.send(CanvasMsg::WebGL(WebGLCommand::GetShaderPrecisionFormat(shader_type, precision_type, sender))) @@ -2268,7 +2268,7 @@ impl WebGLRenderingContextMethods for WebGLRenderingContext { return jsval.get(); } - let (sender, receiver) = webrender_traits::channel::msg_channel().unwrap(); + let (sender, receiver) = webrender_api::channel::msg_channel().unwrap(); self.ipc_renderer.send(CanvasMsg::WebGL(WebGLCommand::GetVertexAttrib(index, pname, sender))).unwrap(); match handle_potential_webgl_error!(self, receiver.recv().unwrap(), WebGLParameter::Invalid) { @@ -2287,7 +2287,7 @@ impl WebGLRenderingContextMethods for WebGLRenderingContext { // https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10 fn GetVertexAttribOffset(&self, index: u32, pname: u32) -> i64 { - let (sender, receiver) = webrender_traits::channel::msg_channel().unwrap(); + let (sender, receiver) = webrender_api::channel::msg_channel().unwrap(); self.ipc_renderer.send(CanvasMsg::WebGL(WebGLCommand::GetVertexAttribOffset(index, pname, sender))).unwrap(); handle_potential_webgl_error!(self, receiver.recv().unwrap(), 0) as i64 @@ -2321,7 +2321,7 @@ impl WebGLRenderingContextMethods for WebGLRenderingContext { // https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.3 fn IsEnabled(&self, cap: u32) -> bool { if self.validate_feature_enum(cap) { - let (sender, receiver) = webrender_traits::channel::msg_channel().unwrap(); + let (sender, receiver) = webrender_api::channel::msg_channel().unwrap(); self.ipc_renderer .send(CanvasMsg::WebGL(WebGLCommand::IsEnabled(cap, sender))) .unwrap(); @@ -2522,7 +2522,7 @@ impl WebGLRenderingContextMethods for WebGLRenderingContext { _ => return Ok(self.webgl_error(InvalidOperation)), }; - let (sender, receiver) = webrender_traits::channel::msg_channel().unwrap(); + let (sender, receiver) = webrender_api::channel::msg_channel().unwrap(); self.ipc_renderer .send(CanvasMsg::WebGL(WebGLCommand::ReadPixels(x, y, width, height, format, pixel_type, sender))) .unwrap(); diff --git a/servo/components/script/dom/webglshader.rs b/servo/components/script/dom/webglshader.rs index b66151bf3532..edd9cf7bdb35 100644 --- a/servo/components/script/dom/webglshader.rs +++ b/servo/components/script/dom/webglshader.rs @@ -16,8 +16,8 @@ use dom_struct::dom_struct; use ipc_channel::ipc::IpcSender; use std::cell::Cell; use std::sync::{ONCE_INIT, Once}; -use webrender_traits; -use webrender_traits::{WebGLCommand, WebGLParameter, WebGLResult, WebGLShaderId}; +use webrender_api; +use webrender_api::{WebGLCommand, WebGLParameter, WebGLResult, WebGLShaderId}; #[derive(Clone, Copy, PartialEq, Debug, JSTraceable, HeapSizeOf)] pub enum ShaderCompilationStatus { @@ -71,7 +71,7 @@ impl WebGLShader { renderer: IpcSender, shader_type: u32) -> Option> { - let (sender, receiver) = webrender_traits::channel::msg_channel().unwrap(); + let (sender, receiver) = webrender_api::channel::msg_channel().unwrap(); renderer.send(CanvasMsg::WebGL(WebGLCommand::CreateShader(shader_type, sender))).unwrap(); let result = receiver.recv().unwrap(); @@ -170,7 +170,7 @@ impl WebGLShader { /// glGetParameter pub fn parameter(&self, param_id: u32) -> WebGLResult { - let (sender, receiver) = webrender_traits::channel::msg_channel().unwrap(); + let (sender, receiver) = webrender_api::channel::msg_channel().unwrap(); self.renderer.send(CanvasMsg::WebGL(WebGLCommand::GetShaderParameter(self.id, param_id, sender))).unwrap(); receiver.recv().unwrap() } diff --git a/servo/components/script/dom/webgltexture.rs b/servo/components/script/dom/webgltexture.rs index 184a9c391317..88d5faaf5c83 100644 --- a/servo/components/script/dom/webgltexture.rs +++ b/servo/components/script/dom/webgltexture.rs @@ -16,8 +16,8 @@ use dom_struct::dom_struct; use ipc_channel::ipc::IpcSender; use std::cell::Cell; use std::cmp; -use webrender_traits; -use webrender_traits::{WebGLCommand, WebGLError, WebGLResult, WebGLTextureId}; +use webrender_api; +use webrender_api::{WebGLCommand, WebGLError, WebGLResult, WebGLTextureId}; pub enum TexParameterValue { Float(f32), @@ -69,7 +69,7 @@ impl WebGLTexture { pub fn maybe_new(window: &Window, renderer: IpcSender) -> Option> { - let (sender, receiver) = webrender_traits::channel::msg_channel().unwrap(); + let (sender, receiver) = webrender_api::channel::msg_channel().unwrap(); renderer.send(CanvasMsg::WebGL(WebGLCommand::CreateTexture(sender))).unwrap(); let result = receiver.recv().unwrap(); diff --git a/servo/components/script/dom/webgluniformlocation.rs b/servo/components/script/dom/webgluniformlocation.rs index d76ab91ee5d5..228808303c49 100644 --- a/servo/components/script/dom/webgluniformlocation.rs +++ b/servo/components/script/dom/webgluniformlocation.rs @@ -8,7 +8,7 @@ use dom::bindings::js::Root; use dom::bindings::reflector::{Reflector, reflect_dom_object}; use dom::window::Window; use dom_struct::dom_struct; -use webrender_traits::WebGLProgramId; +use webrender_api::WebGLProgramId; #[dom_struct] pub struct WebGLUniformLocation { diff --git a/servo/components/script/dom/window.rs b/servo/components/script/dom/window.rs index ff7f3e061f11..487bf48eaba2 100644 --- a/servo/components/script/dom/window.rs +++ b/servo/components/script/dom/window.rs @@ -124,7 +124,7 @@ use timers::{IsInterval, TimerCallback}; use tinyfiledialogs::{self, MessageBoxIcon}; use url::Position; use webdriver_handlers::jsval_to_webdriver; -use webrender_traits::ClipId; +use webrender_api::ClipId; use webvr_traits::WebVRMsg; /// Current state of the window object diff --git a/servo/components/script/lib.rs b/servo/components/script/lib.rs index 2940788fe044..82b1f80ab88b 100644 --- a/servo/components/script/lib.rs +++ b/servo/components/script/lib.rs @@ -103,7 +103,7 @@ extern crate unicode_segmentation; extern crate url; extern crate utf8; extern crate uuid; -extern crate webrender_traits; +extern crate webrender_api; extern crate webvr_traits; extern crate xml5ever; diff --git a/servo/components/script_layout_interface/Cargo.toml b/servo/components/script_layout_interface/Cargo.toml index 8a4c66c9e0de..c28f3d599795 100644 --- a/servo/components/script_layout_interface/Cargo.toml +++ b/servo/components/script_layout_interface/Cargo.toml @@ -31,4 +31,4 @@ selectors = { path = "../selectors" } servo_atoms = {path = "../atoms"} servo_url = {path = "../url"} style = {path = "../style"} -webrender_traits = {git = "https://github.com/servo/webrender", features = ["ipc"]} +webrender_api = {git = "https://github.com/servo/webrender", features = ["ipc"]} diff --git a/servo/components/script_layout_interface/lib.rs b/servo/components/script_layout_interface/lib.rs index ebdb4a59b7a6..073ae95978e1 100644 --- a/servo/components/script_layout_interface/lib.rs +++ b/servo/components/script_layout_interface/lib.rs @@ -33,7 +33,7 @@ extern crate selectors; extern crate servo_atoms; extern crate servo_url; extern crate style; -extern crate webrender_traits; +extern crate webrender_api; pub mod message; pub mod reporter; diff --git a/servo/components/script_layout_interface/rpc.rs b/servo/components/script_layout_interface/rpc.rs index 00bad9705b2e..ab3509e76042 100644 --- a/servo/components/script_layout_interface/rpc.rs +++ b/servo/components/script_layout_interface/rpc.rs @@ -6,7 +6,7 @@ use app_units::Au; use euclid::{Point2D, Rect}; use script_traits::UntrustedNodeAddress; use style::properties::longhands::{margin_top, margin_right, margin_bottom, margin_left, overflow_x}; -use webrender_traits::ClipId; +use webrender_api::ClipId; /// Synchronous messages that script can send to layout. /// diff --git a/servo/components/script_layout_interface/wrapper_traits.rs b/servo/components/script_layout_interface/wrapper_traits.rs index 579ac767d13c..05b24bca915c 100644 --- a/servo/components/script_layout_interface/wrapper_traits.rs +++ b/servo/components/script_layout_interface/wrapper_traits.rs @@ -26,7 +26,7 @@ use style::properties::{CascadeFlags, ServoComputedValues}; use style::selector_parser::{PseudoElement, PseudoElementCascadeType, SelectorImpl}; use style::stylearc::Arc; use style::stylist::RuleInclusion; -use webrender_traits::ClipId; +use webrender_api::ClipId; #[derive(Copy, PartialEq, Clone, Debug)] pub enum PseudoElementType { diff --git a/servo/components/script_traits/Cargo.toml b/servo/components/script_traits/Cargo.toml index 6303224ecb70..97790b822306 100644 --- a/servo/components/script_traits/Cargo.toml +++ b/servo/components/script_traits/Cargo.toml @@ -34,5 +34,5 @@ servo_url = {path = "../url"} style_traits = {path = "../style_traits", features = ["servo"]} time = "0.1.12" url = {version = "1.2", features = ["heap_size"]} -webrender_traits = {git = "https://github.com/servo/webrender", features = ["ipc"]} +webrender_api = {git = "https://github.com/servo/webrender", features = ["ipc"]} webvr_traits = {path = "../webvr_traits"} diff --git a/servo/components/script_traits/lib.rs b/servo/components/script_traits/lib.rs index 1a3ec8c7a6ce..40b8532ab54a 100644 --- a/servo/components/script_traits/lib.rs +++ b/servo/components/script_traits/lib.rs @@ -33,7 +33,7 @@ extern crate servo_atoms; extern crate servo_url; extern crate style_traits; extern crate time; -extern crate webrender_traits; +extern crate webrender_api; extern crate webvr_traits; mod script_msg; @@ -69,7 +69,7 @@ use std::sync::Arc; use std::sync::mpsc::{Receiver, Sender, RecvTimeoutError}; use style_traits::CSSPixel; use webdriver_msg::{LoadStatus, WebDriverScriptCommand}; -use webrender_traits::ClipId; +use webrender_api::ClipId; use webvr_traits::{WebVREvent, WebVRMsg}; pub use script_msg::{LayoutMsg, ScriptMsg, EventResult, LogEntry}; diff --git a/servo/components/script_traits/script_msg.rs b/servo/components/script_traits/script_msg.rs index b9e5b48b4b92..6e19ae12b312 100644 --- a/servo/components/script_traits/script_msg.rs +++ b/servo/components/script_traits/script_msg.rs @@ -27,7 +27,7 @@ use servo_url::ServoUrl; use style_traits::CSSPixel; use style_traits::cursor::Cursor; use style_traits::viewport::ViewportConstraints; -use webrender_traits::ClipId; +use webrender_api::ClipId; /// Messages from the layout to the constellation. #[derive(Deserialize, Serialize)] diff --git a/servo/components/servo/Cargo.toml b/servo/components/servo/Cargo.toml index a81021fdc360..680f9fba409c 100644 --- a/servo/components/servo/Cargo.toml +++ b/servo/components/servo/Cargo.toml @@ -50,7 +50,7 @@ servo_url = {path = "../url"} style = {path = "../style", features = ["servo"]} style_traits = {path = "../style_traits", features = ["servo"]} webrender = {git = "https://github.com/servo/webrender"} -webrender_traits = {git = "https://github.com/servo/webrender", features = ["ipc"]} +webrender_api = {git = "https://github.com/servo/webrender", features = ["ipc"]} webdriver_server = {path = "../webdriver_server", optional = true} webvr = {path = "../webvr"} webvr_traits = {path = "../webvr_traits"} diff --git a/servo/components/servo/lib.rs b/servo/components/servo/lib.rs index 25a2891046bd..116f13c2cd9f 100644 --- a/servo/components/servo/lib.rs +++ b/servo/components/servo/lib.rs @@ -49,7 +49,7 @@ pub extern crate servo_geometry; pub extern crate servo_url; pub extern crate style; pub extern crate style_traits; -pub extern crate webrender_traits; +pub extern crate webrender_api; pub extern crate webvr; pub extern crate webvr_traits; @@ -175,8 +175,8 @@ impl Browser where Window: WindowMethods + 'static { }; let framebuffer_size = window.framebuffer_size(); - let framebuffer_size = webrender_traits::DeviceUintSize::new(framebuffer_size.width, - framebuffer_size.height); + let framebuffer_size = webrender_api::DeviceUintSize::new(framebuffer_size.width, + framebuffer_size.height); webrender::Renderer::new(window.gl(), webrender::RendererOptions { device_pixel_ratio: device_pixel_ratio, @@ -287,7 +287,7 @@ fn create_constellation(user_agent: Cow<'static, str>, devtools_chan: Option>, supports_clipboard: bool, webrender: &webrender::Renderer, - webrender_api_sender: webrender_traits::RenderApiSender) + webrender_api_sender: webrender_api::RenderApiSender) -> (Sender, SWManagerSenders) { let bluetooth_thread: IpcSender = BluetoothThreadFactory::new(); diff --git a/servo/components/style_traits/lib.rs b/servo/components/style_traits/lib.rs index d6336ca9e0c4..dc708f69d483 100644 --- a/servo/components/style_traits/lib.rs +++ b/servo/components/style_traits/lib.rs @@ -30,7 +30,7 @@ use selectors::parser::SelectorParseError; pub type UnsafeNode = (usize, usize); /// Represents a mobile style pinch zoom factor. -/// TODO(gw): Once WR supports pinch zoom, use a type directly from webrender_traits. +/// TODO(gw): Once WR supports pinch zoom, use a type directly from webrender_api. #[derive(Clone, Copy, Debug, PartialEq)] #[cfg_attr(feature = "servo", derive(Deserialize, Serialize, HeapSizeOf))] pub struct PinchZoomFactor(f32); diff --git a/servo/components/webvr/Cargo.toml b/servo/components/webvr/Cargo.toml index a35c9335f1de..f7edd95d6d82 100644 --- a/servo/components/webvr/Cargo.toml +++ b/servo/components/webvr/Cargo.toml @@ -16,4 +16,4 @@ msg = {path = "../msg"} script_traits = {path = "../script_traits"} servo_config = {path = "../config"} webvr_traits = {path = "../webvr_traits" } -webrender_traits = {git = "https://github.com/servo/webrender", features = ["ipc"]} +webrender_api = {git = "https://github.com/servo/webrender", features = ["ipc"]} diff --git a/servo/components/webvr/lib.rs b/servo/components/webvr/lib.rs index bd0c0544a521..62f3e992fdc2 100644 --- a/servo/components/webvr/lib.rs +++ b/servo/components/webvr/lib.rs @@ -10,7 +10,7 @@ extern crate log; extern crate msg; extern crate script_traits; extern crate servo_config; -extern crate webrender_traits; +extern crate webrender_api; extern crate webvr_traits; mod webvr_thread; diff --git a/servo/components/webvr/webvr_thread.rs b/servo/components/webvr/webvr_thread.rs index 3f268ab3cbb0..ec5501538707 100644 --- a/servo/components/webvr/webvr_thread.rs +++ b/servo/components/webvr/webvr_thread.rs @@ -11,8 +11,8 @@ use std::{thread, time}; use std::collections::{HashMap, HashSet}; use std::sync::mpsc; use std::sync::mpsc::{Receiver, Sender}; -use webrender_traits; -use webrender_traits::DeviceIntSize; +use webrender_api; +use webrender_api::DeviceIntSize; use webvr_traits::{WebVRMsg, WebVRResult}; use webvr_traits::webvr::*; @@ -305,7 +305,7 @@ impl WebVRThread { pub struct WebVRCompositor(*mut VRDisplay); pub struct WebVRCompositorHandler { - compositors: HashMap, + compositors: HashMap, webvr_thread_receiver: Receiver>, webvr_thread_sender: Option> } @@ -328,14 +328,14 @@ impl WebVRCompositorHandler { } } -impl webrender_traits::VRCompositorHandler for WebVRCompositorHandler { +impl webrender_api::VRCompositorHandler for WebVRCompositorHandler { #[allow(unsafe_code)] - fn handle(&mut self, cmd: webrender_traits::VRCompositorCommand, texture: Option<(u32, DeviceIntSize)>) { + fn handle(&mut self, cmd: webrender_api::VRCompositorCommand, texture: Option<(u32, DeviceIntSize)>) { match cmd { - webrender_traits::VRCompositorCommand::Create(compositor_id) => { + webrender_api::VRCompositorCommand::Create(compositor_id) => { self.create_compositor(compositor_id); } - webrender_traits::VRCompositorCommand::SyncPoses(compositor_id, near, far, sender) => { + webrender_api::VRCompositorCommand::SyncPoses(compositor_id, near, far, sender) => { if let Some(compositor) = self.compositors.get(&compositor_id) { let pose = unsafe { (*compositor.0).sync_poses(); @@ -346,7 +346,7 @@ impl webrender_traits::VRCompositorHandler for WebVRCompositorHandler { let _ = sender.send(Err(())); } } - webrender_traits::VRCompositorCommand::SubmitFrame(compositor_id, left_bounds, right_bounds) => { + webrender_api::VRCompositorCommand::SubmitFrame(compositor_id, left_bounds, right_bounds) => { if let Some(compositor) = self.compositors.get(&compositor_id) { if let Some((texture_id, size)) = texture { let layer = VRLayer { @@ -361,7 +361,7 @@ impl webrender_traits::VRCompositorHandler for WebVRCompositorHandler { } } } - webrender_traits::VRCompositorCommand::Release(compositor_id) => { + webrender_api::VRCompositorCommand::Release(compositor_id) => { self.compositors.remove(&compositor_id); } } @@ -370,7 +370,7 @@ impl webrender_traits::VRCompositorHandler for WebVRCompositorHandler { impl WebVRCompositorHandler { #[allow(unsafe_code)] - fn create_compositor(&mut self, display_id: webrender_traits::VRCompositorId) { + fn create_compositor(&mut self, display_id: webrender_api::VRCompositorId) { let sender = match self.webvr_thread_sender { Some(ref s) => s, None => return, diff --git a/servo/docs/ORGANIZATION.md b/servo/docs/ORGANIZATION.md index 3842c49443c6..9a37472a0622 100644 --- a/servo/docs/ORGANIZATION.md +++ b/servo/docs/ORGANIZATION.md @@ -112,4 +112,4 @@ * : a CSS selector matching library * : a WebSocket protocol implementation * : an implementation of the URL specification -* and : a GPU renderer +* : a GPU renderer diff --git a/servo/ports/cef/Cargo.toml b/servo/ports/cef/Cargo.toml index e17028c5e925..684e6875404a 100644 --- a/servo/ports/cef/Cargo.toml +++ b/servo/ports/cef/Cargo.toml @@ -33,7 +33,7 @@ servo_config = {path = "../../components/config"} servo_geometry = {path = "../../components/geometry"} servo_url = {path = "../../components/url"} style_traits = {path = "../../components/style_traits"} -webrender_traits = {git = "https://github.com/servo/webrender", features = ["ipc"]} +webrender_api = {git = "https://github.com/servo/webrender", features = ["ipc"]} [target.'cfg(target_os="macos")'.dependencies] objc = "0.2" diff --git a/servo/ports/cef/browser_host.rs b/servo/ports/cef/browser_host.rs index 608ccfbad709..b90daf55f2a2 100644 --- a/servo/ports/cef/browser_host.rs +++ b/servo/ports/cef/browser_host.rs @@ -8,7 +8,7 @@ use interfaces::{CefBrowser, CefBrowserHost, CefClient, cef_browser_t, cef_brows use types::cef_event_flags_t::{EVENTFLAG_ALT_DOWN, EVENTFLAG_CONTROL_DOWN, EVENTFLAG_SHIFT_DOWN}; use types::cef_key_event_type_t::{KEYEVENT_CHAR, KEYEVENT_KEYDOWN, KEYEVENT_KEYUP, KEYEVENT_RAWKEYDOWN}; use types::{cef_mouse_button_type_t, cef_mouse_event, cef_rect_t, cef_key_event, cef_window_handle_t}; -use webrender_traits::ScrollLocation; +use webrender_api::ScrollLocation; use wrappers::CefWrap; use compositing::windowing::{WindowEvent, MouseWindowEvent}; diff --git a/servo/ports/cef/lib.rs b/servo/ports/cef/lib.rs index f953358e4a9b..5206db963b2a 100644 --- a/servo/ports/cef/lib.rs +++ b/servo/ports/cef/lib.rs @@ -24,7 +24,7 @@ extern crate style_traits; extern crate net_traits; extern crate msg; -extern crate webrender_traits; +extern crate webrender_api; extern crate libc; diff --git a/servo/ports/glutin/Cargo.toml b/servo/ports/glutin/Cargo.toml index d369b4b99d44..7a4e746915f2 100644 --- a/servo/ports/glutin/Cargo.toml +++ b/servo/ports/glutin/Cargo.toml @@ -22,7 +22,7 @@ servo_geometry = {path = "../../components/geometry"} servo_config = {path = "../../components/config"} servo_url = {path = "../../components/url"} style_traits = {path = "../../components/style_traits"} -webrender_traits = {git = "https://github.com/servo/webrender", features = ["ipc"]} +webrender_api = {git = "https://github.com/servo/webrender", features = ["ipc"]} [target.'cfg(any(target_os = "linux", target_os = "macos"))'.dependencies] osmesa-sys = "0.1.2" diff --git a/servo/ports/glutin/lib.rs b/servo/ports/glutin/lib.rs index 4e390f7eb8e8..025572e65a11 100644 --- a/servo/ports/glutin/lib.rs +++ b/servo/ports/glutin/lib.rs @@ -21,7 +21,7 @@ extern crate servo_config; extern crate servo_geometry; extern crate servo_url; extern crate style_traits; -extern crate webrender_traits; +extern crate webrender_api; #[cfg(target_os = "windows")] extern crate winapi; #[cfg(target_os = "windows")] extern crate user32; diff --git a/servo/ports/glutin/window.rs b/servo/ports/glutin/window.rs index 1893fb2d47a3..bd64703d7a1b 100644 --- a/servo/ports/glutin/window.rs +++ b/servo/ports/glutin/window.rs @@ -41,7 +41,7 @@ use std::rc::Rc; use style_traits::cursor::Cursor; #[cfg(target_os = "windows")] use user32; -use webrender_traits::ScrollLocation; +use webrender_api::ScrollLocation; #[cfg(target_os = "windows")] use winapi; diff --git a/servo/python/tidy/servo_tidy/licenseck.py b/servo/python/tidy/servo_tidy/licenseck.py index a4953e6eabbb..962133467157 100644 --- a/servo/python/tidy/servo_tidy/licenseck.py +++ b/servo/python/tidy/servo_tidy/licenseck.py @@ -64,5 +64,5 @@ licenses_dep_toml = [ 'name = "servo-freetype-sys"', 'name = "simd"', 'name = "webrender"', - 'name = "webrender_traits"', + 'name = "webrender_api"', ] diff --git a/servo/python/tidy/servo_tidy_tests/rust_tidy.rs b/servo/python/tidy/servo_tidy_tests/rust_tidy.rs index 32c2547e502d..f50cbaa5ef7b 100644 --- a/servo/python/tidy/servo_tidy_tests/rust_tidy.rs +++ b/servo/python/tidy/servo_tidy_tests/rust_tidy.rs @@ -17,7 +17,7 @@ pub mod display_list; mod test::{ }; -extern crate webrender_traits; +extern crate webrender_api; extern crate style_traits; #[foo = "bar,baz"]