diff options
author | Nicolas Silva <nical@fastmail.com> | 2017-06-02 14:50:26 +0200 |
---|---|---|
committer | Nicolas Silva <nical@fastmail.com> | 2017-06-14 16:00:59 +0200 |
commit | 8617320500491fab91979404cec2087bac7ef362 (patch) | |
tree | 7db5b5b5a17fb59bb727a2a59ba27f351d01fb90 | |
parent | 5dce166266d1f74e2ae88dbe52ca5ced75c2349b (diff) | |
download | servo-8617320500491fab91979404cec2087bac7ef362.tar.gz servo-8617320500491fab91979404cec2087bac7ef362.zip |
Bump euclid to 0.14.
88 files changed, 349 insertions, 381 deletions
diff --git a/Cargo.lock b/Cargo.lock index 07cc363059a..ac776f9f55f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -109,19 +109,19 @@ dependencies = [ [[package]] name = "azure" -version = "0.16.0" -source = "git+https://github.com/servo/rust-azure#9db3ca5dde15c16f3a9b84c9099797a3f1a2eb00" +version = "0.17.0" +source = "git+https://github.com/servo/rust-azure#3944a65fd2a3790c85e3770d5130e1b4ab153b68" 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.7.0 (registry+https://github.com/rust-lang/crates.io-index)", "core-text 4.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "euclid 0.13.0 (registry+https://github.com/rust-lang/crates.io-index)", + "euclid 0.14.4 (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)", "servo-freetype-sys 4.0.3 (registry+https://github.com/rust-lang/crates.io-index)", - "servo-skia 0.30000004.3 (registry+https://github.com/rust-lang/crates.io-index)", + "servo-skia 0.30000005.3 (registry+https://github.com/rust-lang/crates.io-index)", "x11 2.14.0 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -312,15 +312,15 @@ source = "registry+https://github.com/rust-lang/crates.io-index" name = "canvas" version = "0.0.1" dependencies = [ - "azure 0.16.0 (git+https://github.com/servo/rust-azure)", + "azure 0.17.0 (git+https://github.com/servo/rust-azure)", "canvas_traits 0.0.1", "cssparser 0.14.0 (registry+https://github.com/rust-lang/crates.io-index)", - "euclid 0.13.0 (registry+https://github.com/rust-lang/crates.io-index)", + "euclid 0.14.4 (registry+https://github.com/rust-lang/crates.io-index)", "gleam 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", "ipc-channel 0.7.2 (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.8.10 (registry+https://github.com/rust-lang/crates.io-index)", + "offscreen_gl_context 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", "servo_config 0.0.1", "webrender_traits 0.40.0 (git+https://github.com/servo/webrender)", ] @@ -330,7 +330,7 @@ name = "canvas_traits" version = "0.0.1" dependencies = [ "cssparser 0.14.0 (registry+https://github.com/rust-lang/crates.io-index)", - "euclid 0.13.0 (registry+https://github.com/rust-lang/crates.io-index)", + "euclid 0.14.4 (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.7.2 (registry+https://github.com/rust-lang/crates.io-index)", @@ -463,7 +463,7 @@ dependencies = [ name = "compositing" version = "0.0.1" dependencies = [ - "euclid 0.13.0 (registry+https://github.com/rust-lang/crates.io-index)", + "euclid 0.14.4 (registry+https://github.com/rust-lang/crates.io-index)", "gfx_traits 0.0.1", "gleam 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", "image 0.12.4 (registry+https://github.com/rust-lang/crates.io-index)", @@ -494,7 +494,7 @@ dependencies = [ "compositing 0.0.1", "debugger 0.0.1", "devtools_traits 0.0.1", - "euclid 0.13.0 (registry+https://github.com/rust-lang/crates.io-index)", + "euclid 0.14.4 (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", @@ -506,7 +506,7 @@ dependencies = [ "msg 0.0.1", "net 0.0.1", "net_traits 0.0.1", - "offscreen_gl_context 0.8.10 (registry+https://github.com/rust-lang/crates.io-index)", + "offscreen_gl_context 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", "profile_traits 0.0.1", "script_traits 0.0.1", "serde 0.9.15 (registry+https://github.com/rust-lang/crates.io-index)", @@ -574,7 +574,7 @@ dependencies = [ "heapsize 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "matches 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", "phf 0.7.21 (registry+https://github.com/rust-lang/crates.io-index)", - "procedural-masquerade 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", + "procedural-masquerade 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "quote 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)", "serde 0.9.15 (registry+https://github.com/rust-lang/crates.io-index)", "syn 0.11.11 (registry+https://github.com/rust-lang/crates.io-index)", @@ -586,7 +586,7 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "phf_codegen 0.7.21 (registry+https://github.com/rust-lang/crates.io-index)", - "procedural-masquerade 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", + "procedural-masquerade 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "quote 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)", "syn 0.11.11 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -748,7 +748,7 @@ dependencies = [ "cocoa 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)", "compositing 0.0.1", "devtools 0.0.1", - "euclid 0.13.0 (registry+https://github.com/rust-lang/crates.io-index)", + "euclid 0.14.4 (registry+https://github.com/rust-lang/crates.io-index)", "gleam 0.4.5 (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)", @@ -897,13 +897,12 @@ dependencies = [ [[package]] name = "euclid" -version = "0.13.0" +version = "0.14.4" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "heapsize 0.4.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)", - "rustc-serialize 0.3.24 (registry+https://github.com/rust-lang/crates.io-index)", "serde 0.9.15 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1033,7 +1032,7 @@ dependencies = [ "core-graphics 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", "core-text 4.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "dwrote 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", - "euclid 0.13.0 (registry+https://github.com/rust-lang/crates.io-index)", + "euclid 0.14.4 (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)", @@ -1128,7 +1127,7 @@ version = "0.0.1" dependencies = [ "bitflags 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", "compositing 0.0.1", - "euclid 0.13.0 (registry+https://github.com/rust-lang/crates.io-index)", + "euclid 0.14.4 (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.5 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1419,7 +1418,7 @@ dependencies = [ "atomic_refcell 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "bitflags 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", "canvas_traits 0.0.1", - "euclid 0.13.0 (registry+https://github.com/rust-lang/crates.io-index)", + "euclid 0.14.4 (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", @@ -1465,7 +1464,7 @@ name = "layout_thread" version = "0.0.1" dependencies = [ "app_units 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", - "euclid 0.13.0 (registry+https://github.com/rust-lang/crates.io-index)", + "euclid 0.14.4 (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", @@ -1559,7 +1558,7 @@ 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.13.0 (registry+https://github.com/rust-lang/crates.io-index)", + "euclid 0.14.4 (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.5 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1946,12 +1945,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "offscreen_gl_context" -version = "0.8.10" +version = "0.9.0" 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.13.0 (registry+https://github.com/rust-lang/crates.io-index)", + "euclid 0.14.4 (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.5 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2121,11 +2120,11 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "plane-split" -version = "0.4.0" +version = "0.5.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.13.0 (registry+https://github.com/rust-lang/crates.io-index)", + "euclid 0.14.4 (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)", ] @@ -2158,7 +2157,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "procedural-masquerade" -version = "0.1.2" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] @@ -2377,7 +2376,7 @@ 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.13.0 (registry+https://github.com/rust-lang/crates.io-index)", + "euclid 0.14.4 (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.5 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2399,7 +2398,7 @@ dependencies = [ "msg 0.0.1", "net_traits 0.0.1", "num-traits 0.1.37 (registry+https://github.com/rust-lang/crates.io-index)", - "offscreen_gl_context 0.8.10 (registry+https://github.com/rust-lang/crates.io-index)", + "offscreen_gl_context 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", "open 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "parking_lot 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", "phf 0.7.21 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2445,7 +2444,7 @@ dependencies = [ "atomic_refcell 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "canvas_traits 0.0.1", "cssparser 0.14.0 (registry+https://github.com/rust-lang/crates.io-index)", - "euclid 0.13.0 (registry+https://github.com/rust-lang/crates.io-index)", + "euclid 0.14.4 (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)", @@ -2472,7 +2471,7 @@ version = "0.0.1" name = "script_tests" version = "0.0.1" dependencies = [ - "euclid 0.13.0 (registry+https://github.com/rust-lang/crates.io-index)", + "euclid 0.14.4 (registry+https://github.com/rust-lang/crates.io-index)", "msg 0.0.1", "script 0.0.1", "servo_url 0.0.1", @@ -2487,7 +2486,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.13.0 (registry+https://github.com/rust-lang/crates.io-index)", + "euclid 0.14.4 (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)", @@ -2497,7 +2496,7 @@ dependencies = [ "libc 0.2.23 (registry+https://github.com/rust-lang/crates.io-index)", "msg 0.0.1", "net_traits 0.0.1", - "offscreen_gl_context 0.8.10 (registry+https://github.com/rust-lang/crates.io-index)", + "offscreen_gl_context 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", "profile_traits 0.0.1", "rustc-serialize 0.3.24 (registry+https://github.com/rust-lang/crates.io-index)", "serde 0.9.15 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2655,12 +2654,12 @@ dependencies = [ [[package]] name = "servo-skia" -version = "0.30000004.3" +version = "0.30000005.3" 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.13.0 (registry+https://github.com/rust-lang/crates.io-index)", + "euclid 0.14.4 (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.5 (registry+https://github.com/rust-lang/crates.io-index)", "glx 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2712,7 +2711,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.13.0 (registry+https://github.com/rust-lang/crates.io-index)", + "euclid 0.14.4 (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)", @@ -2738,7 +2737,7 @@ name = "servo_geometry" version = "0.0.1" dependencies = [ "app_units 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", - "euclid 0.13.0 (registry+https://github.com/rust-lang/crates.io-index)", + "euclid 0.14.4 (registry+https://github.com/rust-lang/crates.io-index)", "heapsize 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -2900,7 +2899,7 @@ dependencies = [ "cfg-if 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "cssparser 0.14.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.13.0 (registry+https://github.com/rust-lang/crates.io-index)", + "euclid 0.14.4 (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)", @@ -2953,7 +2952,7 @@ dependencies = [ "app_units 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", "byteorder 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "cssparser 0.14.0 (registry+https://github.com/rust-lang/crates.io-index)", - "euclid 0.13.0 (registry+https://github.com/rust-lang/crates.io-index)", + "euclid 0.14.4 (registry+https://github.com/rust-lang/crates.io-index)", "html5ever 0.17.0 (registry+https://github.com/rust-lang/crates.io-index)", "parking_lot 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", "rayon 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2974,7 +2973,7 @@ dependencies = [ "app_units 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", "bitflags 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", "cssparser 0.14.0 (registry+https://github.com/rust-lang/crates.io-index)", - "euclid 0.13.0 (registry+https://github.com/rust-lang/crates.io-index)", + "euclid 0.14.4 (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", @@ -2989,7 +2988,7 @@ dependencies = [ "atomic_refcell 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "cssparser 0.14.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.13.0 (registry+https://github.com/rust-lang/crates.io-index)", + "euclid 0.14.4 (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)", @@ -3333,7 +3332,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.13.0 (registry+https://github.com/rust-lang/crates.io-index)", + "euclid 0.14.4 (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.7.2 (registry+https://github.com/rust-lang/crates.io-index)", @@ -3353,7 +3352,7 @@ dependencies = [ [[package]] name = "webrender" version = "0.40.0" -source = "git+https://github.com/servo/webrender#caec344131e53c13b022feedbf9d5e04054232c3" +source = "git+https://github.com/servo/webrender#faed91dd24e695b8c7c555ef3398d0ba8fd165dc" dependencies = [ "app_units 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", "bincode 1.0.0-alpha6 (registry+https://github.com/rust-lang/crates.io-index)", @@ -3363,7 +3362,7 @@ dependencies = [ "core-graphics 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", "core-text 4.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "dwrote 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", - "euclid 0.13.0 (registry+https://github.com/rust-lang/crates.io-index)", + "euclid 0.14.4 (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)", @@ -3371,8 +3370,8 @@ dependencies = [ "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)", - "offscreen_gl_context 0.8.10 (registry+https://github.com/rust-lang/crates.io-index)", - "plane-split 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "offscreen_gl_context 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", + "plane-split 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", "rayon 0.7.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)", @@ -3382,7 +3381,7 @@ dependencies = [ [[package]] name = "webrender_traits" version = "0.40.0" -source = "git+https://github.com/servo/webrender#caec344131e53c13b022feedbf9d5e04054232c3" +source = "git+https://github.com/servo/webrender#faed91dd24e695b8c7c555ef3398d0ba8fd165dc" dependencies = [ "app_units 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", "bincode 1.0.0-alpha6 (registry+https://github.com/rust-lang/crates.io-index)", @@ -3390,11 +3389,11 @@ dependencies = [ "core-foundation 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "core-graphics 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", "dwrote 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", - "euclid 0.13.0 (registry+https://github.com/rust-lang/crates.io-index)", + "euclid 0.14.4 (registry+https://github.com/rust-lang/crates.io-index)", "gleam 0.4.5 (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.7.2 (registry+https://github.com/rust-lang/crates.io-index)", - "offscreen_gl_context 0.8.10 (registry+https://github.com/rust-lang/crates.io-index)", + "offscreen_gl_context 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", "serde 0.9.15 (registry+https://github.com/rust-lang/crates.io-index)", "serde_derive 0.9.15 (registry+https://github.com/rust-lang/crates.io-index)", "time 0.1.37 (registry+https://github.com/rust-lang/crates.io-index)", @@ -3528,7 +3527,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.16.0 (git+https://github.com/servo/rust-azure)" = "<none>" +"checksum azure 0.17.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" @@ -3595,7 +3594,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.13.0 (registry+https://github.com/rust-lang/crates.io-index)" = "6083f113c422ff9cd855a1cf6cc8ec0903606c0eb43a0c6a0ced3bdc9731e4c1" +"checksum euclid 0.14.4 (registry+https://github.com/rust-lang/crates.io-index)" = "995b21c36b37e0f18ed9ba1714378a337e3ff19a6e5e952ea94b0f3dd4e12fbc" "checksum expat-sys 2.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "cef36cd1a8a02d28b91d97347c63247b9e4cb8a8e36df36f8201dc87a1c0859c" "checksum flate2 0.2.19 (registry+https://github.com/rust-lang/crates.io-index)" = "36df0166e856739905cd3d7e0b210fe818592211a008862599845e012d8d304c" "checksum fnv 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)" = "6cc484842f1e2884faf56f529f960cc12ad8c71ce96cc7abba0a067c98fee344" @@ -3675,7 +3674,7 @@ dependencies = [ "checksum objc-foundation 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "1add1b659e36c9607c7aab864a76c7a4c2760cd0cd2e120f3fb8b952c7e22bf9" "checksum objc_id 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e4730aa1c64d722db45f7ccc4113a3e2c465d018de6db4d3e7dfe031e8c8a297" "checksum odds 0.2.25 (registry+https://github.com/rust-lang/crates.io-index)" = "c3df9b730298cea3a1c3faa90b7e2f9df3a9c400d0936d6015e6165734eefcba" -"checksum offscreen_gl_context 0.8.10 (registry+https://github.com/rust-lang/crates.io-index)" = "848e08e715273079e73c5538632bb3bf84aadcb9e754fcf690da1b054889770b" +"checksum offscreen_gl_context 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "0f2b1feeb87a68541c96e07b8b81a3fef0057b026b5f691b4489852811e76804" "checksum ogg 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7137bf02687385302f4c0aecd77cfce052b69f5b4ee937be778e125c62f67e30" "checksum ogg_metadata 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "fc665717454399cba557c55ad226148996e9266ee291f8a37a98bb2cded0a490" "checksum open 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3478ed1686bd1300c8a981a940abc92b06fac9cbef747f4c668d4e032ff7b842" @@ -3695,10 +3694,10 @@ dependencies = [ "checksum phf_generator 0.7.21 (registry+https://github.com/rust-lang/crates.io-index)" = "6b07ffcc532ccc85e3afc45865469bf5d9e4ef5bfcf9622e3cfe80c2d275ec03" "checksum phf_shared 0.7.21 (registry+https://github.com/rust-lang/crates.io-index)" = "07e24b0ca9643bdecd0632f2b3da6b1b89bbb0030e0b992afc1113b23a7bc2f2" "checksum pkg-config 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)" = "3a8b4c6b8165cd1a1cd4b9b120978131389f64bdaf456435caa41e630edba903" -"checksum plane-split 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "556929ef77bf07a9f8584d21382bcebcd6e6f5845d311824d369e1df7cf56d54" +"checksum plane-split 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "da4c13e9ba1388fd628ec2bcd69f3346dec64357e9b552601b244f92189d4610" "checksum png 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)" = "3cb773e9a557edb568ce9935cf783e3cdcabe06a9449d41b3e5506d88e582c82" "checksum precomputed-hash 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "cdf1fc3616b3ef726a847f2cd2388c646ef6a1f1ba4835c2629004da48184150" -"checksum procedural-masquerade 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "c93cdc1fb30af9ddf3debc4afbdb0f35126cbd99daa229dd76cdd5349b41d989" +"checksum procedural-masquerade 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "9f566249236c6ca4340f7ca78968271f0ed2b0f234007a61b66f9ecd0af09260" "checksum pulldown-cmark 0.0.8 (registry+https://github.com/rust-lang/crates.io-index)" = "1058d7bb927ca067656537eec4e02c2b4b70eaaa129664c5b90c111e20326f41" "checksum quasi 0.32.0 (registry+https://github.com/rust-lang/crates.io-index)" = "18c45c4854d6d1cf5d531db97c75880feb91c958b0720f4ec1057135fec358b3" "checksum quasi_codegen 0.32.0 (registry+https://github.com/rust-lang/crates.io-index)" = "51b9e25fa23c044c1803f43ca59c98dac608976dd04ce799411edd58ece776d4" @@ -3727,7 +3726,7 @@ dependencies = [ "checksum servo-fontconfig-sys 4.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "6be80777ee6edecbbbf8774c76e19dddfe336256c57a4ded06d6ad3df7be358e" "checksum servo-freetype-sys 4.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "9232032c2e85118c0282c6562c84cab12316e655491ba0a5d1905b2320060d1b" "checksum servo-glutin 0.10.2 (registry+https://github.com/rust-lang/crates.io-index)" = "8398095f9b3dc3c6d706d395e192624be1f1bcc6f366b009fe17a20cb5dd3d72" -"checksum servo-skia 0.30000004.3 (registry+https://github.com/rust-lang/crates.io-index)" = "109e567850bad212ee98ed9651e256de862bd9764476f2b16355af5f6ef59cfe" +"checksum servo-skia 0.30000005.3 (registry+https://github.com/rust-lang/crates.io-index)" = "3047c224334358fd376b04b83454a7e9f5473c131c3e24db156a99251e495e3c" "checksum servo-websocket 0.19.1 (registry+https://github.com/rust-lang/crates.io-index)" = "8a1ff13c5d852c2793805226e688044309f2c1d8f063784805a13e99cb75b611" "checksum sha1 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "cc30b1e1e8c40c121ca33b86c23308a090d19974ef001b4bf6e61fd1a0fb095c" "checksum shared_library 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "fb04126b6fcfd2710fb5b6d18f4207b6c535f2850a7e1a43bcd526d44f30a79a" diff --git a/components/canvas/Cargo.toml b/components/canvas/Cargo.toml index 439064f31a1..2e5d1f662f6 100644 --- a/components/canvas/Cargo.toml +++ b/components/canvas/Cargo.toml @@ -13,11 +13,11 @@ path = "lib.rs" azure = {git = "https://github.com/servo/rust-azure"} canvas_traits = {path = "../canvas_traits"} cssparser = "0.14.0" -euclid = "0.13" +euclid = "0.14.4" gleam = "0.4" ipc-channel = "0.7" log = "0.3.5" num-traits = "0.1.32" -offscreen_gl_context = "0.8" +offscreen_gl_context = { version = "0.9", features = ["serde"] } servo_config = {path = "../config"} webrender_traits = {git = "https://github.com/servo/webrender", features = ["ipc"]} diff --git a/components/canvas/canvas_paint_thread.rs b/components/canvas/canvas_paint_thread.rs index b6360c638f9..94a235d78ce 100644 --- a/components/canvas/canvas_paint_thread.rs +++ b/components/canvas/canvas_paint_thread.rs @@ -10,10 +10,7 @@ use azure::azure_hl::{ExtendMode, GradientStop, LinearGradientPattern, RadialGra use azure::azure_hl::SurfacePattern; use canvas_traits::*; use cssparser::RGBA; -use euclid::matrix2d::Matrix2D; -use euclid::point::Point2D; -use euclid::rect::Rect; -use euclid::size::Size2D; +use euclid::{Transform2D, Point2D, Vector2D, Rect, Size2D}; use ipc_channel::ipc::{self, IpcSender}; use num_traits::ToPrimitive; use std::borrow::ToOwned; @@ -71,7 +68,7 @@ struct CanvasPaintState<'a> { stroke_style: Pattern, stroke_opts: StrokeOptions<'a>, /// The current 2D transform matrix. - transform: Matrix2D<f32>, + transform: Transform2D<f32>, shadow_offset_x: f64, shadow_offset_y: f64, shadow_blur: f64, @@ -91,7 +88,7 @@ impl<'a> CanvasPaintState<'a> { fill_style: Pattern::Color(ColorPattern::new(Color::black())), stroke_style: Pattern::Color(ColorPattern::new(Color::black())), stroke_opts: StrokeOptions::new(1.0, JoinStyle::MiterOrBevel, CapStyle::Butt, 10.0, &[]), - transform: Matrix2D::identity(), + transform: Transform2D::identity(), shadow_offset_x: 0.0, shadow_offset_y: 0.0, shadow_blur: 0.0, @@ -528,7 +525,7 @@ impl<'a> CanvasPaintThread<'a> { self.state.stroke_opts.miter_limit = limit; } - fn set_transform(&mut self, transform: &Matrix2D<f32>) { + fn set_transform(&mut self, transform: &Transform2D<f32>) { self.state.transform = transform.clone(); self.drawtarget.set_transform(transform) } @@ -606,7 +603,7 @@ impl<'a> CanvasPaintThread<'a> { // https://html.spec.whatwg.org/multipage/#dom-context-2d-putimagedata fn put_image_data(&mut self, imagedata: Vec<u8>, - offset: Point2D<f64>, + offset: Vector2D<f64>, image_data_size: Size2D<f64>, mut dirty_rect: Rect<f64>) { if image_data_size.width <= 0.0 || image_data_size.height <= 0.0 { @@ -720,9 +717,8 @@ impl<'a> CanvasPaintThread<'a> { let draw_target = self.drawtarget.create_similar_draw_target(&Size2D::new(source_rect.size.width as i32, source_rect.size.height as i32), self.drawtarget.get_format()); - let matrix = Matrix2D::identity() - .pre_translated(-source_rect.origin.x as AzFloat, - -source_rect.origin.y as AzFloat) + let matrix = Transform2D::identity() + .pre_translate(-source_rect.origin.to_vector().cast().unwrap()) .pre_mul(&self.state.transform); draw_target.set_transform(&matrix); draw_target @@ -738,8 +734,8 @@ impl<'a> CanvasPaintThread<'a> { &Point2D::new(shadow_src_rect.origin.x as AzFloat, shadow_src_rect.origin.y as AzFloat), &self.state.shadow_color, - &Point2D::new(self.state.shadow_offset_x as AzFloat, - self.state.shadow_offset_y as AzFloat), + &Vector2D::new(self.state.shadow_offset_x as AzFloat, + self.state.shadow_offset_y as AzFloat), (self.state.shadow_blur / 2.0f64) as AzFloat, self.state.draw_options.composition); } @@ -1001,7 +997,7 @@ impl ToAzurePattern for FillOrStrokeStyle { &Point2D::new(linear_gradient_style.x0 as AzFloat, linear_gradient_style.y0 as AzFloat), &Point2D::new(linear_gradient_style.x1 as AzFloat, linear_gradient_style.y1 as AzFloat), drawtarget.create_gradient_stops(&gradient_stops, ExtendMode::Clamp), - &Matrix2D::identity()))) + &Transform2D::identity()))) }, FillOrStrokeStyle::RadialGradient(ref radial_gradient_style) => { let gradient_stops: Vec<GradientStop> = radial_gradient_style.stops.iter().map(|s| { @@ -1016,7 +1012,7 @@ impl ToAzurePattern for FillOrStrokeStyle { &Point2D::new(radial_gradient_style.x1 as AzFloat, radial_gradient_style.y1 as AzFloat), radial_gradient_style.r0 as AzFloat, radial_gradient_style.r1 as AzFloat, drawtarget.create_gradient_stops(&gradient_stops, ExtendMode::Clamp), - &Matrix2D::identity()))) + &Transform2D::identity()))) }, FillOrStrokeStyle::Surface(ref surface_style) => { drawtarget.create_source_surface_from_data(&surface_style.surface_data, @@ -1028,7 +1024,7 @@ impl ToAzurePattern for FillOrStrokeStyle { source_surface.azure_source_surface, surface_style.repeat_x, surface_style.repeat_y, - &Matrix2D::identity())) + &Transform2D::identity())) }) } } diff --git a/components/canvas/webgl_paint_thread.rs b/components/canvas/webgl_paint_thread.rs index feabaed7d2a..db509945100 100644 --- a/components/canvas/webgl_paint_thread.rs +++ b/components/canvas/webgl_paint_thread.rs @@ -4,7 +4,7 @@ use canvas_traits::{CanvasCommonMsg, CanvasData, CanvasMsg, CanvasImageData}; use canvas_traits::{FromLayoutMsg, FromScriptMsg, byte_swap}; -use euclid::size::Size2D; +use euclid::Size2D; use gleam::gl; use ipc_channel::ipc::{self, IpcSender}; use offscreen_gl_context::{ColorAttachmentType, GLContext, GLLimits}; diff --git a/components/canvas_traits/Cargo.toml b/components/canvas_traits/Cargo.toml index 3b1c3a0ff02..81f463ae2aa 100644 --- a/components/canvas_traits/Cargo.toml +++ b/components/canvas_traits/Cargo.toml @@ -11,7 +11,7 @@ path = "lib.rs" [dependencies] cssparser = "0.14.0" -euclid = "0.13" +euclid = "0.14.4" heapsize = "0.4" heapsize_derive = "0.1" ipc-channel = "0.7" diff --git a/components/canvas_traits/lib.rs b/components/canvas_traits/lib.rs index 3d74b84f475..3a143001d10 100644 --- a/components/canvas_traits/lib.rs +++ b/components/canvas_traits/lib.rs @@ -16,10 +16,7 @@ extern crate ipc_channel; extern crate webrender_traits; use cssparser::RGBA; -use euclid::matrix2d::Matrix2D; -use euclid::point::Point2D; -use euclid::rect::Rect; -use euclid::size::Size2D; +use euclid::{Transform2D, Point2D, Vector2D, Rect, Size2D}; use ipc_channel::ipc::IpcSender; use std::default::Default; use std::str::FromStr; @@ -87,7 +84,7 @@ pub enum Canvas2dMsg { IsPointInPath(f64, f64, FillRule, IpcSender<bool>), LineTo(Point2D<f32>), MoveTo(Point2D<f32>), - PutImageData(Vec<u8>, Point2D<f64>, Size2D<f64>, Rect<f64>), + PutImageData(Vec<u8>, Vector2D<f64>, Size2D<f64>, Rect<f64>), QuadraticCurveTo(Point2D<f32>, Point2D<f32>), Rect(Rect<f32>), RestoreContext, @@ -102,7 +99,7 @@ pub enum Canvas2dMsg { SetMiterLimit(f32), SetGlobalAlpha(f32), SetGlobalComposition(CompositionOrBlending), - SetTransform(Matrix2D<f32>), + SetTransform(Transform2D<f32>), SetShadowOffsetX(f64), SetShadowOffsetY(f64), SetShadowBlur(f64), diff --git a/components/compositing/Cargo.toml b/components/compositing/Cargo.toml index aa8ad1bb6bf..3f2c1b87621 100644 --- a/components/compositing/Cargo.toml +++ b/components/compositing/Cargo.toml @@ -10,7 +10,7 @@ name = "compositing" path = "lib.rs" [dependencies] -euclid = "0.13" +euclid = "0.14" gfx_traits = {path = "../gfx_traits"} gleam = "0.4" image = "0.12" diff --git a/components/compositing/compositor.rs b/components/compositing/compositor.rs index 1baa297f191..5cb72fce030 100644 --- a/components/compositing/compositor.rs +++ b/components/compositing/compositor.rs @@ -7,11 +7,7 @@ use SendableFrameTree; use compositor_thread::{CompositorProxy, CompositorReceiver}; use compositor_thread::{InitialCompositorState, Msg, RenderListener}; use delayed_composition::DelayedCompositionTimerProxy; -use euclid::Point2D; -use euclid::point::TypedPoint2D; -use euclid::rect::TypedRect; -use euclid::scale_factor::ScaleFactor; -use euclid::size::TypedSize2D; +use euclid::{Point2D, TypedPoint2D, TypedVector2D, TypedRect, ScaleFactor, TypedSize2D}; use gfx_traits::Epoch; use gleam::gl; use image::{DynamicImage, ImageFormat, RgbImage}; @@ -39,7 +35,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, ScrollEventPhase, ScrollLocation, ScrollClamping}; +use webrender_traits::{self, ClipId, LayoutPoint, LayoutVector2D, ScrollEventPhase, ScrollLocation, ScrollClamping}; use windowing::{self, MouseWindowEvent, WindowEvent, WindowMethods, WindowNavigateMsg}; #[derive(Debug, PartialEq)] @@ -1009,10 +1005,12 @@ impl<Window: WindowMethods> IOCompositor<Window> { match self.touch_handler.on_touch_move(identifier, point) { TouchAction::Scroll(delta) => { match point.cast() { - Some(point) => self.on_scroll_window_event(ScrollLocation::Delta( - webrender_traits::LayerPoint::from_untyped( - &delta.to_untyped())), - point), + Some(point) => self.on_scroll_window_event( + ScrollLocation::Delta( + LayoutVector2D::from_untyped(&delta.to_untyped()) + ), + point + ), None => error!("Point cast failed."), } } @@ -1020,7 +1018,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::LayerPoint::from_untyped( + scroll_location: ScrollLocation::Delta(webrender_traits::LayoutVector2D::from_untyped( &scroll_delta.to_untyped())), cursor: cursor, phase: ScrollEventPhase::Move(true), @@ -1155,9 +1153,9 @@ impl<Window: WindowMethods> IOCompositor<Window> { break; } }; - let delta = (TypedPoint2D::from_untyped(&combined_delta.to_untyped()) / self.scale) - .to_untyped(); - let delta = webrender_traits::LayerPoint::from_untyped(&delta); + // TODO: units don't match! + let delta = combined_delta / self.scale.get(); + let cursor = (combined_event.cursor.to_f32() / self.scale).to_untyped(); let location = webrender_traits::ScrollLocation::Delta(delta); @@ -1171,7 +1169,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::LayerPoint::from_untyped( + scroll_location: ScrollLocation::Delta(webrender_traits::LayoutVector2D::from_untyped( &this_delta.to_untyped())), cursor: this_cursor, phase: scroll_event.phase, @@ -1208,9 +1206,9 @@ impl<Window: WindowMethods> IOCompositor<Window> { if let Some(combined_event) = last_combined_event { let scroll_location = match combined_event.scroll_location { ScrollLocation::Delta(delta) => { - let scaled_delta = (TypedPoint2D::from_untyped(&delta.to_untyped()) / self.scale) + let scaled_delta = (TypedVector2D::from_untyped(&delta.to_untyped()) / self.scale) .to_untyped(); - let calculated_delta = webrender_traits::LayoutPoint::from_untyped(&scaled_delta); + let calculated_delta = webrender_traits::LayoutVector2D::from_untyped(&scaled_delta); ScrollLocation::Delta(calculated_delta) }, // Leave ScrollLocation unchanged if it is Start or End location. @@ -1318,7 +1316,7 @@ impl<Window: WindowMethods> IOCompositor<Window> { fn on_pinch_zoom_window_event(&mut self, magnification: f32) { self.pending_scroll_zoom_events.push(ScrollZoomEvent { magnification: magnification, - scroll_location: ScrollLocation::Delta(TypedPoint2D::zero()), // TODO: Scroll to keep the center in view? + scroll_location: ScrollLocation::Delta(TypedVector2D::zero()), // TODO: Scroll to keep the center in view? cursor: TypedPoint2D::new(-1, -1), // Make sure this hits the base layer. phase: ScrollEventPhase::Move(true), event_count: 1, diff --git a/components/compositing/compositor_thread.rs b/components/compositing/compositor_thread.rs index 53706ae4483..4ff18471ea8 100644 --- a/components/compositing/compositor_thread.rs +++ b/components/compositing/compositor_thread.rs @@ -6,8 +6,7 @@ use SendableFrameTree; use compositor::CompositingReason; -use euclid::point::Point2D; -use euclid::size::Size2D; +use euclid::{Point2D, Size2D}; use ipc_channel::ipc::IpcSender; use msg::constellation_msg::{Key, KeyModifiers, KeyState, PipelineId}; use net_traits::image::base::Image; diff --git a/components/compositing/lib.rs b/components/compositing/lib.rs index e4307ff04cc..a11c444609b 100644 --- a/components/compositing/lib.rs +++ b/components/compositing/lib.rs @@ -26,7 +26,7 @@ extern crate webrender_traits; pub use compositor_thread::CompositorProxy; pub use compositor::IOCompositor; -use euclid::size::TypedSize2D; +use euclid::TypedSize2D; use ipc_channel::ipc::IpcSender; use msg::constellation_msg::PipelineId; use msg::constellation_msg::TopLevelBrowsingContextId; diff --git a/components/compositing/touch.rs b/components/compositing/touch.rs index 12bc365c77f..1edafa017c8 100644 --- a/components/compositing/touch.rs +++ b/components/compositing/touch.rs @@ -2,8 +2,8 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -use euclid::point::TypedPoint2D; -use euclid::scale_factor::ScaleFactor; +use euclid::{TypedPoint2D, TypedVector2D}; +use euclid::ScaleFactor; use script_traits::{DevicePixel, EventResult, TouchId}; use self::TouchState::*; @@ -56,9 +56,9 @@ pub enum TouchAction { /// Simulate a mouse click. Click, /// Scroll by the provided offset. - Scroll(TypedPoint2D<f32, DevicePixel>), + Scroll(TypedVector2D<f32, DevicePixel>), /// Zoom by a magnification factor and scroll by the provided offset. - Zoom(f32, TypedPoint2D<f32, DevicePixel>), + Zoom(f32, TypedVector2D<f32, DevicePixel>), /// Send a JavaScript event to content. DispatchEvent, /// Don't do anything. @@ -221,10 +221,8 @@ impl TouchHandler { debug_assert!(self.touch_count() == 2); let p0 = self.active_touch_points[0].point; let p1 = self.active_touch_points[1].point; - let center = (p0 + p1) / ScaleFactor::new(2.0); - - let d = p0 - p1; - let distance = f32::sqrt(d.x * d.x + d.y * d.y); + let center = p0.lerp(p1, 0.5); + let distance = (p0 - p1).length(); (distance, center) } diff --git a/components/compositing/windowing.rs b/components/compositing/windowing.rs index e4c75762379..436f084fecf 100644 --- a/components/compositing/windowing.rs +++ b/components/compositing/windowing.rs @@ -6,10 +6,7 @@ use compositor_thread::EventLoopWaker; use euclid::{Point2D, Size2D}; -use euclid::point::TypedPoint2D; -use euclid::rect::TypedRect; -use euclid::scale_factor::ScaleFactor; -use euclid::size::TypedSize2D; +use euclid::{TypedPoint2D, TypedRect, ScaleFactor, TypedSize2D}; use gleam::gl; use msg::constellation_msg::{Key, KeyModifiers, KeyState}; use net_traits::net_error_list::NetError; diff --git a/components/config/Cargo.toml b/components/config/Cargo.toml index c3b7e403256..804633d949e 100644 --- a/components/config/Cargo.toml +++ b/components/config/Cargo.toml @@ -10,7 +10,7 @@ name = "servo_config" path = "lib.rs" [dependencies] -euclid = "0.13" +euclid = "0.14.4" getopts = "0.2.11" lazy_static = "0.2" log = "0.3.5" diff --git a/components/config/opts.rs b/components/config/opts.rs index d01a5dae480..d257206092e 100644 --- a/components/config/opts.rs +++ b/components/config/opts.rs @@ -5,7 +5,7 @@ //! Configuration options for a single run of the servo application. Created //! from command line arguments. -use euclid::size::TypedSize2D; +use euclid::TypedSize2D; use getopts::Options; use num_cpus; use prefs::{self, PrefValue, PREFS}; diff --git a/components/constellation/Cargo.toml b/components/constellation/Cargo.toml index cd41655de00..ccb9fb37adf 100644 --- a/components/constellation/Cargo.toml +++ b/components/constellation/Cargo.toml @@ -18,7 +18,7 @@ canvas_traits = {path = "../canvas_traits"} compositing = {path = "../compositing"} debugger = {path = "../debugger"} devtools_traits = {path = "../devtools_traits"} -euclid = "0.13" +euclid = "0.14.4" gfx = {path = "../gfx"} gfx_traits = {path = "../gfx_traits"} hyper = "0.10" @@ -29,7 +29,7 @@ log = "0.3.5" msg = {path = "../msg"} net = {path = "../net"} net_traits = {path = "../net_traits"} -offscreen_gl_context = "0.8" +offscreen_gl_context = { version = "0.9", features = ["serde"] } profile_traits = {path = "../profile_traits"} script_traits = {path = "../script_traits"} serde = "0.9" diff --git a/components/constellation/browsingcontext.rs b/components/constellation/browsingcontext.rs index b4569c61b10..2d124b3b605 100644 --- a/components/constellation/browsingcontext.rs +++ b/components/constellation/browsingcontext.rs @@ -2,7 +2,7 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -use euclid::size::TypedSize2D; +use euclid::TypedSize2D; use msg::constellation_msg::{BrowsingContextId, TopLevelBrowsingContextId, PipelineId}; use pipeline::Pipeline; use script_traits::LoadData; diff --git a/components/constellation/constellation.rs b/components/constellation/constellation.rs index 4a1598b0e9c..f4f07c5ea84 100644 --- a/components/constellation/constellation.rs +++ b/components/constellation/constellation.rs @@ -78,8 +78,7 @@ use compositing::compositor_thread::CompositorProxy; use compositing::compositor_thread::Msg as ToCompositorMsg; use debugger; use devtools_traits::{ChromeToDevtoolsControlMsg, DevtoolsControlMsg}; -use euclid::scale_factor::ScaleFactor; -use euclid::size::{Size2D, TypedSize2D}; +use euclid::{Size2D, TypedSize2D, ScaleFactor}; use event_loop::EventLoop; use gfx::font_cache_thread::FontCacheThread; use gfx_traits::Epoch; diff --git a/components/constellation/pipeline.rs b/components/constellation/pipeline.rs index 1b53e2d06ff..6779cd2060f 100644 --- a/components/constellation/pipeline.rs +++ b/components/constellation/pipeline.rs @@ -7,8 +7,7 @@ use compositing::CompositionPipeline; use compositing::CompositorProxy; use compositing::compositor_thread::Msg as CompositorMsg; use devtools_traits::{DevtoolsControlMsg, ScriptToDevtoolsControlMsg}; -use euclid::scale_factor::ScaleFactor; -use euclid::size::TypedSize2D; +use euclid::{TypedSize2D, ScaleFactor}; use event_loop::EventLoop; use gfx::font_cache_thread::FontCacheThread; use ipc_channel::Error; diff --git a/components/geometry/Cargo.toml b/components/geometry/Cargo.toml index a6e6b690f85..5c5a327160d 100644 --- a/components/geometry/Cargo.toml +++ b/components/geometry/Cargo.toml @@ -15,5 +15,5 @@ servo = ["euclid/unstable"] [dependencies] app_units = "0.4.1" -euclid = "0.13" +euclid = "0.14" heapsize = "0.4" diff --git a/components/geometry/lib.rs b/components/geometry/lib.rs index 8b98301dde7..c71b687e814 100644 --- a/components/geometry/lib.rs +++ b/components/geometry/lib.rs @@ -7,9 +7,7 @@ extern crate euclid; #[macro_use] extern crate heapsize; use app_units::{Au, MAX_AU, MIN_AU}; -use euclid::point::Point2D; -use euclid::rect::Rect; -use euclid::size::Size2D; +use euclid::{Point2D, Rect, Size2D}; // Units for use with euclid::length and euclid::scale_factor. diff --git a/components/gfx/Cargo.toml b/components/gfx/Cargo.toml index 06003773dd5..673bff6fee5 100644 --- a/components/gfx/Cargo.toml +++ b/components/gfx/Cargo.toml @@ -13,7 +13,7 @@ path = "lib.rs" [dependencies] app_units = "0.4.1" bitflags = "0.7" -euclid = "0.13" +euclid = "0.14.4" fnv = "1.0" fontsan = {git = "https://github.com/servo/fontsan"} gfx_traits = {path = "../gfx_traits"} diff --git a/components/gfx/display_list/mod.rs b/components/gfx/display_list/mod.rs index 8ca587bfca4..af17eb4d659 100644 --- a/components/gfx/display_list/mod.rs +++ b/components/gfx/display_list/mod.rs @@ -15,10 +15,8 @@ //! low-level drawing primitives. use app_units::Au; -use euclid::{Matrix4D, Point2D, Rect, Size2D}; +use euclid::{Transform3D, Point2D, Vector2D, Rect, Size2D, TypedRect, SideOffsets2D}; use euclid::num::{One, Zero}; -use euclid::rect::TypedRect; -use euclid::side_offsets::SideOffsets2D; use gfx_traits::StackingContextId; use gfx_traits::print_tree::PrintTree; use ipc_channel::ipc::IpcSharedMemory; @@ -66,7 +64,7 @@ impl<'a> ScrollOffsetLookup<'a> { fn new_for_reference_frame(&mut self, clip_id: ClipId, - transform: &Matrix4D<f32>, + transform: &Transform3D<f32>, point: &mut Point2D<Au>) -> Option<ScrollOffsetLookup> { // If a transform function causes the current transformation matrix of an object @@ -79,8 +77,8 @@ impl<'a> ScrollOffsetLookup<'a> { let scroll_offset = self.full_offset_for_scroll_root(&clip_id); *point = Point2D::new(point.x - Au::from_f32_px(scroll_offset.x), point.y - Au::from_f32_px(scroll_offset.y)); - let frac_point = inv_transform.transform_point(&Point2D::new(point.x.to_f32_px(), - point.y.to_f32_px())); + let frac_point = inv_transform.transform_point2d(&Point2D::new(point.x.to_f32_px(), + point.y.to_f32_px())); *point = Point2D::new(Au::from_f32_px(frac_point.x), Au::from_f32_px(frac_point.y)); let mut sublookup = ScrollOffsetLookup { @@ -88,7 +86,7 @@ impl<'a> ScrollOffsetLookup<'a> { calculated_total_offsets: HashMap::new(), raw_offsets: self.raw_offsets, }; - sublookup.calculated_total_offsets.insert(clip_id, Point2D::zero()); + sublookup.calculated_total_offsets.insert(clip_id, Vector2D::zero()); Some(sublookup) } @@ -96,7 +94,7 @@ impl<'a> ScrollOffsetLookup<'a> { self.parents.insert(scroll_root.id, scroll_root.parent_id); } - fn full_offset_for_scroll_root(&mut self, id: &ClipId) -> Point2D<f32> { + fn full_offset_for_scroll_root(&mut self, id: &ClipId) -> Vector2D<f32> { if let Some(offset) = self.calculated_total_offsets.get(id) { return *offset; } @@ -105,11 +103,11 @@ impl<'a> ScrollOffsetLookup<'a> { let parent_id = *self.parents.get(id).unwrap(); self.full_offset_for_scroll_root(&parent_id) } else { - Point2D::zero() + Vector2D::zero() }; let offset = parent_offset + - self.raw_offsets.get(id).cloned().unwrap_or_else(Point2D::zero); + self.raw_offsets.get(id).cloned().unwrap_or_else(Vector2D::zero); self.calculated_total_offsets.insert(*id, offset); offset } @@ -184,10 +182,10 @@ impl DisplayList { point: &Point2D<Au>, offset_lookup: &mut ScrollOffsetLookup, result: &mut Vec<usize>) { - let mut point = *point - stacking_context.bounds.origin; + let mut point = *point - stacking_context.bounds.origin.to_vector(); if stacking_context.scroll_policy == ScrollPolicy::Fixed { let old_offset = offset_lookup.calculated_total_offsets.get(&clip_id).cloned(); - offset_lookup.calculated_total_offsets.insert(clip_id, Point2D::zero()); + offset_lookup.calculated_total_offsets.insert(clip_id, Vector2D::zero()); self.text_index_contents(node, traversal, &point, offset_lookup, result); @@ -257,10 +255,10 @@ impl DisplayList { result: &mut Vec<DisplayItemMetadata>) { debug_assert!(stacking_context.context_type == StackingContextType::Real); - let mut point = *point - stacking_context.bounds.origin; + let mut point = *point - stacking_context.bounds.origin.to_vector(); if stacking_context.scroll_policy == ScrollPolicy::Fixed { let old_offset = offset_lookup.calculated_total_offsets.get(&clip_id).cloned(); - offset_lookup.calculated_total_offsets.insert(clip_id, Point2D::zero()); + offset_lookup.calculated_total_offsets.insert(clip_id, Vector2D::zero()); self.hit_test_contents(traversal, &point, offset_lookup, result); @@ -427,13 +425,13 @@ pub struct StackingContext { pub mix_blend_mode: MixBlendMode, /// A transform to be applied to this stacking context. - pub transform: Option<Matrix4D<f32>>, + pub transform: Option<Transform3D<f32>>, /// The transform style of this stacking context. pub transform_style: TransformStyle, /// The perspective matrix to be applied to children. - pub perspective: Option<Matrix4D<f32>>, + pub perspective: Option<Transform3D<f32>>, /// The scroll policy of this layer. pub scroll_policy: ScrollPolicy, @@ -452,9 +450,9 @@ impl StackingContext { z_index: i32, filters: filter::T, mix_blend_mode: MixBlendMode, - transform: Option<Matrix4D<f32>>, + transform: Option<Transform3D<f32>>, transform_style: TransformStyle, - perspective: Option<Matrix4D<f32>>, + perspective: Option<Transform3D<f32>>, scroll_policy: ScrollPolicy, parent_scroll_id: ClipId) -> StackingContext { @@ -802,7 +800,7 @@ impl ClippingRegion { /// Translates this clipping region by the given vector. #[inline] - pub fn translate(&self, delta: &Point2D<Au>) -> ClippingRegion { + pub fn translate(&self, delta: &Vector2D<Au>) -> ClippingRegion { ClippingRegion { main: self.main.translate(delta), complex: self.complex.iter().map(|complex| { @@ -1158,7 +1156,7 @@ pub struct BoxShadowDisplayItem { pub box_bounds: Rect<Au>, /// The offset of this shadow from the box. - pub offset: Point2D<Au>, + pub offset: Vector2D<Au>, /// The color of this shadow. pub color: ColorF, @@ -1383,14 +1381,14 @@ impl WebRenderImageInfo { } /// The type of the scroll offset list. This is only populated if WebRender is in use. -pub type ScrollOffsetMap = HashMap<ClipId, Point2D<f32>>; +pub type ScrollOffsetMap = HashMap<ClipId, Vector2D<f32>>; pub trait SimpleMatrixDetection { fn is_identity_or_simple_translation(&self) -> bool; } -impl SimpleMatrixDetection for Matrix4D<f32> { +impl SimpleMatrixDetection for Transform3D<f32> { #[inline] fn is_identity_or_simple_translation(&self) -> bool { let (_0, _1) = (Zero::zero(), One::one()); diff --git a/components/gfx/text/glyph.rs b/components/gfx/text/glyph.rs index 21692cd8d5f..2229bbbecd8 100644 --- a/components/gfx/text/glyph.rs +++ b/components/gfx/text/glyph.rs @@ -3,7 +3,7 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ use app_units::Au; -use euclid::point::Point2D; +use euclid::Point2D; use range::{self, EachIndex, Range, RangeIndex}; #[cfg(any(target_feature = "sse2", target_feature = "neon"))] use simd::u32x4; diff --git a/components/layout/Cargo.toml b/components/layout/Cargo.toml index e9679887da6..a08ee6c8387 100644 --- a/components/layout/Cargo.toml +++ b/components/layout/Cargo.toml @@ -14,7 +14,7 @@ app_units = "0.4.1" atomic_refcell = "0.1" bitflags = "0.7" canvas_traits = {path = "../canvas_traits"} -euclid = "0.13" +euclid = "0.14.4" fnv = "1.0" gfx = {path = "../gfx"} gfx_traits = {path = "../gfx_traits"} diff --git a/components/layout/block.rs b/components/layout/block.rs index 9cd6978097e..fe95e47fc2b 100644 --- a/components/layout/block.rs +++ b/components/layout/block.rs @@ -1967,7 +1967,7 @@ impl Flow for BlockFlow { // flow w.r.t. the containing block. self.base .late_absolute_position_info - .stacking_relative_position_of_absolute_containing_block + position_start + .stacking_relative_position_of_absolute_containing_block + position_start.to_vector() }; if !self.base.writing_mode.is_vertical() { @@ -2002,7 +2002,7 @@ impl Flow for BlockFlow { .stacking_relative_position_of_absolute_containing_block = self.base.stacking_relative_position + (border_box_origin + relative_offset).to_physical(self.base.writing_mode, - container_size) + container_size).to_vector() } // Compute absolute position info for children. @@ -2021,7 +2021,7 @@ impl Flow for BlockFlow { // `transform` set.) In this case, absolutely-positioned children will not be // positioned relative to us but will instead be positioned relative to our // containing block. - position - self.base.stacking_relative_position + position - self.base.stacking_relative_position.to_vector() } } else { self.base @@ -2171,7 +2171,7 @@ impl Flow for BlockFlow { .early_absolute_position_info .relative_containing_block_mode, CoordinateSystem::Own) - .translate(stacking_context_position)); + .translate(&stacking_context_position.to_vector())); } fn mutate_fragments(&mut self, mutator: &mut FnMut(&mut Fragment)) { diff --git a/components/layout/display_list_builder.rs b/components/layout/display_list_builder.rs index b97aeb4c1fa..396ccbce971 100644 --- a/components/layout/display_list_builder.rs +++ b/components/layout/display_list_builder.rs @@ -14,7 +14,7 @@ use app_units::{AU_PER_PX, Au}; use block::{BlockFlow, BlockStackingContextType}; use canvas_traits::{CanvasData, CanvasMsg, FromLayoutMsg}; use context::LayoutContext; -use euclid::{Matrix4D, Point2D, Rect, SideOffsets2D, Size2D, TypedSize2D}; +use euclid::{Transform3D, Point2D, Vector2D, Rect, SideOffsets2D, Size2D, TypedSize2D}; use flex::FlexFlow; use flow::{BaseFlow, Flow, IS_ABSOLUTELY_POSITIONED}; use flow_ref::FlowRef; @@ -1223,8 +1223,8 @@ impl FragmentDisplayListBuilding for Fragment { // This is the vector between the center and the ending point; i.e. half // of the distance between the starting point and the ending point. - let delta = Point2D::new(Au::from_f32_px(dir.x * inv_dir_length * line_length / 2.0), - Au::from_f32_px(dir.y * inv_dir_length * line_length / 2.0)); + let delta = Vector2D::new(Au::from_f32_px(dir.x * inv_dir_length * line_length / 2.0), + Au::from_f32_px(dir.y * inv_dir_length * line_length / 2.0)); // This is the length of the gradient line. let length = Au::from_f32_px( @@ -1347,8 +1347,8 @@ impl FragmentDisplayListBuilding for Fragment { // NB: According to CSS-BACKGROUNDS, box shadows render in *reverse* order (front to back). for box_shadow in style.get_effects().box_shadow.0.iter().rev() { let bounds = - shadow_bounds(&absolute_bounds.translate(&Point2D::new(box_shadow.offset_x, - box_shadow.offset_y)), + shadow_bounds(&absolute_bounds.translate(&Vector2D::new(box_shadow.offset_x, + box_shadow.offset_y)), box_shadow.blur_radius, box_shadow.spread_radius); @@ -1362,7 +1362,7 @@ impl FragmentDisplayListBuilding for Fragment { base: base, box_bounds: *absolute_bounds, color: style.resolve_color(box_shadow.color).to_gfx_color(), - offset: Point2D::new(box_shadow.offset_x, box_shadow.offset_y), + offset: Vector2D::new(box_shadow.offset_x, box_shadow.offset_y), blur_radius: box_shadow.blur_radius, spread_radius: box_shadow.spread_radius, border_radius: model::specified_border_radius(style.get_border() @@ -1999,9 +1999,9 @@ impl FragmentDisplayListBuilding for Fragment { // First, compute the offset of our border box (including relative positioning) // from our flow origin, since that is what `BaseFlow::overflow` is relative to. let border_box_offset = - border_box.translate(&-base_flow.stacking_relative_position).origin; + border_box.translate(&-base_flow.stacking_relative_position.to_vector()).origin; // Then, using that, compute our overflow region relative to our border box. - let overflow = base_flow.overflow.paint.translate(&-border_box_offset); + let overflow = base_flow.overflow.paint.translate(&-border_box_offset.to_vector()); // Create the filter pipeline. let effects = self.style().get_effects(); @@ -2046,7 +2046,7 @@ impl FragmentDisplayListBuilding for Fragment { } else { self.style().get_color().color }; - let offset = text_shadow.map(|s| Point2D::new(s.offset_x, s.offset_y)).unwrap_or_else(Point2D::zero); + let offset = text_shadow.map(|s| Vector2D::new(s.offset_x, s.offset_y)).unwrap_or_else(Vector2D::zero); let shadow_blur_radius = text_shadow.map(|s| s.blur_radius).unwrap_or(Au(0)); // Determine the orientation and cursor to use. @@ -2068,7 +2068,7 @@ impl FragmentDisplayListBuilding for Fragment { LogicalPoint::new(self.style.writing_mode, Au(0), metrics.ascent).to_physical(self.style.writing_mode, - container_size); + container_size).to_vector(); // Create the text display item. let base = state.create_base_display_item(&stacking_relative_content_box, @@ -2158,7 +2158,7 @@ impl FragmentDisplayListBuilding for Fragment { base: base, box_bounds: stacking_relative_box, color: color.to_gfx_color(), - offset: Point2D::zero(), + offset: Vector2D::zero(), blur_radius: blur_radius, spread_radius: Au(0), border_radius: Au(0), @@ -2300,7 +2300,7 @@ impl BlockFlowDisplayListBuilding for BlockFlow { }; let perspective = self.fragment.perspective_matrix(&border_box) - .unwrap_or_else(Matrix4D::identity); + .unwrap_or_else(Transform3D::identity); let transform = transform.pre_mul(&perspective).inverse(); let origin = &border_box.origin; diff --git a/components/layout/flow.rs b/components/layout/flow.rs index 1944f0decbd..671d4287146 100644 --- a/components/layout/flow.rs +++ b/components/layout/flow.rs @@ -29,7 +29,7 @@ use app_units::Au; use block::{BlockFlow, FormattingContextType}; use context::LayoutContext; use display_list_builder::DisplayListBuildState; -use euclid::{Matrix4D, Point2D, Rect, Size2D}; +use euclid::{Transform3D, Point2D, Rect, Size2D}; use flex::FlexFlow; use floats::{Floats, SpeculatedFloatPlacement}; use flow_list::{FlowList, MutFlowListIterator}; @@ -260,7 +260,7 @@ pub trait Flow: fmt::Debug + Sync + Send + 'static { match self.class() { FlowClass::Block | FlowClass::TableCaption | FlowClass::TableCell => {} _ => { - overflow.translate(&position.origin); + overflow.translate(&position.origin.to_vector()); return overflow; } } @@ -285,7 +285,7 @@ pub trait Flow: fmt::Debug + Sync + Send + 'static { if !self.as_block().fragment.establishes_stacking_context() || self.as_block().fragment.style.get_box().transform.0.is_none() { - overflow.translate(&position.origin); + overflow.translate(&position.origin.to_vector()); return overflow; } @@ -294,7 +294,7 @@ pub trait Flow: fmt::Debug + Sync + Send + 'static { let transform_2d = self.as_block() .fragment .transform_matrix(&position) - .unwrap_or(Matrix4D::identity()) + .unwrap_or(Transform3D::identity()) .to_2d(); let transformed_overflow = Overflow { paint: f32_rect_to_au_rect(transform_2d.transform_rect( @@ -308,7 +308,7 @@ pub trait Flow: fmt::Debug + Sync + Send + 'static { // unnecessary once we are taking into account 3D transformations above. overflow.union(&transformed_overflow); - overflow.translate(&position.origin); + overflow.translate(&position.origin.to_vector()); overflow } @@ -917,7 +917,7 @@ pub struct BaseFlow { /// The position of this flow relative to the start of the nearest ancestor stacking context. /// This is computed during the top-down pass of display list construction. - pub stacking_relative_position: Point2D<Au>, + pub stacking_relative_position: Point2D<Au>, // TODO: this should be a Vector2D<Au> /// Details about descendants with position 'absolute' or 'fixed' for which we are the /// containing block. This is in tree order. This includes any direct children. diff --git a/components/layout/fragment.rs b/components/layout/fragment.rs index c0d766dc544..68f5fb30677 100644 --- a/components/layout/fragment.rs +++ b/components/layout/fragment.rs @@ -10,7 +10,7 @@ use StyleArc; use app_units::Au; use canvas_traits::CanvasMsg; use context::{LayoutContext, with_thread_local_font_context}; -use euclid::{Matrix4D, Point2D, Radians, Rect, Size2D}; +use euclid::{Transform3D, Point2D, Vector2D, Radians, Rect, Size2D}; use floats::ClearType; use flow::{self, ImmutableFlowUtils}; use flow_ref::FlowRef; @@ -2440,7 +2440,7 @@ impl Fragment { // this. let relative_position = self.relative_position(relative_containing_block_size); border_box.translate_by_size(&relative_position.to_physical(self.style.writing_mode)) - .translate(stacking_relative_flow_origin) + .translate(&stacking_relative_flow_origin.to_vector()) } /// Given the stacking-context-relative border box, returns the stacking-context-relative @@ -2551,7 +2551,7 @@ impl Fragment { // Box shadows cause us to draw outside our border box. for box_shadow in &self.style().get_effects().box_shadow.0 { - let offset = Point2D::new(box_shadow.offset_x, box_shadow.offset_y); + let offset = Vector2D::new(box_shadow.offset_x, box_shadow.offset_y); let inflation = box_shadow.spread_radius + box_shadow.blur_radius * BLUR_INFLATION_FACTOR; overflow.paint = overflow.paint.union(&border_box.translate(&offset) @@ -2842,13 +2842,13 @@ impl Fragment { } /// Returns the 4D matrix representing this fragment's transform. - pub fn transform_matrix(&self, stacking_relative_border_box: &Rect<Au>) -> Option<Matrix4D<f32>> { + pub fn transform_matrix(&self, stacking_relative_border_box: &Rect<Au>) -> Option<Transform3D<f32>> { let operations = match self.style.get_box().transform.0 { None => return None, Some(ref operations) => operations, }; - let mut transform = Matrix4D::identity(); + let mut transform = Transform3D::identity(); let transform_origin = &self.style.get_box().transform_origin; let transform_origin_x = transform_origin.horizontal @@ -2860,30 +2860,30 @@ impl Fragment { .to_f32_px(); let transform_origin_z = transform_origin.depth.to_f32_px(); - let pre_transform = Matrix4D::create_translation(transform_origin_x, - transform_origin_y, - transform_origin_z); - let post_transform = Matrix4D::create_translation(-transform_origin_x, - -transform_origin_y, - -transform_origin_z); + let pre_transform = Transform3D::create_translation(transform_origin_x, + transform_origin_y, + transform_origin_z); + let post_transform = Transform3D::create_translation(-transform_origin_x, + -transform_origin_y, + -transform_origin_z); for operation in operations { let matrix = match *operation { transform::ComputedOperation::Rotate(ax, ay, az, theta) => { let theta = 2.0f32 * f32::consts::PI - theta.radians(); - Matrix4D::create_rotation(ax, ay, az, Radians::new(theta)) + Transform3D::create_rotation(ax, ay, az, Radians::new(theta)) } transform::ComputedOperation::Perspective(d) => { create_perspective_matrix(d) } transform::ComputedOperation::Scale(sx, sy, sz) => { - Matrix4D::create_scale(sx, sy, sz) + Transform3D::create_scale(sx, sy, sz) } transform::ComputedOperation::Translate(tx, ty, tz) => { let tx = tx.to_used_value(stacking_relative_border_box.size.width).to_f32_px(); let ty = ty.to_used_value(stacking_relative_border_box.size.height).to_f32_px(); let tz = tz.to_f32_px(); - Matrix4D::create_translation(tx, ty, tz) + Transform3D::create_translation(tx, ty, tz) } transform::ComputedOperation::Matrix(m) => { m.to_gfx_matrix() @@ -2893,14 +2893,14 @@ impl Fragment { unreachable!() } transform::ComputedOperation::Skew(theta_x, theta_y) => { - Matrix4D::create_skew(Radians::new(theta_x.radians()), + Transform3D::create_skew(Radians::new(theta_x.radians()), Radians::new(theta_y.radians())) } transform::ComputedOperation::InterpolateMatrix { .. } | transform::ComputedOperation::AccumulateMatrix { .. } => { - // TODO: Convert InterpolateMatrix/AccmulateMatrix into a valid Matrix4D by + // TODO: Convert InterpolateMatrix/AccmulateMatrix into a valid Transform3D by // the reference box. - Matrix4D::identity() + Transform3D::identity() } }; @@ -2911,7 +2911,7 @@ impl Fragment { } /// Returns the 4D matrix representing this fragment's perspective. - pub fn perspective_matrix(&self, stacking_relative_border_box: &Rect<Au>) -> Option<Matrix4D<f32>> { + pub fn perspective_matrix(&self, stacking_relative_border_box: &Rect<Au>) -> Option<Transform3D<f32>> { match self.style().get_box().perspective { Either::First(length) => { let perspective_origin = self.style().get_box().perspective_origin; @@ -2924,12 +2924,12 @@ impl Fragment { .to_used_value(stacking_relative_border_box.size.height) .to_f32_px()); - let pre_transform = Matrix4D::create_translation(perspective_origin.x, - perspective_origin.y, - 0.0); - let post_transform = Matrix4D::create_translation(-perspective_origin.x, - -perspective_origin.y, - 0.0); + let pre_transform = Transform3D::create_translation(perspective_origin.x, + perspective_origin.y, + 0.0); + let post_transform = Transform3D::create_translation(-perspective_origin.x, + -perspective_origin.y, + 0.0); let perspective_matrix = create_perspective_matrix(length); @@ -3099,9 +3099,9 @@ impl Overflow { self.paint = self.paint.union(&other.paint); } - pub fn translate(&mut self, point: &Point2D<Au>) { - self.scroll = self.scroll.translate(point); - self.paint = self.paint.translate(point); + pub fn translate(&mut self, by: &Vector2D<Au>) { + self.scroll = self.scroll.translate(by); + self.paint = self.paint.translate(by); } } @@ -3184,11 +3184,11 @@ impl Serialize for DebugId { // and behaves as it does in other browsers. // See https://lists.w3.org/Archives/Public/www-style/2016Jan/0020.html for more details. #[inline] -fn create_perspective_matrix(d: Au) -> Matrix4D<f32> { +fn create_perspective_matrix(d: Au) -> Transform3D<f32> { let d = d.to_f32_px(); if d <= 0.0 { - Matrix4D::identity() + Transform3D::identity() } else { - Matrix4D::create_perspective(d) + Transform3D::create_perspective(d) } } diff --git a/components/layout/inline.rs b/components/layout/inline.rs index 8a54eac9e64..d77d7c831fd 100644 --- a/components/layout/inline.rs +++ b/components/layout/inline.rs @@ -1600,7 +1600,7 @@ impl Flow for InlineFlow { block_flow.base .late_absolute_position_info .stacking_relative_position_of_absolute_containing_block = - stacking_relative_position + *padding_box_origin; + stacking_relative_position + padding_box_origin.to_vector(); } block_flow.base.stacking_relative_position = @@ -1633,7 +1633,7 @@ impl Flow for InlineFlow { block_flow.base .late_absolute_position_info .stacking_relative_position_of_absolute_containing_block = - stacking_relative_position + *padding_box_origin; + stacking_relative_position + padding_box_origin.to_vector(); block_flow.base.stacking_relative_position = stacking_relative_border_box.origin; @@ -1694,7 +1694,7 @@ impl Flow for InlineFlow { relative_containing_block_size, relative_containing_block_mode, CoordinateSystem::Own) - .translate(stacking_context_position)) + .translate(&stacking_context_position.to_vector())) } } diff --git a/components/layout/list_item.rs b/components/layout/list_item.rs index 8a79aaa40b7..cb8cd27df70 100644 --- a/components/layout/list_item.rs +++ b/components/layout/list_item.rs @@ -197,7 +197,7 @@ impl Flow for ListItemFlow { .early_absolute_position_info .relative_containing_block_mode, CoordinateSystem::Own) - .translate(stacking_context_position)); + .translate(&stacking_context_position.to_vector())); } } } diff --git a/components/layout/model.rs b/components/layout/model.rs index 97fb5cbc43e..40ac5849deb 100644 --- a/components/layout/model.rs +++ b/components/layout/model.rs @@ -7,7 +7,7 @@ #![deny(unsafe_code)] use app_units::Au; -use euclid::{Matrix4D, SideOffsets2D, Size2D}; +use euclid::{Transform3D, SideOffsets2D, Size2D}; use fragment::Fragment; use std::cmp::{max, min}; use std::fmt; @@ -509,12 +509,12 @@ pub fn specified_margin_from_style(style: &ServoComputedValues, } pub trait ToGfxMatrix { - fn to_gfx_matrix(&self) -> Matrix4D<f32>; + fn to_gfx_matrix(&self) -> Transform3D<f32>; } impl ToGfxMatrix for ComputedMatrix { - fn to_gfx_matrix(&self) -> Matrix4D<f32> { - Matrix4D::row_major( + fn to_gfx_matrix(&self) -> Transform3D<f32> { + Transform3D::row_major( self.m11 as f32, self.m12 as f32, self.m13 as f32, self.m14 as f32, self.m21 as f32, self.m22 as f32, self.m23 as f32, self.m24 as f32, self.m31 as f32, self.m32 as f32, self.m33 as f32, self.m34 as f32, diff --git a/components/layout/query.rs b/components/layout/query.rs index da10696ec29..2f406261c2d 100644 --- a/components/layout/query.rs +++ b/components/layout/query.rs @@ -7,9 +7,7 @@ use app_units::Au; use construct::ConstructionResult; use context::LayoutContext; -use euclid::point::Point2D; -use euclid::rect::Rect; -use euclid::size::Size2D; +use euclid::{Point2D, Vector2D, Rect, Size2D}; use flow::{self, Flow}; use fragment::{Fragment, FragmentBorderBoxIterator, SpecificFragmentInfo}; use gfx::display_list::{DisplayItemMetadata, DisplayList, OpaqueNode, ScrollOffsetMap}; @@ -613,7 +611,7 @@ impl FragmentBorderBoxIterator for ParentOffsetBorderBoxIterator { Some(ParentBorderBoxInfo { node_address: fragment.node, - origin: border_box.origin + Point2D::new(border_width.left, border_width.top), + origin: border_box.origin + Vector2D::new(border_width.left, border_width.top), }) } else { None @@ -852,7 +850,7 @@ pub fn process_offset_parent_query<N: LayoutNode>(requested_node: N, layout_root let parent_info = iterator.parent_nodes.into_iter().rev().filter_map(|info| info).next(); match (node_offset_box, parent_info) { (Some(node_offset_box), Some(parent_info)) => { - let origin = node_offset_box.offset - parent_info.origin; + let origin = node_offset_box.offset - parent_info.origin.to_vector(); let size = node_offset_box.rectangle.size; OffsetParentResponse { node_address: Some(parent_info.node_address.to_untrusted_node_address()), diff --git a/components/layout/sequential.rs b/components/layout/sequential.rs index 404d29a44d1..c944f0adb83 100644 --- a/components/layout/sequential.rs +++ b/components/layout/sequential.rs @@ -7,7 +7,7 @@ use app_units::Au; use context::LayoutContext; use display_list_builder::DisplayListBuildState; -use euclid::point::Point2D; +use euclid::{Point2D, Vector2D}; use floats::SpeculatedFloatPlacement; use flow::{self, Flow, ImmutableFlowUtils, InorderFlowTraversal, MutableFlowUtils}; use flow::{PostorderFlowTraversal, PreorderFlowTraversal}; @@ -108,17 +108,17 @@ pub fn iterate_through_flow_tree_fragment_border_boxes(root: &mut Flow, iterator let mut stacking_context_position = *stacking_context_position; if kid.is_block_flow() && kid.as_block().fragment.establishes_stacking_context() { stacking_context_position = Point2D::new(kid.as_block().fragment.margin.inline_start, Au(0)) + - flow::base(kid).stacking_relative_position + - stacking_context_position; + flow::base(kid).stacking_relative_position.to_vector() + + stacking_context_position.to_vector(); let relative_position = kid.as_block() .stacking_relative_position(CoordinateSystem::Own); if let Some(matrix) = kid.as_block() .fragment .transform_matrix(&relative_position) { - let transform_matrix = matrix.transform_point(&Point2D::zero()); + let transform_matrix = matrix.transform_point2d(&Point2D::zero()); stacking_context_position = stacking_context_position + - Point2D::new(Au::from_f32_px(transform_matrix.x), - Au::from_f32_px(transform_matrix.y)) + Vector2D::new(Au::from_f32_px(transform_matrix.x), + Au::from_f32_px(transform_matrix.y)) } } doit(kid, level + 1, iterator, &stacking_context_position); diff --git a/components/layout/webrender_helpers.rs b/components/layout/webrender_helpers.rs index 537d5f04267..dc8bf7bc9a5 100644 --- a/components/layout/webrender_helpers.rs +++ b/components/layout/webrender_helpers.rs @@ -8,7 +8,7 @@ // completely converting layout to directly generate WebRender display lists, for example. use app_units::Au; -use euclid::{Point2D, Rect, SideOffsets2D, Size2D}; +use euclid::{Point2D, Vector2D, Rect, SideOffsets2D, Size2D}; use gfx::display_list::{BorderDetails, BorderRadii, BoxShadowClipMode, ClippingRegion}; use gfx::display_list::{DisplayItem, DisplayList, DisplayListTraversal, StackingContextType}; use msg::constellation_msg::PipelineId; @@ -86,12 +86,22 @@ trait ToPointF { fn to_pointf(&self) -> webrender_traits::LayoutPoint; } +trait ToVectorF { + fn to_vectorf(&self) -> webrender_traits::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()) } } +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()) + } +} + 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()) @@ -450,7 +460,7 @@ impl WebRenderDisplayItemConverter for DisplayItem { builder.push_box_shadow(rect, clip, box_bounds, - item.offset.to_pointf(), + item.offset.to_vectorf(), item.color, item.blur_radius.to_f32_px(), item.spread_radius.to_f32_px(), diff --git a/components/layout_thread/Cargo.toml b/components/layout_thread/Cargo.toml index b1c86761eac..242dd6411e5 100644 --- a/components/layout_thread/Cargo.toml +++ b/components/layout_thread/Cargo.toml @@ -11,7 +11,7 @@ path = "lib.rs" [dependencies] app_units = "0.4.1" -euclid = "0.13" +euclid = "0.14.4" fnv = "1.0" gfx = {path = "../gfx"} gfx_traits = {path = "../gfx_traits"} diff --git a/components/layout_thread/lib.rs b/components/layout_thread/lib.rs index f381caed992..47698e03b3c 100644 --- a/components/layout_thread/lib.rs +++ b/components/layout_thread/lib.rs @@ -40,10 +40,7 @@ extern crate style; extern crate webrender_traits; use app_units::Au; -use euclid::point::Point2D; -use euclid::rect::Rect; -use euclid::scale_factor::ScaleFactor; -use euclid::size::Size2D; +use euclid::{Point2D, Rect, Size2D, ScaleFactor}; use fnv::FnvHashMap; use gfx::display_list::{OpaqueNode, WebRenderImageInfo}; use gfx::font; diff --git a/components/script/Cargo.toml b/components/script/Cargo.toml index 44940fc270e..77ec98958cb 100644 --- a/components/script/Cargo.toml +++ b/components/script/Cargo.toml @@ -41,7 +41,7 @@ devtools_traits = {path = "../devtools_traits"} dom_struct = {path = "../dom_struct"} domobject_derive = {path = "../domobject_derive"} encoding = "0.2" -euclid = "0.13" +euclid = "0.14.4" fnv = "1.0" gleam = "0.4" gfx_traits = {path = "../gfx_traits"} @@ -63,7 +63,7 @@ mime_guess = "1.8.0" msg = {path = "../msg"} net_traits = {path = "../net_traits"} num-traits = "0.1.32" -offscreen_gl_context = "0.8" +offscreen_gl_context = { version = "0.9", features = ["serde"] } open = "1.1.1" parking_lot = "0.3" phf = "0.7.18" diff --git a/components/script/dom/bindings/trace.rs b/components/script/dom/bindings/trace.rs index db3cd3b5c42..67e65c6a4b0 100644 --- a/components/script/dom/bindings/trace.rs +++ b/components/script/dom/bindings/trace.rs @@ -43,10 +43,8 @@ use dom::bindings::str::{DOMString, USVString}; use dom::bindings::utils::WindowProxyHandler; use dom::document::PendingRestyle; use encoding::types::EncodingRef; -use euclid::{Matrix2D, Matrix4D, Point2D}; -use euclid::length::Length as EuclidLength; -use euclid::rect::Rect; -use euclid::size::Size2D; +use euclid::{Transform2D, Transform3D, Point2D, Vector2D, Rect, Size2D}; +use euclid::Length as EuclidLength; use html5ever::{Prefix, LocalName, Namespace, QualName}; use html5ever::buffer_queue::BufferQueue; use html5ever::tendril::IncompleteUtf8; @@ -457,14 +455,14 @@ unsafe impl<T: Send> JSTraceable for Sender<T> { } } -unsafe impl JSTraceable for Matrix2D<f32> { +unsafe impl JSTraceable for Transform2D<f32> { #[inline] unsafe fn trace(&self, _trc: *mut JSTracer) { // Do nothing } } -unsafe impl JSTraceable for Matrix4D<f64> { +unsafe impl JSTraceable for Transform3D<f64> { #[inline] unsafe fn trace(&self, _trc: *mut JSTracer) { // Do nothing @@ -478,6 +476,13 @@ unsafe impl JSTraceable for Point2D<f32> { } } +unsafe impl JSTraceable for Vector2D<f32> { + #[inline] + unsafe fn trace(&self, _trc: *mut JSTracer) { + // Do nothing + } +} + unsafe impl<T> JSTraceable for EuclidLength<u64, T> { #[inline] unsafe fn trace(&self, _trc: *mut JSTracer) { diff --git a/components/script/dom/canvaspattern.rs b/components/script/dom/canvaspattern.rs index 6a6d6789918..5d9dd5cb767 100644 --- a/components/script/dom/canvaspattern.rs +++ b/components/script/dom/canvaspattern.rs @@ -9,7 +9,7 @@ use dom::bindings::reflector::{Reflector, reflect_dom_object}; use dom::canvasgradient::ToFillOrStrokeStyle; use dom::globalscope::GlobalScope; use dom_struct::dom_struct; -use euclid::size::Size2D; +use euclid::Size2D; // https://html.spec.whatwg.org/multipage/#canvaspattern #[dom_struct] diff --git a/components/script/dom/canvasrenderingcontext2d.rs b/components/script/dom/canvasrenderingcontext2d.rs index 8fb17c90fea..7f08ba1c13a 100644 --- a/components/script/dom/canvasrenderingcontext2d.rs +++ b/components/script/dom/canvasrenderingcontext2d.rs @@ -34,10 +34,7 @@ use dom::htmlimageelement::HTMLImageElement; use dom::imagedata::ImageData; use dom::node::{document_from_node, Node, NodeDamage, window_from_node}; use dom_struct::dom_struct; -use euclid::matrix2d::Matrix2D; -use euclid::point::Point2D; -use euclid::rect::Rect; -use euclid::size::Size2D; +use euclid::{Transform2D, Point2D, Vector2D, Rect, Size2D, vec2}; use ipc_channel::ipc::{self, IpcSender}; use net_traits::image::base::PixelFormat; use net_traits::image_cache::ImageResponse; @@ -82,7 +79,7 @@ struct CanvasContextState { line_cap: LineCapStyle, line_join: LineJoinStyle, miter_limit: f64, - transform: Matrix2D<f32>, + transform: Transform2D<f32>, shadow_offset_x: f64, shadow_offset_y: f64, shadow_blur: f64, @@ -102,7 +99,7 @@ impl CanvasContextState { line_cap: LineCapStyle::Butt, line_join: LineJoinStyle::Miter, miter_limit: 10.0, - transform: Matrix2D::identity(), + transform: Transform2D::identity(), shadow_offset_x: 0.0, shadow_offset_y: 0.0, shadow_blur: 0.0, @@ -559,7 +556,7 @@ impl CanvasRenderingContext2DMethods for CanvasRenderingContext2D { } let transform = self.state.borrow().transform; - self.state.borrow_mut().transform = transform.pre_scaled(x as f32, y as f32); + self.state.borrow_mut().transform = transform.pre_scale(x as f32, y as f32); self.update_transform() } @@ -572,7 +569,7 @@ impl CanvasRenderingContext2DMethods for CanvasRenderingContext2D { let (sin, cos) = (angle.sin(), angle.cos()); let transform = self.state.borrow().transform; self.state.borrow_mut().transform = transform.pre_mul( - &Matrix2D::row_major(cos as f32, sin as f32, + &Transform2D::row_major(cos as f32, sin as f32, -sin as f32, cos as f32, 0.0, 0.0)); self.update_transform() @@ -585,7 +582,7 @@ impl CanvasRenderingContext2DMethods for CanvasRenderingContext2D { } let transform = self.state.borrow().transform; - self.state.borrow_mut().transform = transform.pre_translated(x as f32, y as f32); + self.state.borrow_mut().transform = transform.pre_translate(vec2(x as f32, y as f32)); self.update_transform() } @@ -598,7 +595,7 @@ impl CanvasRenderingContext2DMethods for CanvasRenderingContext2D { let transform = self.state.borrow().transform; self.state.borrow_mut().transform = transform.pre_mul( - &Matrix2D::row_major(a as f32, b as f32, c as f32, d as f32, e as f32, f as f32)); + &Transform2D::row_major(a as f32, b as f32, c as f32, d as f32, e as f32, f as f32)); self.update_transform() } @@ -610,13 +607,13 @@ impl CanvasRenderingContext2DMethods for CanvasRenderingContext2D { } self.state.borrow_mut().transform = - Matrix2D::row_major(a as f32, b as f32, c as f32, d as f32, e as f32, f as f32); + Transform2D::row_major(a as f32, b as f32, c as f32, d as f32, e as f32, f as f32); self.update_transform() } // https://html.spec.whatwg.org/multipage/#dom-context-2d-resettransform fn ResetTransform(&self) { - self.state.borrow_mut().transform = Matrix2D::identity(); + self.state.borrow_mut().transform = Transform2D::identity(); self.update_transform() } @@ -1079,7 +1076,7 @@ impl CanvasRenderingContext2DMethods for CanvasRenderingContext2D { dirty_width: Finite<f64>, dirty_height: Finite<f64>) { let data = imagedata.get_data_array(); - let offset = Point2D::new(*dx, *dy); + let offset = Vector2D::new(*dx, *dy); let image_data_size = Size2D::new(imagedata.Width() as f64, imagedata.Height() as f64); let dirty_rect = Rect::new(Point2D::new(*dirty_x, *dirty_y), diff --git a/components/script/dom/document.rs b/components/script/dom/document.rs index 39c617c8099..5db39cf4feb 100644 --- a/components/script/dom/document.rs +++ b/components/script/dom/document.rs @@ -92,7 +92,7 @@ use dom::windowproxy::WindowProxy; use dom_struct::dom_struct; use encoding::EncodingRef; use encoding::all::UTF_8; -use euclid::point::Point2D; +use euclid::{Point2D, Vector2D}; use html5ever::{LocalName, QualName}; use hyper::header::{Header, SetCookie}; use hyper_serde::Serde; @@ -865,7 +865,7 @@ impl Document { if let Some(iframe) = el.downcast::<HTMLIFrameElement>() { if let Some(pipeline_id) = iframe.pipeline_id() { let rect = iframe.upcast::<Element>().GetBoundingClientRect(); - let child_origin = Point2D::new(rect.X() as f32, rect.Y() as f32); + let child_origin = Vector2D::new(rect.X() as f32, rect.Y() as f32); let child_point = client_point - child_origin; let event = CompositorEvent::MouseButtonEvent(mouse_event_type, button, child_point); @@ -1020,7 +1020,7 @@ impl Document { if let Some(iframe) = el.downcast::<HTMLIFrameElement>() { if let Some(pipeline_id) = iframe.pipeline_id() { let rect = iframe.upcast::<Element>().GetBoundingClientRect(); - let child_origin = Point2D::new(rect.X() as f32, rect.Y() as f32); + let child_origin = Vector2D::new(rect.X() as f32, rect.Y() as f32); let child_point = client_point - child_origin; let event = CompositorEvent::TouchpadPressureEvent(child_point, @@ -1124,7 +1124,7 @@ impl Document { if let Some(iframe) = new_target.downcast::<HTMLIFrameElement>() { if let Some(pipeline_id) = iframe.pipeline_id() { let rect = iframe.upcast::<Element>().GetBoundingClientRect(); - let child_origin = Point2D::new(rect.X() as f32, rect.Y() as f32); + let child_origin = Vector2D::new(rect.X() as f32, rect.Y() as f32); let child_point = client_point - child_origin; let event = CompositorEvent::MouseMoveEvent(Some(child_point)); @@ -1231,7 +1231,7 @@ impl Document { if let Some(iframe) = el.downcast::<HTMLIFrameElement>() { if let Some(pipeline_id) = iframe.pipeline_id() { let rect = iframe.upcast::<Element>().GetBoundingClientRect(); - let child_origin = Point2D::new(rect.X() as f32, rect.Y() as f32); + let child_origin = Vector2D::new(rect.X() as f32, rect.Y() as f32); let child_point = point - child_origin; let event = CompositorEvent::TouchEvent(event_type, touch_id, child_point); diff --git a/components/script/dom/dommatrix.rs b/components/script/dom/dommatrix.rs index eb33d42efcf..3b262650bac 100644 --- a/components/script/dom/dommatrix.rs +++ b/components/script/dom/dommatrix.rs @@ -11,7 +11,7 @@ use dom::bindings::reflector::reflect_dom_object; use dom::dommatrixreadonly::{dommatrixinit_to_matrix, DOMMatrixReadOnly, entries_to_matrix}; use dom::globalscope::GlobalScope; use dom_struct::dom_struct; -use euclid::Matrix4D; +use euclid::Transform3D; #[dom_struct] @@ -21,12 +21,12 @@ pub struct DOMMatrix { impl DOMMatrix { #[allow(unrooted_must_root)] - pub fn new(global: &GlobalScope, is2D: bool, matrix: Matrix4D<f64>) -> Root<Self> { + pub fn new(global: &GlobalScope, is2D: bool, matrix: Transform3D<f64>) -> Root<Self> { let dommatrix = Self::new_inherited(is2D, matrix); reflect_dom_object(box dommatrix, global, Wrap) } - pub fn new_inherited(is2D: bool, matrix: Matrix4D<f64>) -> Self { + pub fn new_inherited(is2D: bool, matrix: Transform3D<f64>) -> Self { DOMMatrix { parent: DOMMatrixReadOnly::new_inherited(is2D, matrix) } diff --git a/components/script/dom/dommatrixreadonly.rs b/components/script/dom/dommatrixreadonly.rs index 875e8e6f42c..b31ce329ce2 100644 --- a/components/script/dom/dommatrixreadonly.rs +++ b/components/script/dom/dommatrixreadonly.rs @@ -14,25 +14,25 @@ use dom::dommatrix::DOMMatrix; use dom::dompoint::DOMPoint; use dom::globalscope::GlobalScope; use dom_struct::dom_struct; -use euclid::{Matrix4D, Point4D, Radians}; +use euclid::{Transform3D, Radians}; use std::cell::{Cell, Ref}; use std::f64; #[dom_struct] pub struct DOMMatrixReadOnly { reflector_: Reflector, - matrix: DOMRefCell<Matrix4D<f64>>, + matrix: DOMRefCell<Transform3D<f64>>, is2D: Cell<bool>, } impl DOMMatrixReadOnly { #[allow(unrooted_must_root)] - pub fn new(global: &GlobalScope, is2D: bool, matrix: Matrix4D<f64>) -> Root<Self> { + pub fn new(global: &GlobalScope, is2D: bool, matrix: Transform3D<f64>) -> Root<Self> { let dommatrix = Self::new_inherited(is2D, matrix); reflect_dom_object(box dommatrix, global, Wrap) } - pub fn new_inherited(is2D: bool, matrix: Matrix4D<f64>) -> Self { + pub fn new_inherited(is2D: bool, matrix: Transform3D<f64>) -> Self { DOMMatrixReadOnly { reflector_: Reflector::new(), matrix: DOMRefCell::new(matrix), @@ -42,7 +42,7 @@ impl DOMMatrixReadOnly { // https://drafts.fxtf.org/geometry-1/#dom-dommatrixreadonly-dommatrixreadonly pub fn Constructor(global: &GlobalScope) -> Fallible<Root<Self>> { - Ok(Self::new(global, true, Matrix4D::identity())) + Ok(Self::new(global, true, Transform3D::identity())) } // https://drafts.fxtf.org/geometry-1/#dom-dommatrixreadonly-dommatrixreadonly-numbersequence @@ -61,7 +61,7 @@ impl DOMMatrixReadOnly { }) } - pub fn matrix(&self) -> Ref<Matrix4D<f64>> { + pub fn matrix(&self) -> Ref<Transform3D<f64>> { self.matrix.borrow() } @@ -183,7 +183,7 @@ impl DOMMatrixReadOnly { // https://drafts.fxtf.org/geometry-1/#dom-dommatrix-translateself pub fn translate_self(&self, tx: f64, ty: f64, tz: f64) { // Step 1. - let translation = Matrix4D::create_translation(tx, ty, tz); + let translation = Transform3D::create_translation(tx, ty, tz); let mut matrix = self.matrix.borrow_mut(); *matrix = translation.post_mul(&matrix); // Step 2. @@ -202,7 +202,7 @@ impl DOMMatrixReadOnly { let scaleY = scaleY.unwrap_or(scaleX); // Step 3. { - let scale3D = Matrix4D::create_scale(scaleX, scaleY, scaleZ); + let scale3D = Transform3D::create_scale(scaleX, scaleY, scaleZ); let mut matrix = self.matrix.borrow_mut(); *matrix = scale3D.post_mul(&matrix); } @@ -225,7 +225,7 @@ impl DOMMatrixReadOnly { self.translate_self(originX, originY, originZ); // Step 2. { - let scale3D = Matrix4D::create_scale(scale, scale, scale); + let scale3D = Transform3D::create_scale(scale, scale, scale); let mut matrix = self.matrix.borrow_mut(); *matrix = scale3D.post_mul(&matrix); } @@ -256,19 +256,19 @@ impl DOMMatrixReadOnly { } if rotZ != 0.0 { // Step 5. - let rotation = Matrix4D::create_rotation(0.0, 0.0, 1.0, Radians::new(rotZ.to_radians())); + let rotation = Transform3D::create_rotation(0.0, 0.0, 1.0, Radians::new(rotZ.to_radians())); let mut matrix = self.matrix.borrow_mut(); *matrix = rotation.post_mul(&matrix); } if rotY != 0.0 { // Step 6. - let rotation = Matrix4D::create_rotation(0.0, 1.0, 0.0, Radians::new(rotY.to_radians())); + let rotation = Transform3D::create_rotation(0.0, 1.0, 0.0, Radians::new(rotY.to_radians())); let mut matrix = self.matrix.borrow_mut(); *matrix = rotation.post_mul(&matrix); } if rotX != 0.0 { // Step 7. - let rotation = Matrix4D::create_rotation(1.0, 0.0, 0.0, Radians::new(rotX.to_radians())); + let rotation = Transform3D::create_rotation(1.0, 0.0, 0.0, Radians::new(rotX.to_radians())); let mut matrix = self.matrix.borrow_mut(); *matrix = rotation.post_mul(&matrix); } @@ -281,7 +281,7 @@ impl DOMMatrixReadOnly { if y != 0.0 || x < 0.0 { // Step 1. let rotZ = Radians::new(f64::atan2(y, x)); - let rotation = Matrix4D::create_rotation(0.0, 0.0, 1.0, rotZ); + let rotation = Transform3D::create_rotation(0.0, 0.0, 1.0, rotZ); let mut matrix = self.matrix.borrow_mut(); *matrix = rotation.post_mul(&matrix); } @@ -292,7 +292,7 @@ impl DOMMatrixReadOnly { pub fn rotate_axis_angle_self(&self, x: f64, y: f64, z: f64, angle: f64) { // Step 1. let (norm_x, norm_y, norm_z) = normalize_point(x, y, z); - let rotation = Matrix4D::create_rotation(norm_x, norm_y, norm_z, Radians::new(angle.to_radians())); + let rotation = Transform3D::create_rotation(norm_x, norm_y, norm_z, Radians::new(angle.to_radians())); let mut matrix = self.matrix.borrow_mut(); *matrix = rotation.post_mul(&matrix); // Step 2. @@ -305,7 +305,7 @@ impl DOMMatrixReadOnly { // https://drafts.fxtf.org/geometry-1/#dom-dommatrix-skewxself pub fn skew_x_self(&self, sx: f64) { // Step 1. - let skew = Matrix4D::create_skew(Radians::new(sx.to_radians()), Radians::new(0.0)); + let skew = Transform3D::create_skew(Radians::new(sx.to_radians()), Radians::new(0.0)); let mut matrix = self.matrix.borrow_mut(); *matrix = skew.post_mul(&matrix); // Step 2 in DOMMatrix.SkewXSelf @@ -314,7 +314,7 @@ impl DOMMatrixReadOnly { // https://drafts.fxtf.org/geometry-1/#dom-dommatrix-skewyself pub fn skew_y_self(&self, sy: f64) { // Step 1. - let skew = Matrix4D::create_skew(Radians::new(0.0), Radians::new(sy.to_radians())); + let skew = Transform3D::create_skew(Radians::new(0.0), Radians::new(sy.to_radians())); let mut matrix = self.matrix.borrow_mut(); *matrix = skew.post_mul(&matrix); // Step 2 in DOMMatrix.SkewYSelf @@ -327,7 +327,7 @@ impl DOMMatrixReadOnly { *matrix = matrix.inverse().unwrap_or_else(|| { // Step 2. self.is2D.set(false); - Matrix4D::row_major(f64::NAN, f64::NAN, f64::NAN, f64::NAN, + Transform3D::row_major(f64::NAN, f64::NAN, f64::NAN, f64::NAN, f64::NAN, f64::NAN, f64::NAN, f64::NAN, f64::NAN, f64::NAN, f64::NAN, f64::NAN, f64::NAN, f64::NAN, f64::NAN, f64::NAN) @@ -513,7 +513,7 @@ impl DOMMatrixReadOnlyMethods for DOMMatrixReadOnly { // https://drafts.fxtf.org/geometry-1/#dom-dommatrixreadonly-flipx fn FlipX(&self) -> Root<DOMMatrix> { let is2D = self.is2D.get(); - let flip = Matrix4D::row_major(-1.0, 0.0, 0.0, 0.0, + let flip = Transform3D::row_major(-1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0); @@ -524,7 +524,7 @@ impl DOMMatrixReadOnlyMethods for DOMMatrixReadOnly { // https://drafts.fxtf.org/geometry-1/#dom-dommatrixreadonly-flipy fn FlipY(&self) -> Root<DOMMatrix> { let is2D = self.is2D.get(); - let flip = Matrix4D::row_major(1.0, 0.0, 0.0, 0.0, + let flip = Transform3D::row_major(1.0, 0.0, 0.0, 0.0, 0.0, -1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0); @@ -539,21 +539,26 @@ impl DOMMatrixReadOnlyMethods for DOMMatrixReadOnly { // https://drafts.fxtf.org/geometry-1/#dom-dommatrixreadonly-transformpoint fn TransformPoint(&self, point: &DOMPointInit) -> Root<DOMPoint> { - let matrix = self.matrix.borrow(); - let result = matrix.transform_point4d(&Point4D::new(point.x, point.y, point.z, point.w)); - DOMPoint::new( - &self.global(), - result.x as f64, - result.y as f64, - result.z as f64, - result.w as f64) + // Euclid always normalizes the homogeneous coordinate which is usually the right + // thing but may (?) not be compliant with the CSS matrix spec (or at least is + // probably not the behavior web authors will expect even if it is mathematically + // correct in the context of geometry computations). + // Since this is the only place where this is needed, better implement it here + // than in euclid (which does not have a notion of 4d points). + let mat = self.matrix.borrow(); + let x = point.x * mat.m11 + point.y * mat.m21 + point.z * mat.m31 + point.w * mat.m41; + let y = point.x * mat.m12 + point.y * mat.m22 + point.z * mat.m32 + point.w * mat.m42; + let z = point.x * mat.m13 + point.y * mat.m23 + point.z * mat.m33 + point.w * mat.m43; + let w = point.x * mat.m14 + point.y * mat.m24 + point.z * mat.m34 + point.w * mat.m44; + + DOMPoint::new(&self.global(), x, y, z, w) } } // https://drafts.fxtf.org/geometry-1/#create-a-2d-matrix -fn create_2d_matrix(entries: &[f64]) -> Matrix4D<f64> { - Matrix4D::row_major(entries[0], entries[1], 0.0, 0.0, +fn create_2d_matrix(entries: &[f64]) -> Transform3D<f64> { + Transform3D::row_major(entries[0], entries[1], 0.0, 0.0, entries[2], entries[3], 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, entries[4], entries[5], 0.0, 1.0) @@ -561,15 +566,15 @@ fn create_2d_matrix(entries: &[f64]) -> Matrix4D<f64> { // https://drafts.fxtf.org/geometry-1/#create-a-3d-matrix -fn create_3d_matrix(entries: &[f64]) -> Matrix4D<f64> { - Matrix4D::row_major(entries[0], entries[1], entries[2], entries[3], +fn create_3d_matrix(entries: &[f64]) -> Transform3D<f64> { + Transform3D::row_major(entries[0], entries[1], entries[2], entries[3], entries[4], entries[5], entries[6], entries[7], entries[8], entries[9], entries[10], entries[11], entries[12], entries[13], entries[14], entries[15]) } // https://drafts.fxtf.org/geometry-1/#dom-dommatrixreadonly-dommatrixreadonly-numbersequence -pub fn entries_to_matrix(entries: &[f64]) -> Fallible<(bool, Matrix4D<f64>)> { +pub fn entries_to_matrix(entries: &[f64]) -> Fallible<(bool, Transform3D<f64>)> { if entries.len() == 6 { Ok((true, create_2d_matrix(&entries))) } else if entries.len() == 16 { @@ -582,7 +587,7 @@ pub fn entries_to_matrix(entries: &[f64]) -> Fallible<(bool, Matrix4D<f64>)> { // https://drafts.fxtf.org/geometry-1/#validate-and-fixup -pub fn dommatrixinit_to_matrix(dict: &DOMMatrixInit) -> Fallible<(bool, Matrix4D<f64>)> { +pub fn dommatrixinit_to_matrix(dict: &DOMMatrixInit) -> Fallible<(bool, Transform3D<f64>)> { // Step 1. if dict.a.is_some() && dict.m11.is_some() && dict.a.unwrap() != dict.m11.unwrap() || dict.b.is_some() && dict.m12.is_some() && dict.b.unwrap() != dict.m12.unwrap() || @@ -621,7 +626,7 @@ pub fn dommatrixinit_to_matrix(dict: &DOMMatrixInit) -> Fallible<(bool, Matrix4D if is2D.is_none() { is2D = Some(true); } - let matrix = Matrix4D::row_major(m11, m12, dict.m13, dict.m14, + let matrix = Transform3D::row_major(m11, m12, dict.m13, dict.m14, m21, m22, dict.m23, dict.m24, dict.m31, dict.m32, dict.m33, dict.m34, m41, m42, dict.m43, dict.m44); diff --git a/components/script/dom/eventsource.rs b/components/script/dom/eventsource.rs index 81a2bc87584..4526384ebb5 100644 --- a/components/script/dom/eventsource.rs +++ b/components/script/dom/eventsource.rs @@ -16,7 +16,7 @@ use dom::eventtarget::EventTarget; use dom::globalscope::GlobalScope; use dom::messageevent::MessageEvent; use dom_struct::dom_struct; -use euclid::length::Length; +use euclid::Length; use hyper::header::{Accept, qitem}; use ipc_channel::ipc; use ipc_channel::router::ROUTER; diff --git a/components/script/dom/htmlareaelement.rs b/components/script/dom/htmlareaelement.rs index 548efbd43de..6826a188399 100644 --- a/components/script/dom/htmlareaelement.rs +++ b/components/script/dom/htmlareaelement.rs @@ -19,7 +19,7 @@ use dom::htmlelement::HTMLElement; use dom::node::{Node, document_from_node}; use dom::virtualmethods::VirtualMethods; use dom_struct::dom_struct; -use euclid::point::Point2D; +use euclid::Point2D; use html5ever::{LocalName, Prefix}; use net_traits::ReferrerPolicy; use std::default::Default; diff --git a/components/script/dom/htmlcanvaselement.rs b/components/script/dom/htmlcanvaselement.rs index c8956c1620b..2454b634040 100644 --- a/components/script/dom/htmlcanvaselement.rs +++ b/components/script/dom/htmlcanvaselement.rs @@ -26,7 +26,7 @@ use dom::node::{Node, window_from_node}; use dom::virtualmethods::VirtualMethods; use dom::webglrenderingcontext::{LayoutCanvasWebGLRenderingContextHelpers, WebGLRenderingContext}; use dom_struct::dom_struct; -use euclid::size::Size2D; +use euclid::Size2D; use html5ever::{LocalName, Prefix}; use image::ColorType; use image::png::PNGEncoder; diff --git a/components/script/dom/htmlimageelement.rs b/components/script/dom/htmlimageelement.rs index e1209021d35..0eaab8e58a4 100644 --- a/components/script/dom/htmlimageelement.rs +++ b/components/script/dom/htmlimageelement.rs @@ -35,7 +35,7 @@ use dom::values::UNSIGNED_LONG_MAX; use dom::virtualmethods::VirtualMethods; use dom::window::Window; use dom_struct::dom_struct; -use euclid::point::Point2D; +use euclid::Point2D; use html5ever::{LocalName, Prefix}; use ipc_channel::ipc; use ipc_channel::router::ROUTER; diff --git a/components/script/dom/imagedata.rs b/components/script/dom/imagedata.rs index 220ead847e8..a8a5e1ed4e7 100644 --- a/components/script/dom/imagedata.rs +++ b/components/script/dom/imagedata.rs @@ -10,7 +10,7 @@ use dom::bindings::js::Root; use dom::bindings::reflector::{Reflector, reflect_dom_object}; use dom::globalscope::GlobalScope; use dom_struct::dom_struct; -use euclid::size::Size2D; +use euclid::Size2D; use js::jsapi::{Heap, JSContext, JSObject}; use js::rust::Runtime; use js::typedarray::{Uint8ClampedArray, CreateWith}; diff --git a/components/script/dom/node.rs b/components/script/dom/node.rs index 32cb8054ee7..88ad070bba7 100644 --- a/components/script/dom/node.rs +++ b/components/script/dom/node.rs @@ -56,9 +56,7 @@ use dom::text::Text; use dom::virtualmethods::{VirtualMethods, vtable_for}; use dom::window::Window; use dom_struct::dom_struct; -use euclid::point::Point2D; -use euclid::rect::Rect; -use euclid::size::Size2D; +use euclid::{Point2D, Vector2D, Rect, Size2D}; use heapsize::{HeapSizeOf, heap_size_of}; use html5ever::{Prefix, Namespace, QualName}; use js::jsapi::{JSContext, JSObject, JSRuntime}; @@ -612,7 +610,7 @@ impl Node { } } - pub fn scroll_offset(&self) -> Point2D<f32> { + pub fn scroll_offset(&self) -> Vector2D<f32> { let document = self.owner_doc(); let window = document.window(); window.scroll_offset_query(self) diff --git a/components/script/dom/webglrenderingcontext.rs b/components/script/dom/webglrenderingcontext.rs index ce9b16a0598..3b8ee165bce 100644 --- a/components/script/dom/webglrenderingcontext.rs +++ b/components/script/dom/webglrenderingcontext.rs @@ -40,7 +40,7 @@ use dom::webgltexture::{TexParameterValue, WebGLTexture}; use dom::webgluniformlocation::WebGLUniformLocation; use dom::window::Window; use dom_struct::dom_struct; -use euclid::size::Size2D; +use euclid::Size2D; use half::f16; use ipc_channel::ipc::{self, IpcSender}; use js::conversions::ConversionBehavior; diff --git a/components/script/dom/window.rs b/components/script/dom/window.rs index c4ec3c07248..1f6a7c26eea 100644 --- a/components/script/dom/window.rs +++ b/components/script/dom/window.rs @@ -53,7 +53,7 @@ use dom::windowproxy::WindowProxy; use dom::worklet::Worklet; use dom::workletglobalscope::WorkletGlobalScopeType; use dom_struct::dom_struct; -use euclid::{Point2D, Rect, Size2D}; +use euclid::{Point2D, Vector2D, Rect, Size2D}; use fetch; use ipc_channel::ipc::{self, IpcSender}; use ipc_channel::router::ROUTER; @@ -255,7 +255,7 @@ pub struct Window { error_reporter: CSSErrorReporter, /// A list of scroll offsets for each scrollable element. - scroll_offsets: DOMRefCell<HashMap<UntrustedNodeAddress, Point2D<f32>>>, + scroll_offsets: DOMRefCell<HashMap<UntrustedNodeAddress, Vector2D<f32>>>, /// All the MediaQueryLists we need to update media_query_lists: WeakMediaQueryListVec, @@ -365,7 +365,7 @@ impl Window { /// Sets a new list of scroll offsets. /// /// This is called when layout gives us new ones and WebRender is in use. - pub fn set_scroll_offsets(&self, offsets: HashMap<UntrustedNodeAddress, Point2D<f32>>) { + pub fn set_scroll_offsets(&self, offsets: HashMap<UntrustedNodeAddress, Vector2D<f32>>) { *self.scroll_offsets.borrow_mut() = offsets } @@ -1155,7 +1155,7 @@ impl Window { self.layout_chan.send(Msg::UpdateScrollStateFromScript(ScrollState { scroll_root_id: scroll_root_id, - scroll_offset: Point2D::new(-x, -y), + scroll_offset: Vector2D::new(-x, -y), })).unwrap(); // TODO (farodin91): Raise an event to stop the current_viewport @@ -1449,7 +1449,7 @@ impl Window { self.layout_rpc.node_overflow().0.unwrap() } - pub fn scroll_offset_query(&self, node: &Node) -> Point2D<f32> { + pub fn scroll_offset_query(&self, node: &Node) -> Vector2D<f32> { let mut node = Root::from_ref(node); loop { if let Some(scroll_offset) = self.scroll_offsets @@ -1462,8 +1462,8 @@ impl Window { None => break, } } - let offset = self.current_viewport.get().origin; - Point2D::new(offset.x.to_f32_px(), offset.y.to_f32_px()) + let vp_origin = self.current_viewport.get().origin; + Vector2D::new(vp_origin.x.to_f32_px(), vp_origin.y.to_f32_px()) } // https://drafts.csswg.org/cssom-view/#dom-element-scroll diff --git a/components/script/dom/xmlhttprequest.rs b/components/script/dom/xmlhttprequest.rs index 362dad8a925..bd4af97d347 100644 --- a/components/script/dom/xmlhttprequest.rs +++ b/components/script/dom/xmlhttprequest.rs @@ -40,7 +40,7 @@ use dom_struct::dom_struct; use encoding::all::UTF_8; use encoding::label::encoding_from_whatwg_label; use encoding::types::{DecoderTrap, EncoderTrap, Encoding, EncodingRef}; -use euclid::length::Length; +use euclid::Length; use html5ever::serialize; use html5ever::serialize::SerializeOpts; use hyper::header::{ContentLength, ContentType, ContentEncoding}; diff --git a/components/script/script_thread.rs b/components/script/script_thread.rs index fcb351cebb2..941d80293f6 100644 --- a/components/script/script_thread.rs +++ b/components/script/script_thread.rs @@ -58,8 +58,7 @@ use dom::windowproxy::WindowProxy; use dom::worker::TrustedWorkerAddress; use dom::worklet::WorkletThreadPool; use dom::workletglobalscope::WorkletGlobalScopeInit; -use euclid::Rect; -use euclid::point::Point2D; +use euclid::{Point2D, Vector2D, Rect}; use hyper::header::{ContentType, HttpDate, Headers, LastModified}; use hyper::header::ReferrerPolicy as ReferrerPolicyHeader; use hyper::mime::{Mime, SubLevel, TopLevel}; @@ -1339,7 +1338,7 @@ impl ScriptThread { fn handle_set_scroll_state(&self, id: PipelineId, - scroll_states: &[(UntrustedNodeAddress, Point2D<f32>)]) { + scroll_states: &[(UntrustedNodeAddress, Vector2D<f32>)]) { let window = match { self.documents.borrow().find_window(id) } { Some(window) => window, None => return warn!("Set scroll state message sent to nonexistent pipeline: {:?}", id), @@ -1350,8 +1349,7 @@ impl ScriptThread { if node_address == UntrustedNodeAddress(ptr::null()) { window.update_viewport_for_scroll(-scroll_offset.x, -scroll_offset.y); } else { - scroll_offsets.insert(node_address, - Point2D::new(-scroll_offset.x, -scroll_offset.y)); + scroll_offsets.insert(node_address, -*scroll_offset); } } window.set_scroll_offsets(scroll_offsets) diff --git a/components/script/timers.rs b/components/script/timers.rs index cccefd5eb77..54b2d3f2519 100644 --- a/components/script/timers.rs +++ b/components/script/timers.rs @@ -12,7 +12,7 @@ use dom::eventsource::EventSourceTimeoutCallback; use dom::globalscope::GlobalScope; use dom::testbinding::TestBindingCallback; use dom::xmlhttprequest::XHRTimeoutCallback; -use euclid::length::Length; +use euclid::Length; use heapsize::HeapSizeOf; use ipc_channel::ipc::IpcSender; use js::jsapi::{HandleValue, Heap}; diff --git a/components/script/webdriver_handlers.rs b/components/script/webdriver_handlers.rs index 1aa2ad05dab..bae4480d14c 100644 --- a/components/script/webdriver_handlers.rs +++ b/components/script/webdriver_handlers.rs @@ -22,9 +22,7 @@ use dom::htmliframeelement::HTMLIFrameElement; use dom::htmlinputelement::HTMLInputElement; use dom::htmloptionelement::HTMLOptionElement; use dom::node::{Node, window_from_node}; -use euclid::point::Point2D; -use euclid::rect::Rect; -use euclid::size::Size2D; +use euclid::{Point2D, Rect, Size2D}; use hyper_serde::Serde; use ipc_channel::ipc::{self, IpcSender}; use js::jsapi::{HandleValue, JSContext}; diff --git a/components/script_layout_interface/Cargo.toml b/components/script_layout_interface/Cargo.toml index c2e7ae3ab6f..6fa9b81ad71 100644 --- a/components/script_layout_interface/Cargo.toml +++ b/components/script_layout_interface/Cargo.toml @@ -14,7 +14,7 @@ app_units = "0.4.1" atomic_refcell = "0.1" canvas_traits = {path = "../canvas_traits"} cssparser = "0.14.0" -euclid = "0.13" +euclid = "0.14.4" gfx_traits = {path = "../gfx_traits"} heapsize = "0.4" heapsize_derive = "0.1" diff --git a/components/script_layout_interface/message.rs b/components/script_layout_interface/message.rs index 104de7da3d9..84b93c527aa 100644 --- a/components/script_layout_interface/message.rs +++ b/components/script_layout_interface/message.rs @@ -4,8 +4,7 @@ use {OpaqueStyleAndLayoutData, TrustedNodeAddress, PendingImage}; use app_units::Au; -use euclid::point::Point2D; -use euclid::rect::Rect; +use euclid::{Point2D, Rect}; use gfx_traits::Epoch; use ipc_channel::ipc::{IpcReceiver, IpcSender}; use msg::constellation_msg::PipelineId; diff --git a/components/script_layout_interface/rpc.rs b/components/script_layout_interface/rpc.rs index a39e51d3633..00bad9705b2 100644 --- a/components/script_layout_interface/rpc.rs +++ b/components/script_layout_interface/rpc.rs @@ -3,8 +3,7 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ use app_units::Au; -use euclid::point::Point2D; -use euclid::rect::Rect; +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; diff --git a/components/script_traits/Cargo.toml b/components/script_traits/Cargo.toml index ac85cd782ec..ddcf1a3765f 100644 --- a/components/script_traits/Cargo.toml +++ b/components/script_traits/Cargo.toml @@ -15,7 +15,7 @@ bluetooth_traits = {path = "../bluetooth_traits"} canvas_traits = {path = "../canvas_traits"} cookie = "0.6" devtools_traits = {path = "../devtools_traits"} -euclid = "0.13" +euclid = "0.14.4" gfx_traits = {path = "../gfx_traits"} heapsize = "0.4" heapsize_derive = "0.1" @@ -25,7 +25,7 @@ ipc-channel = "0.7" libc = "0.2" msg = {path = "../msg"} net_traits = {path = "../net_traits"} -offscreen_gl_context = "0.8" +offscreen_gl_context = { version = "0.9", features = ["serde"] } profile_traits = {path = "../profile_traits"} rustc-serialize = "0.3.4" serde = "0.9" diff --git a/components/script_traits/lib.rs b/components/script_traits/lib.rs index 20433e4f45c..752d4e48b0a 100644 --- a/components/script_traits/lib.rs +++ b/components/script_traits/lib.rs @@ -44,12 +44,7 @@ pub mod webdriver_msg; use app_units::Au; use bluetooth_traits::BluetoothRequest; use devtools_traits::{DevtoolScriptControlMsg, ScriptToDevtoolsControlMsg, WorkerId}; -use euclid::Size2D; -use euclid::length::Length; -use euclid::point::Point2D; -use euclid::rect::Rect; -use euclid::scale_factor::ScaleFactor; -use euclid::size::TypedSize2D; +use euclid::{Size2D, Length, Point2D, Vector2D, Rect, ScaleFactor, TypedSize2D}; use gfx_traits::Epoch; use heapsize::HeapSizeOf; use hyper::header::Headers; @@ -254,7 +249,7 @@ pub enum ConstellationControlMsg { /// Notifies script of the viewport. Viewport(PipelineId, Rect<f32>), /// Notifies script of a new set of scroll offsets. - SetScrollState(PipelineId, Vec<(UntrustedNodeAddress, Point2D<f32>)>), + SetScrollState(PipelineId, Vec<(UntrustedNodeAddress, Vector2D<f32>)>), /// Requests that the script thread immediately send the constellation the title of a pipeline. GetTitle(PipelineId), /// Notifies script thread of a change to one of its document's activity @@ -690,7 +685,7 @@ pub struct ScrollState { /// The ID of the scroll root. pub scroll_root_id: ClipId, /// The scrolling offset of this stacking context. - pub scroll_offset: Point2D<f32>, + pub scroll_offset: Vector2D<f32>, } /// One hardware pixel. diff --git a/components/script_traits/script_msg.rs b/components/script_traits/script_msg.rs index d7449f70f29..b9e5b48b4b9 100644 --- a/components/script_traits/script_msg.rs +++ b/components/script_traits/script_msg.rs @@ -14,8 +14,7 @@ use WorkerGlobalScopeInit; use WorkerScriptLoadOrigin; use canvas_traits::CanvasMsg; use devtools_traits::{ScriptToDevtoolsControlMsg, WorkerId}; -use euclid::point::Point2D; -use euclid::size::{Size2D, TypedSize2D}; +use euclid::{Point2D, Size2D, TypedSize2D}; use ipc_channel::ipc::IpcSender; use msg::constellation_msg::{BrowsingContextId, TopLevelBrowsingContextId, FrameType, PipelineId, TraversalDirection}; use msg::constellation_msg::{Key, KeyModifiers, KeyState}; diff --git a/components/script_traits/webdriver_msg.rs b/components/script_traits/webdriver_msg.rs index ed7f2ea8f18..e53e6e77ae3 100644 --- a/components/script_traits/webdriver_msg.rs +++ b/components/script_traits/webdriver_msg.rs @@ -5,7 +5,7 @@ #![allow(missing_docs)] use cookie_rs::Cookie; -use euclid::rect::Rect; +use euclid::Rect; use hyper_serde::Serde; use ipc_channel::ipc::IpcSender; use msg::constellation_msg::BrowsingContextId; diff --git a/components/servo/Cargo.toml b/components/servo/Cargo.toml index 1b2fdc5a929..eafb5c92b5c 100644 --- a/components/servo/Cargo.toml +++ b/components/servo/Cargo.toml @@ -30,7 +30,7 @@ debugger = {path = "../debugger"} devtools = {path = "../devtools"} devtools_traits = {path = "../devtools_traits"} env_logger = "0.4" -euclid = "0.13" +euclid = "0.14.4" gfx = {path = "../gfx"} gleam = "0.4" ipc-channel = "0.7" diff --git a/components/style/Cargo.toml b/components/style/Cargo.toml index 1365cd68b73..0c8d02f510f 100644 --- a/components/style/Cargo.toml +++ b/components/style/Cargo.toml @@ -40,7 +40,7 @@ byteorder = "1.0" cfg-if = "0.1.0" cssparser = "0.14.0" encoding = {version = "0.2", optional = true} -euclid = "0.13" +euclid = "0.14.4" fnv = "1.0" heapsize = {version = "0.4", optional = true} heapsize_derive = {version = "0.1", optional = true} diff --git a/components/style/animation.rs b/components/style/animation.rs index f77cc8bfab6..3ee17b1872c 100644 --- a/components/style/animation.rs +++ b/components/style/animation.rs @@ -9,7 +9,7 @@ use Atom; use bezier::Bezier; use context::SharedStyleContext; use dom::OpaqueNode; -use euclid::point::Point2D; +use euclid::Point2D; use font_metrics::FontMetricsProvider; use properties::{self, CascadeFlags, ComputedValues, Importance}; use properties::animated_properties::{AnimatedProperty, TransitionProperty}; diff --git a/components/style/bezier.rs b/components/style/bezier.rs index 2bae08ac800..30f6f6735a2 100644 --- a/components/style/bezier.rs +++ b/components/style/bezier.rs @@ -8,7 +8,7 @@ #![deny(missing_docs)] -use euclid::point::Point2D; +use euclid::Point2D; const NEWTON_METHOD_ITERATIONS: u8 = 8; diff --git a/components/style/gecko_bindings/sugar/ns_timing_function.rs b/components/style/gecko_bindings/sugar/ns_timing_function.rs index f9a9948bf50..fbcde7ecd1e 100644 --- a/components/style/gecko_bindings/sugar/ns_timing_function.rs +++ b/components/style/gecko_bindings/sugar/ns_timing_function.rs @@ -2,7 +2,7 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -use euclid::point::{Point2D, TypedPoint2D}; +use euclid::{Point2D, TypedPoint2D}; use gecko_bindings::structs::{nsTimingFunction, nsTimingFunction_Type}; use std::mem; use values::computed::ToComputedValue; diff --git a/components/style/logical_geometry.rs b/components/style/logical_geometry.rs index bb7eb053b8e..999de01ea28 100644 --- a/components/style/logical_geometry.rs +++ b/components/style/logical_geometry.rs @@ -4,9 +4,8 @@ //! Geometry in flow-relative space. -use euclid::{Point2D, Rect, Size2D}; +use euclid::{Point2D, Rect, Size2D, SideOffsets2D}; use euclid::num::Zero; -use euclid::side_offsets::SideOffsets2D; use std::cmp::{max, min}; use std::fmt::{self, Debug, Error, Formatter}; use std::ops::{Add, Sub}; diff --git a/components/style/properties/properties.mako.rs b/components/style/properties/properties.mako.rs index 44d0d55a1c3..39f88f1dd6d 100644 --- a/components/style/properties/properties.mako.rs +++ b/components/style/properties/properties.mako.rs @@ -22,7 +22,7 @@ use app_units::Au; use cssparser::{Parser, TokenSerializationType, serialize_identifier}; use cssparser::ParserInput; use error_reporting::ParseErrorReporter; -#[cfg(feature = "servo")] use euclid::side_offsets::SideOffsets2D; +#[cfg(feature = "servo")] use euclid::SideOffsets2D; use computed_values; use context::QuirksMode; use font_metrics::FontMetricsProvider; diff --git a/components/style/stylesheets/viewport_rule.rs b/components/style/stylesheets/viewport_rule.rs index fdd8623a390..8f48ac15bb5 100644 --- a/components/style/stylesheets/viewport_rule.rs +++ b/components/style/stylesheets/viewport_rule.rs @@ -12,7 +12,7 @@ use context::QuirksMode; use cssparser::{AtRuleParser, DeclarationListParser, DeclarationParser, Parser, parse_important}; use cssparser::ToCss as ParserToCss; use error_reporting::ContextualParseError; -use euclid::size::TypedSize2D; +use euclid::TypedSize2D; use font_metrics::get_metrics_provider_for_product; use media_queries::Device; use parser::{Parse, ParserContext, log_css_error}; diff --git a/components/style/values/computed/mod.rs b/components/style/values/computed/mod.rs index ff682255d99..7b95372d8a7 100644 --- a/components/style/values/computed/mod.rs +++ b/components/style/values/computed/mod.rs @@ -6,7 +6,7 @@ use Atom; use context::QuirksMode; -use euclid::size::Size2D; +use euclid::Size2D; use font_metrics::FontMetricsProvider; use media_queries::Device; use num_traits::Zero; diff --git a/components/style/values/specified/length.rs b/components/style/values/specified/length.rs index a2662247d6f..d0eeacd9581 100644 --- a/components/style/values/specified/length.rs +++ b/components/style/values/specified/length.rs @@ -8,7 +8,7 @@ use app_units::Au; use cssparser::{Parser, Token, BasicParseError}; -use euclid::size::Size2D; +use euclid::Size2D; use font_metrics::FontMetricsQueryResult; use parser::{Parse, ParserContext}; use std::{cmp, fmt, mem}; diff --git a/components/style_traits/Cargo.toml b/components/style_traits/Cargo.toml index d668bc8984f..62a6a44337c 100644 --- a/components/style_traits/Cargo.toml +++ b/components/style_traits/Cargo.toml @@ -18,7 +18,7 @@ gecko = [] app_units = "0.4.1" bitflags = "0.7" cssparser = "0.14.0" -euclid = "0.13" +euclid = "0.14.4" heapsize = {version = "0.4", optional = true} heapsize_derive = {version = "0.1", optional = true} selectors = { path = "../selectors" } diff --git a/components/style_traits/viewport.rs b/components/style_traits/viewport.rs index 4bfaef849ac..c3061a30d22 100644 --- a/components/style_traits/viewport.rs +++ b/components/style_traits/viewport.rs @@ -6,7 +6,7 @@ use {CSSPixel, PinchZoomFactor, ParseError}; use cssparser::{Parser, ToCss, ParseError as CssParseError, BasicParseError}; -use euclid::size::TypedSize2D; +use euclid::TypedSize2D; use std::ascii::AsciiExt; use std::fmt; diff --git a/components/webdriver_server/Cargo.toml b/components/webdriver_server/Cargo.toml index 7038a7c30d4..cf835159f7a 100644 --- a/components/webdriver_server/Cargo.toml +++ b/components/webdriver_server/Cargo.toml @@ -12,7 +12,7 @@ path = "lib.rs" [dependencies] base64 = "0.5.2" cookie = "0.6" -euclid = "0.13" +euclid = "0.14" hyper = "0.10" image = "0.12" ipc-channel = "0.7" diff --git a/ports/cef/Cargo.toml b/ports/cef/Cargo.toml index 30fac2cefef..1b33193acbd 100644 --- a/ports/cef/Cargo.toml +++ b/ports/cef/Cargo.toml @@ -20,7 +20,7 @@ debugmozjs = ["libservo/debugmozjs"] [dependencies] compositing = {path = "../../components/compositing"} devtools = {path = "../../components/devtools"} -euclid = "0.13" +euclid = "0.14.4" gleam = "0.4" glutin_app = {path = "../glutin"} libc = "0.2" diff --git a/ports/cef/browser_host.rs b/ports/cef/browser_host.rs index 8d0c2d806f2..608ccfbad70 100644 --- a/ports/cef/browser_host.rs +++ b/ports/cef/browser_host.rs @@ -12,8 +12,7 @@ use webrender_traits::ScrollLocation; use wrappers::CefWrap; use compositing::windowing::{WindowEvent, MouseWindowEvent}; -use euclid::point::TypedPoint2D; -use euclid::size::TypedSize2D; +use euclid::{TypedPoint2D, TypedVector2D, TypedSize2D}; use libc::{c_double, c_int}; use msg::constellation_msg::{self, KeyModifiers, KeyState}; use script_traits::{MouseButton, TouchEventType}; @@ -470,7 +469,7 @@ full_cef_class_impl! { let event: &cef_mouse_event = event; let delta_x: c_int = delta_x; let delta_y: c_int = delta_y; - let delta = TypedPoint2D::new(delta_x as f32, delta_y as f32); + let delta = TypedVector2D::new(delta_x as f32, delta_y as f32); let origin = TypedPoint2D::new((*event).x as i32, (*event).y as i32); this.downcast().send_window_event(WindowEvent::Scroll(ScrollLocation::Delta(delta), origin, diff --git a/ports/cef/window.rs b/ports/cef/window.rs index 2bffd3b9cb9..03fd784fbd0 100644 --- a/ports/cef/window.rs +++ b/ports/cef/window.rs @@ -19,10 +19,7 @@ use wrappers::CefWrap; use compositing::compositor_thread::EventLoopWaker; use compositing::windowing::{WindowEvent, WindowMethods}; -use euclid::point::{Point2D, TypedPoint2D}; -use euclid::rect::TypedRect; -use euclid::scale_factor::ScaleFactor; -use euclid::size::{Size2D, TypedSize2D}; +use euclid::{Point2D, TypedPoint2D, TypedRect, Size2D, TypedSize2D, ScaleFactor}; use gleam::gl; use msg::constellation_msg::{Key, KeyModifiers}; use net_traits::net_error_list::NetError; diff --git a/ports/glutin/Cargo.toml b/ports/glutin/Cargo.toml index ed3965f0a6e..016ec8975fe 100644 --- a/ports/glutin/Cargo.toml +++ b/ports/glutin/Cargo.toml @@ -11,7 +11,7 @@ path = "lib.rs" [dependencies] bitflags = "0.7" compositing = {path = "../../components/compositing"} -euclid = "0.13" +euclid = "0.14.4" gleam = "0.4" log = "0.3.5" msg = {path = "../../components/msg"} diff --git a/ports/glutin/window.rs b/ports/glutin/window.rs index c735654bd95..47282e633c0 100644 --- a/ports/glutin/window.rs +++ b/ports/glutin/window.rs @@ -8,10 +8,7 @@ use NestedEventLoopListener; use compositing::compositor_thread::EventLoopWaker; use compositing::windowing::{MouseWindowEvent, WindowNavigateMsg}; use compositing::windowing::{WindowEvent, WindowMethods}; -use euclid::{Point2D, Size2D, TypedPoint2D}; -use euclid::rect::TypedRect; -use euclid::scale_factor::ScaleFactor; -use euclid::size::TypedSize2D; +use euclid::{Point2D, Size2D, TypedPoint2D, TypedVector2D, TypedRect, ScaleFactor, TypedSize2D}; #[cfg(target_os = "windows")] use gdi32; use gleam::gl; @@ -501,7 +498,7 @@ impl Window { MouseScrollDelta::LineDelta(dx, dy) => (dx, dy * LINE_HEIGHT), MouseScrollDelta::PixelDelta(dx, dy) => (dx, dy), }; - let scroll_location = ScrollLocation::Delta(TypedPoint2D::new(dx, dy)); + let scroll_location = ScrollLocation::Delta(TypedVector2D::new(dx, dy)); if let Some((x, y)) = pos { self.mouse_pos.set(Point2D::new(x, y)); self.event_queue.borrow_mut().push( @@ -1232,7 +1229,7 @@ impl WindowMethods for Window { } (NONE, None, Key::PageDown) => { - let scroll_location = ScrollLocation::Delta(TypedPoint2D::new(0.0, + let scroll_location = ScrollLocation::Delta(TypedVector2D::new(0.0, -self.framebuffer_size() .to_f32() .to_untyped() @@ -1241,7 +1238,7 @@ impl WindowMethods for Window { TouchEventType::Move); } (NONE, None, Key::PageUp) => { - let scroll_location = ScrollLocation::Delta(TypedPoint2D::new(0.0, + let scroll_location = ScrollLocation::Delta(TypedVector2D::new(0.0, self.framebuffer_size() .to_f32() .to_untyped() @@ -1259,18 +1256,18 @@ impl WindowMethods for Window { } (NONE, None, Key::Up) => { - self.scroll_window(ScrollLocation::Delta(TypedPoint2D::new(0.0, 3.0 * LINE_HEIGHT)), + self.scroll_window(ScrollLocation::Delta(TypedVector2D::new(0.0, 3.0 * LINE_HEIGHT)), TouchEventType::Move); } (NONE, None, Key::Down) => { - self.scroll_window(ScrollLocation::Delta(TypedPoint2D::new(0.0, -3.0 * LINE_HEIGHT)), + self.scroll_window(ScrollLocation::Delta(TypedVector2D::new(0.0, -3.0 * LINE_HEIGHT)), TouchEventType::Move); } (NONE, None, Key::Left) => { - self.scroll_window(ScrollLocation::Delta(TypedPoint2D::new(LINE_HEIGHT, 0.0)), TouchEventType::Move); + self.scroll_window(ScrollLocation::Delta(TypedVector2D::new(LINE_HEIGHT, 0.0)), TouchEventType::Move); } (NONE, None, Key::Right) => { - self.scroll_window(ScrollLocation::Delta(TypedPoint2D::new(-LINE_HEIGHT, 0.0)), TouchEventType::Move); + self.scroll_window(ScrollLocation::Delta(TypedVector2D::new(-LINE_HEIGHT, 0.0)), TouchEventType::Move); } (CMD_OR_CONTROL, Some('r'), _) => { if let Some(true) = PREFS.get("shell.builtin-key-shortcuts.enabled").as_boolean() { diff --git a/python/tidy/servo_tidy_tests/rust_tidy.rs b/python/tidy/servo_tidy_tests/rust_tidy.rs index bb1b4e00572..32c2547e502 100644 --- a/python/tidy/servo_tidy_tests/rust_tidy.rs +++ b/python/tidy/servo_tidy_tests/rust_tidy.rs @@ -6,7 +6,7 @@ use app_units::Au; use azure::azure_hl::{ AntialiasMode, Color, ColorPattern, CompositionOp }; use azure::azure_hl::{AntialiasMode, Color, ColorPattern, CompositionOp}; -use euclid::size::Size2D; +use euclid::Size2D; use azure::azure::AzIntSize; use azure::azure::{AzIntSize}; diff --git a/tests/unit/script/Cargo.toml b/tests/unit/script/Cargo.toml index 1334602ba23..ef69a32e077 100644 --- a/tests/unit/script/Cargo.toml +++ b/tests/unit/script/Cargo.toml @@ -10,7 +10,7 @@ path = "lib.rs" doctest = false [dependencies] -euclid = "0.13" +euclid = "0.14.4" msg = {path = "../../../components/msg"} script = {path = "../../../components/script"} servo_url = {path = "../../../components/url"} diff --git a/tests/unit/script/htmlareaelement.rs b/tests/unit/script/htmlareaelement.rs index b7257e8b540..f4c77cc7fef 100644 --- a/tests/unit/script/htmlareaelement.rs +++ b/tests/unit/script/htmlareaelement.rs @@ -7,7 +7,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -use euclid::point::Point2D; +use euclid::Point2D; use script::test::area::{Area, Shape}; #[test] diff --git a/tests/unit/style/Cargo.toml b/tests/unit/style/Cargo.toml index a6034059a7f..6479220fff1 100644 --- a/tests/unit/style/Cargo.toml +++ b/tests/unit/style/Cargo.toml @@ -16,7 +16,7 @@ testing = ["style/testing"] byteorder = "1.0" app_units = "0.4.1" cssparser = "0.14.0" -euclid = "0.13" +euclid = "0.14.4" html5ever = "0.17" parking_lot = "0.3" rayon = "0.7" diff --git a/tests/unit/style/media_queries.rs b/tests/unit/style/media_queries.rs index d4c2c69d054..62478a34b1c 100644 --- a/tests/unit/style/media_queries.rs +++ b/tests/unit/style/media_queries.rs @@ -3,7 +3,7 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ use cssparser::{Parser, SourcePosition}; -use euclid::size::TypedSize2D; +use euclid::TypedSize2D; use servo_url::ServoUrl; use std::borrow::ToOwned; use style::Atom; diff --git a/tests/unit/style/parsing/mod.rs b/tests/unit/style/parsing/mod.rs index c0c357b390a..12cfe611992 100644 --- a/tests/unit/style/parsing/mod.rs +++ b/tests/unit/style/parsing/mod.rs @@ -5,7 +5,7 @@ //! Tests for parsing and serialization of values/properties use cssparser::{Parser, ParserInput}; -use euclid::size::TypedSize2D; +use euclid::TypedSize2D; use media_queries::CSSErrorReporterTest; use style::context::QuirksMode; use style::font_metrics::ServoMetricsProvider; diff --git a/tests/unit/style/viewport.rs b/tests/unit/style/viewport.rs index f3903f35fc5..e6c8df4aaf4 100644 --- a/tests/unit/style/viewport.rs +++ b/tests/unit/style/viewport.rs @@ -3,7 +3,7 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ use cssparser::{Parser, ParserInput}; -use euclid::size::TypedSize2D; +use euclid::TypedSize2D; use media_queries::CSSErrorReporterTest; use servo_config::prefs::{PREFS, PrefValue}; use servo_url::ServoUrl; diff --git a/tests/unit/stylo/Cargo.toml b/tests/unit/stylo/Cargo.toml index 0d0bb5c6ea5..cdde7ccb063 100644 --- a/tests/unit/stylo/Cargo.toml +++ b/tests/unit/stylo/Cargo.toml @@ -18,7 +18,7 @@ testing = ["style/testing"] atomic_refcell = "0.1" cssparser = "0.14.0" env_logger = "0.4" -euclid = "0.13" +euclid = "0.14.4" geckoservo = {path = "../../../ports/geckolib"} libc = "0.2" log = {version = "0.3.5", features = ["release_max_level_info"]} |