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
This commit is contained in:
Martin Robinson 2017-07-12 21:52:27 -07:00
Родитель eb21d99a2c
Коммит d42609fdf5
86 изменённых файлов: 548 добавлений и 521 удалений

162
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)" = "<none>"
"checksum azure 0.20.0 (git+https://github.com/servo/rust-azure)" = "<none>"
"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)" = "<none>"
"checksum webrender_traits 0.44.0 (git+https://github.com/servo/webrender)" = "<none>"
"checksum webrender 0.47.0 (git+https://github.com/servo/webrender)" = "<none>"
"checksum webrender_api 0.47.0 (git+https://github.com/servo/webrender)" = "<none>"
"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"

Просмотреть файл

@ -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"]}

Просмотреть файл

@ -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<CanvasPaintState<'a>>,
webrender_api: webrender_traits::RenderApi,
image_key: Option<webrender_traits::ImageKey>,
webrender_api: webrender_api::RenderApi,
image_key: Option<webrender_api::ImageKey>,
}
#[derive(Clone)]
@ -99,7 +99,7 @@ impl<'a> CanvasPaintState<'a> {
impl<'a> CanvasPaintThread<'a> {
fn new(size: Size2D<i32>,
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<i32>,
webrender_api_sender: webrender_traits::RenderApiSender,
webrender_api_sender: webrender_api::RenderApiSender,
antialias: bool)
-> IpcSender<CanvasMsg> {
let (sender, receiver) = ipc::channel::<CanvasMsg>().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) => {

Просмотреть файл

@ -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;

Просмотреть файл

@ -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<NativeGLContext>),
@ -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_traits::ImageKey>),
WebRender(webrender_api::RenderApi, webrender_api::WebGLContextId),
Readback(GLContextWrapper, webrender_api::RenderApi, Option<webrender_api::ImageKey>),
}
pub struct WebGLPaintThread {
@ -112,7 +112,7 @@ pub struct WebGLPaintThread {
fn create_readback_painter(size: Size2D<i32>,
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<i32>,
impl WebGLPaintThread {
fn new(size: Size2D<i32>,
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<i32>,
attrs: GLContextAttributes,
webrender_api_sender: webrender_traits::RenderApiSender)
webrender_api_sender: webrender_api::RenderApiSender)
-> Result<(IpcSender<CanvasMsg>, GLLimits), String> {
let (sender, receiver) = ipc::channel::<CanvasMsg>().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);
}
}

Просмотреть файл

@ -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"]}

Просмотреть файл

@ -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)]

Просмотреть файл

@ -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"]}

Просмотреть файл

@ -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<Window: WindowMethods> {
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<gl::Gl>,
@ -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<Fn() + Send>) {
self.compositor_proxy.send(Msg::Dispatch(f));
}
@ -704,12 +704,12 @@ impl<Window: WindowMethods> IOCompositor<Window> {
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<Window: WindowMethods> IOCompositor<Window> {
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<Window: WindowMethods> IOCompositor<Window> {
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<Window: WindowMethods> IOCompositor<Window> {
(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<Window: WindowMethods> IOCompositor<Window> {
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<Window: WindowMethods> IOCompositor<Window> {
}
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<Window: WindowMethods> IOCompositor<Window> {
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<Window: WindowMethods> IOCompositor<Window> {
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);
});

Просмотреть файл

@ -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<f32>, bool),
ScrollFragmentPoint(webrender_api::ClipId, Point2D<f32>, bool),
/// Alerts the compositor that the current page has changed its title.
ChangePageTitle(PipelineId, Option<String>),
/// 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,
}

Просмотреть файл

@ -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;

Просмотреть файл

@ -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 {

Просмотреть файл

@ -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"}

Просмотреть файл

@ -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<Message, LTF, STF> {
/// 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?

Просмотреть файл

@ -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;

Просмотреть файл

@ -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<bool>,
/// 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<IpcSender<WebVRMsg>>,
}

Просмотреть файл

@ -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"

Просмотреть файл

@ -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<Au>,
/// 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<Au>,
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<webrender_traits::ImageKey>,
pub key: Option<webrender_api::ImageKey>,
}
impl WebRenderImageInfo {
@ -1399,3 +1402,29 @@ impl SimpleMatrixDetection for Transform3D<f32> {
self.m44 == _1
}
}
trait ToPointF {
fn to_pointf(&self) -> webrender_api::LayoutPoint;
}
impl ToPointF for Point2D<Au> {
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<Au> {
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)
}
}

Просмотреть файл

@ -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<Shaper>,
shape_cache: RefCell<HashMap<ShapeCacheEntry, Arc<GlyphStore>>>,
glyph_advance_cache: RefCell<HashMap<u32, FractionalPixel>>,
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,

Просмотреть файл

@ -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<FontTemplateData>,
pub font_key: Option<webrender_traits::FontKey>,
pub font_key: Option<webrender_api::FontKey>,
}
impl FontTemplates {
@ -127,8 +127,8 @@ struct FontCache {
web_families: HashMap<LowercaseString, FontTemplates>,
font_context: FontContextHandle,
core_resource_thread: CoreResourceThread,
webrender_api: Option<webrender_traits::RenderApi>,
webrender_fonts: HashMap<Atom, webrender_traits::FontKey>,
webrender_api: Option<webrender_api::RenderApi>,
webrender_fonts: HashMap<Atom, webrender_api::FontKey>,
}
fn populate_generic_fonts() -> HashMap<FontFamily, LowercaseString> {
@ -400,7 +400,7 @@ pub struct FontCacheThread {
impl FontCacheThread {
pub fn new(core_resource_thread: CoreResourceThread,
webrender_api: Option<webrender_traits::RenderApi>) -> FontCacheThread {
webrender_api: Option<webrender_api::RenderApi>) -> FontCacheThread {
let (chan, port) = ipc::channel().unwrap();
let channel_to_self = chan.clone();

Просмотреть файл

@ -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, ()> {
font_key: webrender_api::FontKey) -> Result<Font, ()> {
// 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.

Просмотреть файл

@ -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;

Просмотреть файл

@ -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

Просмотреть файл

@ -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

Просмотреть файл

@ -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 {

Просмотреть файл

@ -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<FontTemplateData>,
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<Vec<GlyphRun>>,
pub bidi_level: bidi::Level,

Просмотреть файл

@ -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"]}

Просмотреть файл

@ -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<Au>,
clip: &ClippingRegion,
clip: LocalClip,
node: OpaqueNode,
cursor: Option<Cursor>,
section: DisplayListSection)
@ -394,7 +395,7 @@ pub trait FragmentDisplayListBuilding {
style: &ServoComputedValues,
display_list_section: DisplayListSection,
absolute_bounds: &Rect<Au>,
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<Au>,
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<Au>,
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<Au>,
clip_bounds: &Rect<Au>,
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<Au>) {
// 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<Au>,
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<Au>,
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<Au>,
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<Au>,
clip_bounds: &Rect<Au>,
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<Au>) {
// 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);

Просмотреть файл

@ -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.
///

Просмотреть файл

@ -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;

Просмотреть файл

@ -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.

Просмотреть файл

@ -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<Au> {
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<Au> {
}
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<Au> {
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<Au> {
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<Au> {
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<Au> {
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<Au> {
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<Au> {
}
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<webrender_traits::FilterOp>;
fn to_filter_ops(&self) -> Vec<webrender_api::FilterOp>;
}
impl ToFilterOps for Vec<Filter> {
fn to_filter_ops(&self) -> Vec<webrender_traits::FilterOp> {
fn to_filter_ops(&self) -> Vec<webrender_api::FilterOp> {
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<Filter> {
}
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<ComplexClipRegion>;
}
impl ToWebRenderClip for ClippingRegion {
fn get_complex_clips(&self) -> Vec<ComplexClipRegion> {
self.complex.iter().map(|complex_clipping_region| {
ComplexClipRegion::new(
complex_clipping_region.rect.to_rectf(),
complex_clipping_region.radii.to_border_radius(),
)
}).collect()
}
}

Просмотреть файл

@ -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"]}

Просмотреть файл

@ -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<RwLock<FnvHashMap<Atom, RegisteredPainter>>>,
/// 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<IpcSender<()>>,
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;
}

Просмотреть файл

@ -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"]}

Просмотреть файл

@ -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<IpcSender<()>>,
webrender_api_sender: webrender_traits::RenderApiSender,
webrender_api_sender: webrender_api::RenderApiSender,
layout_threads: usize);
}

Просмотреть файл

@ -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"]}

Просмотреть файл

@ -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())
}
}

Просмотреть файл

@ -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;

Просмотреть файл

@ -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"

Просмотреть файл

@ -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<Arc<Image>> {
fn get_placeholder_image(webrender_api: &webrender_api::RenderApi, path: &PathBuf) -> io::Result<Arc<Image>> {
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.");

Просмотреть файл

@ -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;

Просмотреть файл

@ -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"]}

Просмотреть файл

@ -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<webrender_traits::ImageKey>,
#[ignore_heap_size_of = "Defined in webrender_api"]
pub id: Option<webrender_api::ImageKey>,
}
impl fmt::Debug for Image {

Просмотреть файл

@ -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,

Просмотреть файл

@ -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;

Просмотреть файл

@ -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"}

Просмотреть файл

@ -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.

Просмотреть файл

@ -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.

Просмотреть файл

@ -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]

Просмотреть файл

@ -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<Root<WebGLVertexArrayObjectOES>> {
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();

Просмотреть файл

@ -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 {

Просмотреть файл

@ -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.

Просмотреть файл

@ -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)]

Просмотреть файл

@ -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<CanvasMsg>)
-> Option<Root<WebGLBuffer>> {
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();

Просмотреть файл

@ -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<CanvasMsg>)
-> Option<Root<WebGLFramebuffer>> {
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();

Просмотреть файл

@ -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<CanvasMsg>)
-> Option<Root<WebGLProgram>> {
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<WebGLParameter> {
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()
}

Просмотреть файл

@ -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<CanvasMsg>)
-> Option<Root<WebGLRenderbuffer>> {
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();

Просмотреть файл

@ -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<u8>, Size2D<i32>, 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<HTMLCanvasElement>,
#[ignore_heap_size_of = "Defined in webrender_traits"]
#[ignore_heap_size_of = "Defined in webrender_api"]
last_error: Cell<Option<WebGLError>>,
texture_unpacking_settings: Cell<TextureUnpacking>,
texture_unpacking_alignment: Cell<u32>,
@ -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<WebGLContextAttributes> {
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<Root<WebGLShaderPrecisionFormat>> {
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();

Просмотреть файл

@ -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<CanvasMsg>,
shader_type: u32)
-> Option<Root<WebGLShader>> {
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<WebGLParameter> {
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()
}

Просмотреть файл

@ -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<CanvasMsg>)
-> Option<Root<WebGLTexture>> {
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();

Просмотреть файл

@ -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 {

Просмотреть файл

@ -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

Просмотреть файл

@ -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;

Просмотреть файл

@ -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"]}

Просмотреть файл

@ -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;

Просмотреть файл

@ -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.
///

Просмотреть файл

@ -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<T> {

Просмотреть файл

@ -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"}

Просмотреть файл

@ -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};

Просмотреть файл

@ -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)]

Просмотреть файл

@ -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"}

Просмотреть файл

@ -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<Window> Browser<Window> 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<Sender<devtools_traits::DevtoolsControlMsg>>,
supports_clipboard: bool,
webrender: &webrender::Renderer,
webrender_api_sender: webrender_traits::RenderApiSender)
webrender_api_sender: webrender_api::RenderApiSender)
-> (Sender<ConstellationMsg>, SWManagerSenders) {
let bluetooth_thread: IpcSender<BluetoothRequest> = BluetoothThreadFactory::new();

Просмотреть файл

@ -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);

Просмотреть файл

@ -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"]}

Просмотреть файл

@ -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;

Просмотреть файл

@ -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<webrender_traits::VRCompositorId, WebVRCompositor>,
compositors: HashMap<webrender_api::VRCompositorId, WebVRCompositor>,
webvr_thread_receiver: Receiver<Option<WebVRCompositor>>,
webvr_thread_sender: Option<IpcSender<WebVRMsg>>
}
@ -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,

Просмотреть файл

@ -112,4 +112,4 @@
* <https://github.com/servo/rust-selectors/>: a CSS selector matching library
* <https://github.com/cyderize/rust-websocket/>: a WebSocket protocol implementation
* <https://github.com/servo/rust-url/>: an implementation of the URL specification
* <https://github.com/servo/webrender/> and <https://github.com/servo/webrender_traits/>: a GPU renderer
* <https://github.com/servo/webrender/>: a GPU renderer

Просмотреть файл

@ -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"

Просмотреть файл

@ -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};

Просмотреть файл

@ -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;

Просмотреть файл

@ -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"

Просмотреть файл

@ -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;

Просмотреть файл

@ -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;

Просмотреть файл

@ -64,5 +64,5 @@ licenses_dep_toml = [
'name = "servo-freetype-sys"',
'name = "simd"',
'name = "webrender"',
'name = "webrender_traits"',
'name = "webrender_api"',
]

Просмотреть файл

@ -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"]