Bump euclid to 0.22

- Also updates raqote to latest with an upgrade of font-kit to 0.11
  applied on as a patch
- Update lyon_geom to the latest version

Major change:

- All matrices are now stored in row major order. This means that
  parameters to rotation functions no longer should be negated.
- `post_...()` functions are now named `then()`. `pre_transform()` is removed,
  so `then()` is used and the order of operations changed.
This commit is contained in:
Martin Robinson 2023-01-16 17:46:27 +01:00
parent 4f355f5877
commit 423cc34cb0
56 changed files with 233 additions and 220 deletions

82
Cargo.lock generated
View file

@ -591,7 +591,7 @@ dependencies = [
"half", "half",
"ipc-channel", "ipc-channel",
"log", "log",
"lyon_geom 0.14.1", "lyon_geom 1.0.4",
"num-traits", "num-traits",
"pathfinder_geometry", "pathfinder_geometry",
"pixels", "pixels",
@ -1652,9 +1652,9 @@ dependencies = [
[[package]] [[package]]
name = "euclid" name = "euclid"
version = "0.20.14" version = "0.22.7"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2bb7ef65b3777a325d1eeefefab5b6d4959da54747e33bd6258e789640f307ad" checksum = "b52c2ef4a78da0ba68fbe1fd920627411096d2ac478f7f4c9f3a54ba6705bade"
dependencies = [ dependencies = [
"num-traits", "num-traits",
"serde", "serde",
@ -3427,6 +3427,12 @@ dependencies = [
"winapi", "winapi",
] ]
[[package]]
name = "libm"
version = "0.2.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "348108ab3fba42ec82ff6e9564fc4ca0247bdccdc68dd8af9764bbc79c3c8ffb"
[[package]] [[package]]
name = "libmlservo" name = "libmlservo"
version = "0.0.1" version = "0.0.1"
@ -3555,22 +3561,22 @@ dependencies = [
[[package]] [[package]]
name = "lyon_geom" name = "lyon_geom"
version = "0.14.1" version = "0.17.7"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ca04310c9807612a311506106000b6eccb2e27bca9bfb594ce80fb8a31231f9d" checksum = "71d89ccbdafd83d259403e22061be27bccc3254bba65cdc5303250c4227c8c8e"
dependencies = [ dependencies = [
"arrayvec 0.4.12", "arrayvec 0.5.1",
"euclid", "euclid",
"num-traits", "num-traits",
] ]
[[package]] [[package]]
name = "lyon_geom" name = "lyon_geom"
version = "0.15.0" version = "1.0.4"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9e2a8bde54788e0eb4f1b9f072910bfa1cba95688698f7bb206d13a2f8fd06b3" checksum = "74df1ff0a0147282eb10699537a03baa7d31972b58984a1d44ce0624043fe8ad"
dependencies = [ dependencies = [
"arrayvec 0.5.1", "arrayvec 0.7.1",
"euclid", "euclid",
"num-traits", "num-traits",
] ]
@ -4304,6 +4310,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9a64b1ec5cda2586e284722486d802acf1f7dbdc623e2bfc57e65ca1cd099290" checksum = "9a64b1ec5cda2586e284722486d802acf1f7dbdc623e2bfc57e65ca1cd099290"
dependencies = [ dependencies = [
"autocfg", "autocfg",
"libm",
] ]
[[package]] [[package]]
@ -4613,7 +4620,7 @@ dependencies = [
[[package]] [[package]]
name = "peek-poke" name = "peek-poke"
version = "0.2.0" version = "0.2.0"
source = "git+https://github.com/jdm/webrender?branch=crash-backtrace#920168aff79a7cf52980b0c90965a591f2f4204a" source = "git+https://github.com/jdm/webrender?branch=crash-backtrace#415b9ba32648667313f6f4ce7965752285bf0b26"
dependencies = [ dependencies = [
"euclid", "euclid",
"peek-poke-derive", "peek-poke-derive",
@ -4622,7 +4629,7 @@ dependencies = [
[[package]] [[package]]
name = "peek-poke-derive" name = "peek-poke-derive"
version = "0.2.1" version = "0.2.1"
source = "git+https://github.com/jdm/webrender?branch=crash-backtrace#920168aff79a7cf52980b0c90965a591f2f4204a" source = "git+https://github.com/jdm/webrender?branch=crash-backtrace#415b9ba32648667313f6f4ce7965752285bf0b26"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
@ -4840,9 +4847,9 @@ checksum = "1df8c4ec4b0627e53bdf214615ad287367e482558cf84b109250b37464dc03ae"
[[package]] [[package]]
name = "plane-split" name = "plane-split"
version = "0.15.0" version = "0.17.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ffe16a646a08f4b4dd74035b9ff8e378eb1a4012a74f14f5889e7001cdbece33" checksum = "f3f7075ec146b897b6e0faca47adeb7ed3d4f6eaa8145bf19db17311081b3f63"
dependencies = [ dependencies = [
"binary-space-partition", "binary-space-partition",
"euclid", "euclid",
@ -5088,14 +5095,14 @@ checksum = "a871f1e45a3a3f0c73fb60343c811238bb5143a81642e27c2ac7aac27ff01a63"
[[package]] [[package]]
name = "raqote" name = "raqote"
version = "0.8.1-alpha.0" version = "0.8.2"
source = "git+https://github.com/jdm/raqote?branch=fkup#5a650714ea20f44ebe14de9fce60eeef100144c1" source = "git+https://github.com/jrmuizel/raqote#7b235e9a7721d5db6dbfd82ec69e390111653081"
dependencies = [ dependencies = [
"euclid", "euclid",
"font-kit", "font-kit",
"lyon_geom 0.15.0", "lyon_geom 0.17.7",
"pathfinder_geometry", "pathfinder_geometry",
"png 0.16.6", "png 0.17.7",
"sw-composite", "sw-composite",
"typed-arena", "typed-arena",
] ]
@ -5686,7 +5693,7 @@ dependencies = [
[[package]] [[package]]
name = "servo-media" name = "servo-media"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/servo/media#1ccb9c7ce0acc2637c84f31a1204b1d5798993b9" source = "git+https://github.com/servo/media#f53ac0a03a1413362e15d39d1527466986d13c94"
dependencies = [ dependencies = [
"servo-media-audio", "servo-media-audio",
"servo-media-player", "servo-media-player",
@ -5697,8 +5704,8 @@ dependencies = [
[[package]] [[package]]
name = "servo-media-audio" name = "servo-media-audio"
version = "0.1.0" version = "0.2.0"
source = "git+https://github.com/servo/media#1ccb9c7ce0acc2637c84f31a1204b1d5798993b9" source = "git+https://github.com/servo/media#f53ac0a03a1413362e15d39d1527466986d13c94"
dependencies = [ dependencies = [
"boxfnonce", "boxfnonce",
"byte-slice-cast", "byte-slice-cast",
@ -5807,7 +5814,7 @@ dependencies = [
[[package]] [[package]]
name = "servo-media-player" name = "servo-media-player"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/servo/media#1ccb9c7ce0acc2637c84f31a1204b1d5798993b9" source = "git+https://github.com/servo/media#f53ac0a03a1413362e15d39d1527466986d13c94"
dependencies = [ dependencies = [
"ipc-channel", "ipc-channel",
"serde", "serde",
@ -5819,7 +5826,7 @@ dependencies = [
[[package]] [[package]]
name = "servo-media-streams" name = "servo-media-streams"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/servo/media#1ccb9c7ce0acc2637c84f31a1204b1d5798993b9" source = "git+https://github.com/servo/media#f53ac0a03a1413362e15d39d1527466986d13c94"
dependencies = [ dependencies = [
"lazy_static", "lazy_static",
"uuid", "uuid",
@ -5828,12 +5835,12 @@ dependencies = [
[[package]] [[package]]
name = "servo-media-traits" name = "servo-media-traits"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/servo/media#1ccb9c7ce0acc2637c84f31a1204b1d5798993b9" source = "git+https://github.com/servo/media#f53ac0a03a1413362e15d39d1527466986d13c94"
[[package]] [[package]]
name = "servo-media-webrtc" name = "servo-media-webrtc"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/servo/media#1ccb9c7ce0acc2637c84f31a1204b1d5798993b9" source = "git+https://github.com/servo/media#f53ac0a03a1413362e15d39d1527466986d13c94"
dependencies = [ dependencies = [
"boxfnonce", "boxfnonce",
"lazy_static", "lazy_static",
@ -5911,7 +5918,7 @@ dependencies = [
[[package]] [[package]]
name = "servo_media_derive" name = "servo_media_derive"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/servo/media#1ccb9c7ce0acc2637c84f31a1204b1d5798993b9" source = "git+https://github.com/servo/media#f53ac0a03a1413362e15d39d1527466986d13c94"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
@ -6370,9 +6377,9 @@ dependencies = [
[[package]] [[package]]
name = "surfman" name = "surfman"
version = "0.4.4" version = "0.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e70e69faf378eeb7b44044ab434a06672e0bd495d32a47d84a097e69dd994985" checksum = "ab6e313fe157a4f6ecdaff1aa5f866a3191509bf4e1f49ededefce62ccc4a4bb"
dependencies = [ dependencies = [
"bitflags", "bitflags",
"cfg_aliases", "cfg_aliases",
@ -6401,9 +6408,8 @@ dependencies = [
[[package]] [[package]]
name = "surfman-chains" name = "surfman-chains"
version = "0.6.0" version = "0.7.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "git+https://github.com/servo/surfman-chains.git#f7b30e8736501fe3d326f1c41e7ae0a2bca4e818"
checksum = "99e707090691623a80d36f4faaba50105cc7a611eda51b0312b53eeec36a0a25"
dependencies = [ dependencies = [
"euclid", "euclid",
"fnv", "fnv",
@ -6427,9 +6433,9 @@ checksum = "c666f0fed8e1e20e057af770af9077d72f3d5a33157b8537c1475dd8ffd6d32b"
[[package]] [[package]]
name = "sw-composite" name = "sw-composite"
version = "0.7.14" version = "0.7.15"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e39674047b1748e8bf4865142772a6637bd32d8b4b27e3c2248dd122f637808b" checksum = "0b8d4f1dd38540e3f62c393ae78e874c94491c403025368183b018e3fb098b1f"
[[package]] [[package]]
name = "swapper" name = "swapper"
@ -7311,7 +7317,7 @@ dependencies = [
[[package]] [[package]]
name = "webrender" name = "webrender"
version = "0.61.0" version = "0.61.0"
source = "git+https://github.com/jdm/webrender?branch=crash-backtrace#920168aff79a7cf52980b0c90965a591f2f4204a" source = "git+https://github.com/jdm/webrender?branch=crash-backtrace#415b9ba32648667313f6f4ce7965752285bf0b26"
dependencies = [ dependencies = [
"backtrace", "backtrace",
"base64 0.10.1", "base64 0.10.1",
@ -7355,7 +7361,7 @@ dependencies = [
[[package]] [[package]]
name = "webrender_api" name = "webrender_api"
version = "0.61.0" version = "0.61.0"
source = "git+https://github.com/jdm/webrender?branch=crash-backtrace#920168aff79a7cf52980b0c90965a591f2f4204a" source = "git+https://github.com/jdm/webrender?branch=crash-backtrace#415b9ba32648667313f6f4ce7965752285bf0b26"
dependencies = [ dependencies = [
"app_units", "app_units",
"bitflags", "bitflags",
@ -7376,7 +7382,7 @@ dependencies = [
[[package]] [[package]]
name = "webrender_build" name = "webrender_build"
version = "0.0.1" version = "0.0.1"
source = "git+https://github.com/jdm/webrender?branch=crash-backtrace#920168aff79a7cf52980b0c90965a591f2f4204a" source = "git+https://github.com/jdm/webrender?branch=crash-backtrace#415b9ba32648667313f6f4ce7965752285bf0b26"
dependencies = [ dependencies = [
"bitflags", "bitflags",
"lazy_static", "lazy_static",
@ -7402,7 +7408,7 @@ dependencies = [
[[package]] [[package]]
name = "webxr" name = "webxr"
version = "0.0.1" version = "0.0.1"
source = "git+https://github.com/servo/webxr#4eb957ac4f0e22ac5baded31eb86eea32862d687" source = "git+https://github.com/servo/webxr#3d82ad985764c35aaf389ce83b5f9ba909c23f53"
dependencies = [ dependencies = [
"android_injected_glue", "android_injected_glue",
"bindgen", "bindgen",
@ -7425,7 +7431,7 @@ dependencies = [
[[package]] [[package]]
name = "webxr-api" name = "webxr-api"
version = "0.0.1" version = "0.0.1"
source = "git+https://github.com/servo/webxr#4eb957ac4f0e22ac5baded31eb86eea32862d687" source = "git+https://github.com/servo/webxr#3d82ad985764c35aaf389ce83b5f9ba909c23f53"
dependencies = [ dependencies = [
"euclid", "euclid",
"ipc-channel", "ipc-channel",
@ -7627,7 +7633,7 @@ dependencies = [
[[package]] [[package]]
name = "wr_malloc_size_of" name = "wr_malloc_size_of"
version = "0.0.1" version = "0.0.1"
source = "git+https://github.com/jdm/webrender?branch=crash-backtrace#920168aff79a7cf52980b0c90965a591f2f4204a" source = "git+https://github.com/jdm/webrender?branch=crash-backtrace#415b9ba32648667313f6f4ce7965752285bf0b26"
dependencies = [ dependencies = [
"app_units", "app_units",
"euclid", "euclid",

View file

@ -30,9 +30,8 @@ opt-level = 3
mio = { git = "https://github.com/servo/mio.git", branch = "servo-mio-0.6.22" } mio = { git = "https://github.com/servo/mio.git", branch = "servo-mio-0.6.22" }
# Work around bug in winit 0.24 crashing servo headless in macOS # Work around bug in winit 0.24 crashing servo headless in macOS
winit = { git = "https://github.com/rust-windowing/winit.git", rev = "4192d04a53202c199f94d1b7d883a34c9ad09272" } winit = { git = "https://github.com/rust-windowing/winit.git", rev = "4192d04a53202c199f94d1b7d883a34c9ad09272" }
# surfman-chains has not yet released version 0.7 to crates.io yet.
[patch."https://github.com/jrmuizel/raqote"] surfman-chains = { git = "https://github.com/servo/surfman-chains.git" }
raqote = { git = "https://github.com/jdm/raqote", branch = "fkup" }
# https://github.com/servo/servo/issues/27515#issuecomment-671474054 # https://github.com/servo/servo/issues/27515#issuecomment-671474054
[patch."https://github.com/servo/webrender"] [patch."https://github.com/servo/webrender"]

View file

@ -21,7 +21,7 @@ byteorder = "1"
canvas_traits = { path = "../canvas_traits" } canvas_traits = { path = "../canvas_traits" }
crossbeam-channel = "0.4" crossbeam-channel = "0.4"
cssparser = "0.29" cssparser = "0.29"
euclid = "0.20" euclid = "0.22"
font-kit = "0.11" font-kit = "0.11"
fnv = "1.0" fnv = "1.0"
gfx = { path = "../gfx" } gfx = { path = "../gfx" }
@ -29,7 +29,7 @@ gleam = "0.12"
half = "1" half = "1"
ipc-channel = "0.14" ipc-channel = "0.14"
log = "0.4" log = "0.4"
lyon_geom = "0.14" lyon_geom = "1.0.4"
num-traits = "0.2" num-traits = "0.2"
pathfinder_geometry = "0.5" pathfinder_geometry = "0.5"
pixels = { path = "../pixels" } pixels = { path = "../pixels" }
@ -40,8 +40,8 @@ sparkle = "0.1.25"
style = { path = "../style" } style = { path = "../style" }
style_traits = { path = "../style_traits" } style_traits = { path = "../style_traits" }
# NOTE: the sm-angle feature only enables angle on windows, not other platforms! # NOTE: the sm-angle feature only enables angle on windows, not other platforms!
surfman = { version = "0.4", features = ["sm-angle","sm-angle-default"] } surfman = { version = "0.5", features = ["sm-angle","sm-angle-default"] }
surfman-chains = "0.6" surfman-chains = "0.7"
surfman-chains-api = "0.2" surfman-chains-api = "0.2"
time = { version = "0.1.41", optional = true } time = { version = "0.1.41", optional = true }
webrender = { git = "https://github.com/servo/webrender" } webrender = { git = "https://github.com/servo/webrender" }

View file

@ -1213,9 +1213,9 @@ impl<'a> CanvasData<'a> {
), ),
self.drawtarget.get_format(), self.drawtarget.get_format(),
); );
let matrix = Transform2D::identity() let matrix = self.state.transform.then(
.pre_translate(-source_rect.origin.to_vector().cast::<f32>()) &Transform2D::identity().pre_translate(-source_rect.origin.to_vector().cast::<f32>()),
.pre_transform(&self.state.transform); );
draw_target.set_transform(&matrix); draw_target.set_transform(&matrix);
draw_target draw_target
} }
@ -1224,7 +1224,7 @@ impl<'a> CanvasData<'a> {
where where
F: FnOnce(&mut dyn GenericDrawTarget), F: FnOnce(&mut dyn GenericDrawTarget),
{ {
let shadow_src_rect = self.state.transform.transform_rect(rect); let shadow_src_rect = self.state.transform.outer_transformed_rect(rect);
let mut new_draw_target = self.create_draw_target_for_shadow(&shadow_src_rect); let mut new_draw_target = self.create_draw_target_for_shadow(&shadow_src_rect);
draw_shadow_source(&mut *new_draw_target); draw_shadow_source(&mut *new_draw_target);
self.drawtarget.draw_surface_with_shadow( self.drawtarget.draw_surface_with_shadow(

View file

@ -445,8 +445,8 @@ impl GenericDrawTarget for raqote::DrawTarget {
Repetition::NoRepeat, Repetition::NoRepeat,
)); ));
let transform = let transform =
raqote::Transform::create_translation(-dest.origin.x as f32, -dest.origin.y as f32) raqote::Transform::translation(-dest.origin.x as f32, -dest.origin.y as f32)
.post_scale( .then_scale(
image.width as f32 / dest.size.width as f32, image.width as f32 / dest.size.width as f32,
image.height as f32 / dest.size.height as f32, image.height as f32 / dest.size.height as f32,
); );

View file

@ -606,7 +606,7 @@ impl WebGLThread {
let size = clamp_viewport(&gl, requested_size); let size = clamp_viewport(&gl, requested_size);
if safe_size != size { if safe_size != size {
debug!("Resizing swap chain from {} to {}", safe_size, size); debug!("Resizing swap chain from {:?} to {:?}", safe_size, size);
swap_chain swap_chain
.resize(&mut self.device, &mut ctx, size.to_i32()) .resize(&mut self.device, &mut ctx, size.to_i32())
.map_err(|err| format!("Failed to resize swap chain: {:?}", err))?; .map_err(|err| format!("Failed to resize swap chain: {:?}", err))?;

View file

@ -17,7 +17,7 @@ xr-profile = ["webxr-api/profile", "time"]
[dependencies] [dependencies]
crossbeam-channel = "0.4" crossbeam-channel = "0.4"
cssparser = "0.29" cssparser = "0.29"
euclid = "0.20" euclid = "0.22"
ipc-channel = "0.14" ipc-channel = "0.14"
lazy_static = "1" lazy_static = "1"
malloc_size_of = { path = "../malloc_size_of" } malloc_size_of = { path = "../malloc_size_of" }

View file

@ -19,7 +19,7 @@ gl = ["gleam", "pixels"]
canvas = { path = "../canvas" } canvas = { path = "../canvas" }
crossbeam-channel = "0.4" crossbeam-channel = "0.4"
embedder_traits = { path = "../embedder_traits" } embedder_traits = { path = "../embedder_traits" }
euclid = "0.20" euclid = "0.22"
gfx_traits = { path = "../gfx_traits" } gfx_traits = { path = "../gfx_traits" }
gleam = { version = "0.12", optional = true } gleam = { version = "0.12", optional = true }
image = "0.24" image = "0.24"

View file

@ -15,7 +15,7 @@ path = "lib.rs"
[dependencies] [dependencies]
embedder_traits = { path = "../embedder_traits" } embedder_traits = { path = "../embedder_traits" }
euclid = "0.20" euclid = "0.22"
getopts = "0.2.11" getopts = "0.2.11"
lazy_static = "1" lazy_static = "1"
log = "0.4" log = "0.4"

View file

@ -19,7 +19,7 @@ compositing = { path = "../compositing" }
crossbeam-channel = "0.4" crossbeam-channel = "0.4"
devtools_traits = { path = "../devtools_traits" } devtools_traits = { path = "../devtools_traits" }
embedder_traits = { path = "../embedder_traits" } embedder_traits = { path = "../embedder_traits" }
euclid = "0.20" euclid = "0.22"
gfx = { path = "../gfx" } gfx = { path = "../gfx" }
gfx_traits = { path = "../gfx_traits" } gfx_traits = { path = "../gfx_traits" }
http = "0.2" http = "0.2"

View file

@ -12,7 +12,7 @@ path = "lib.rs"
[dependencies] [dependencies]
app_units = "0.7" app_units = "0.7"
euclid = "0.20" euclid = "0.22"
malloc_size_of = { path = "../malloc_size_of" } malloc_size_of = { path = "../malloc_size_of" }
malloc_size_of_derive = "0.1" malloc_size_of_derive = "0.1"
webrender_api = { git = "https://github.com/servo/webrender" } webrender_api = { git = "https://github.com/servo/webrender" }

View file

@ -16,7 +16,7 @@ doctest = false
[dependencies] [dependencies]
app_units = "0.7" app_units = "0.7"
bitflags = "1.0" bitflags = "1.0"
euclid = "0.20" euclid = "0.22"
fnv = "1.0" fnv = "1.0"
fontsan = { git = "https://github.com/servo/fontsan" } fontsan = { git = "https://github.com/servo/fontsan" }
gfx_traits = { path = "../gfx_traits" } gfx_traits = { path = "../gfx_traits" }

View file

@ -18,7 +18,7 @@ atomic_refcell = "0.1"
bitflags = "1.0" bitflags = "1.0"
canvas_traits = { path = "../canvas_traits" } canvas_traits = { path = "../canvas_traits" }
embedder_traits = { path = "../embedder_traits" } embedder_traits = { path = "../embedder_traits" }
euclid = "0.20" euclid = "0.22"
fnv = "1.0" fnv = "1.0"
gfx = { path = "../gfx" } gfx = { path = "../gfx" }
gfx_traits = { path = "../gfx_traits" } gfx_traits = { path = "../gfx_traits" }

View file

@ -834,7 +834,7 @@ impl Fragment {
index, index,
); );
if placement.tile_size.is_empty_or_negative() { if placement.tile_size.is_empty() {
return; return;
} }
@ -2321,7 +2321,7 @@ impl BlockFlow {
.fragment .fragment
.perspective_matrix(&border_box) .perspective_matrix(&border_box)
.unwrap_or(LayoutTransform::identity()); .unwrap_or(LayoutTransform::identity());
let transform = transform.pre_transform(&perspective).inverse(); let transform = perspective.then(&transform).inverse();
let origin = border_box.origin; let origin = border_box.origin;
let transform_clip = |clip: Rect<Au>| { let transform_clip = |clip: Rect<Au>| {
@ -2346,7 +2346,7 @@ impl BlockFlow {
clip.size.height.to_f32_px(), clip.size.height.to_f32_px(),
); );
let clip = transform.transform_rect(&clip).unwrap(); let clip = transform.outer_transformed_rect(&clip).unwrap();
rect( rect(
Au::from_f32_px(clip.origin.x), Au::from_f32_px(clip.origin.x),

View file

@ -204,7 +204,7 @@ impl DisplayItem {
), ),
(Some(t), None) => (t, ReferenceFrameKind::Transform), (Some(t), None) => (t, ReferenceFrameKind::Transform),
(Some(t), Some(p)) => ( (Some(t), Some(p)) => (
t.pre_transform(&p), p.then(&t),
ReferenceFrameKind::Perspective { ReferenceFrameKind::Perspective {
scrolling_relative_to: None, scrolling_relative_to: None,
}, },

View file

@ -355,10 +355,10 @@ pub trait Flow: HasBaseFlow + fmt::Debug + Sync + Send + 'static {
.to_untyped(); .to_untyped();
let transformed_overflow = Overflow { let transformed_overflow = Overflow {
paint: f32_rect_to_au_rect( paint: f32_rect_to_au_rect(
transform_2d.transform_rect(&au_rect_to_f32_rect(overflow.paint)), transform_2d.outer_transformed_rect(&au_rect_to_f32_rect(overflow.paint)),
), ),
scroll: f32_rect_to_au_rect( scroll: f32_rect_to_au_rect(
transform_2d.transform_rect(&au_rect_to_f32_rect(overflow.scroll)), transform_2d.outer_transformed_rect(&au_rect_to_f32_rect(overflow.scroll)),
), ),
}; };

View file

@ -3205,22 +3205,18 @@ impl Fragment {
.to_f32_px(); .to_f32_px();
let transform_origin_z = transform_origin.depth.px(); let transform_origin_z = transform_origin.depth.px();
let pre_transform = LayoutTransform::create_translation( let pre_transform = LayoutTransform::translation(
transform_origin_x, transform_origin_x,
transform_origin_y, transform_origin_y,
transform_origin_z, transform_origin_z,
); );
let post_transform = LayoutTransform::create_translation( let post_transform = LayoutTransform::translation(
-transform_origin_x, -transform_origin_x,
-transform_origin_y, -transform_origin_y,
-transform_origin_z, -transform_origin_z,
); );
Some( Some(post_transform.then(&transform).then(&pre_transform))
pre_transform
.pre_transform(&transform)
.pre_transform(&post_transform),
)
} }
/// Returns the 4D matrix representing this fragment's perspective. /// Returns the 4D matrix representing this fragment's perspective.
@ -3241,25 +3237,19 @@ impl Fragment {
) )
.to_layout(); .to_layout();
let pre_transform = LayoutTransform::create_translation( let pre_transform =
perspective_origin.x, LayoutTransform::translation(perspective_origin.x, perspective_origin.y, 0.0);
perspective_origin.y, let post_transform =
0.0, LayoutTransform::translation(-perspective_origin.x, -perspective_origin.y, 0.0);
);
let post_transform = LayoutTransform::create_translation(
-perspective_origin.x,
-perspective_origin.y,
0.0,
);
let perspective_matrix = LayoutTransform::from_untyped( let perspective_matrix = LayoutTransform::from_untyped(
&transform::create_perspective_matrix(length.px()), &transform::create_perspective_matrix(length.px()),
); );
Some( Some(
pre_transform post_transform
.pre_transform(&perspective_matrix) .then(&perspective_matrix)
.pre_transform(&post_transform), .then(&pre_transform),
) )
}, },
Perspective::None => None, Perspective::None => None,

View file

@ -15,7 +15,7 @@ use crate::opaque_node::OpaqueNodeMethods;
use crate::sequential; use crate::sequential;
use crate::wrapper::LayoutNodeLayoutData; use crate::wrapper::LayoutNodeLayoutData;
use app_units::Au; use app_units::Au;
use euclid::default::{Point2D, Rect, Size2D, Vector2D}; use euclid::default::{Box2D, Point2D, Rect, Size2D, Vector2D};
use euclid::Size2D as TypedSize2D; use euclid::Size2D as TypedSize2D;
use ipc_channel::ipc::IpcSender; use ipc_channel::ipc::IpcSender;
use msg::constellation_msg::PipelineId; use msg::constellation_msg::PipelineId;
@ -532,7 +532,35 @@ impl FragmentBorderBoxIterator for UnioningFragmentScrollAreaIterator {
Point2D::new(left_margin, top_margin), Point2D::new(left_margin, top_margin),
Size2D::new(right_margin, bottom_margin), Size2D::new(right_margin, bottom_margin),
); );
self.union_rect = self.union_rect.union(&margin).union(&padding);
// This is a workaround because euclid does not support unioning empty
// rectangles.
// TODO: The way that this iterator is calculating scroll area is very
// suspect and the code below is a workaround until it can be written
// in a better way.
self.union_rect = Box2D::new(
Point2D::new(
min(
padding.min_x(),
min(margin.min_x(), self.union_rect.min_x()),
),
min(
padding.min_y(),
min(margin.min_y(), self.union_rect.min_y()),
),
),
Point2D::new(
max(
padding.max_x(),
max(margin.max_x(), self.union_rect.max_x()),
),
max(
padding.max_y(),
max(margin.max_y(), self.union_rect.max_y()),
),
),
)
.to_rect();
}, },
None => { None => {
self.level = Some(level); self.level = Some(level);

View file

@ -18,7 +18,7 @@ atomic_refcell = "0.1.6"
canvas_traits = { path = "../canvas_traits" } canvas_traits = { path = "../canvas_traits" }
cssparser = "0.29" cssparser = "0.29"
embedder_traits = { path = "../embedder_traits" } embedder_traits = { path = "../embedder_traits" }
euclid = "0.20" euclid = "0.22"
fnv = "1.0" fnv = "1.0"
fxhash = "0.2" fxhash = "0.2"
gfx = { path = "../gfx" } gfx = { path = "../gfx" }

View file

@ -802,7 +802,7 @@ impl BoxFragment {
), ),
(Some(transform), None) => (transform, wr::ReferenceFrameKind::Transform), (Some(transform), None) => (transform, wr::ReferenceFrameKind::Transform),
(Some(transform), Some(perspective)) => ( (Some(transform), Some(perspective)) => (
transform.pre_transform(&perspective), perspective.then(&transform),
wr::ReferenceFrameKind::Perspective { wr::ReferenceFrameKind::Perspective {
scrolling_relative_to: None, scrolling_relative_to: None,
}, },
@ -861,11 +861,7 @@ impl BoxFragment {
-transform_origin_z, -transform_origin_z,
); );
Some( Some(post_transform.then(&transform).then(&pre_transform))
pre_transform
.pre_transform(&transform)
.pre_transform(&post_transform),
)
} }
/// Returns the 4D matrix representing this fragment's perspective. /// Returns the 4D matrix representing this fragment's perspective.
@ -903,9 +899,9 @@ impl BoxFragment {
); );
Some( Some(
pre_transform post_transform
.pre_transform(&perspective_matrix) .then(&perspective_matrix)
.pre_transform(&post_transform), .then(&pre_transform),
) )
}, },
Perspective::None => None, Perspective::None => None,

View file

@ -15,7 +15,7 @@ app_units = "0.7"
atomic_refcell = "0.1" atomic_refcell = "0.1"
crossbeam-channel = "0.4" crossbeam-channel = "0.4"
embedder_traits = { path = "../embedder_traits" } embedder_traits = { path = "../embedder_traits" }
euclid = "0.20" euclid = "0.22"
fnv = "1.0" fnv = "1.0"
fxhash = "0.2" fxhash = "0.2"
gfx = { path = "../gfx" } gfx = { path = "../gfx" }

View file

@ -15,7 +15,7 @@ app_units = "0.7"
atomic_refcell = "0.1" atomic_refcell = "0.1"
crossbeam-channel = "0.4" crossbeam-channel = "0.4"
embedder_traits = { path = "../embedder_traits" } embedder_traits = { path = "../embedder_traits" }
euclid = "0.20" euclid = "0.22"
fnv = "1.0" fnv = "1.0"
fxhash = "0.2" fxhash = "0.2"
gfx = { path = "../gfx" } gfx = { path = "../gfx" }

View file

@ -32,7 +32,7 @@ app_units = "0.7"
content-security-policy = { version = "0.4.0", features = ["serde"], optional = true } content-security-policy = { version = "0.4.0", features = ["serde"], optional = true }
crossbeam-channel = { version = "0.4", optional = true } crossbeam-channel = { version = "0.4", optional = true }
cssparser = "0.29" cssparser = "0.29"
euclid = "0.20" euclid = "0.22"
hashglobe = { path = "../hashglobe" } hashglobe = { path = "../hashglobe" }
http = { version = "0.2", optional = true } http = { version = "0.2", optional = true }
hyper_serde = { version = "0.13", optional = true } hyper_serde = { version = "0.13", optional = true }

View file

@ -11,7 +11,7 @@ name = "media"
path = "lib.rs" path = "lib.rs"
[dependencies] [dependencies]
euclid = "0.20" euclid = "0.22"
fnv = "1.0" fnv = "1.0"
ipc-channel = "0.14" ipc-channel = "0.14"
lazy_static = "1" lazy_static = "1"

View file

@ -11,7 +11,7 @@ name = "pixels"
path = "lib.rs" path = "lib.rs"
[dependencies] [dependencies]
euclid = "0.20" euclid = "0.22"
malloc_size_of = { path = "../malloc_size_of" } malloc_size_of = { path = "../malloc_size_of" }
malloc_size_of_derive = "0.1" malloc_size_of_derive = "0.1"
serde = { version = "1", features = ["derive"] } serde = { version = "1", features = ["derive"] }

View file

@ -51,7 +51,7 @@ domobject_derive = { path = "../domobject_derive" }
embedder_traits = { path = "../embedder_traits" } embedder_traits = { path = "../embedder_traits" }
encoding_rs = "0.8" encoding_rs = "0.8"
enum-iterator = "0.3" enum-iterator = "0.3"
euclid = "0.20" euclid = "0.22"
fnv = "1.0" fnv = "1.0"
fxhash = "0.2" fxhash = "0.2"
headers = "0.3" headers = "0.3"

View file

@ -1495,14 +1495,9 @@ impl CanvasState {
let (sin, cos) = (angle.sin(), angle.cos()); let (sin, cos) = (angle.sin(), angle.cos());
let transform = self.state.borrow().transform; let transform = self.state.borrow().transform;
self.state.borrow_mut().transform = transform.pre_transform(&Transform2D::row_major( self.state.borrow_mut().transform =
cos as f32, Transform2D::new(cos as f32, sin as f32, -sin as f32, cos as f32, 0.0, 0.0)
sin as f32, .then(&transform);
-sin as f32,
cos as f32,
0.0,
0.0,
));
self.update_transform() self.update_transform()
} }
@ -1530,9 +1525,9 @@ impl CanvasState {
} }
let transform = self.state.borrow().transform; let transform = self.state.borrow().transform;
self.state.borrow_mut().transform = transform.pre_transform(&Transform2D::row_major( self.state.borrow_mut().transform =
a as f32, b as f32, c as f32, d as f32, e as f32, f as f32, Transform2D::new(a as f32, b as f32, c as f32, d as f32, e as f32, f as f32)
)); .then(&transform);
self.update_transform() self.update_transform()
} }
@ -1558,7 +1553,7 @@ impl CanvasState {
} }
self.state.borrow_mut().transform = self.state.borrow_mut().transform =
Transform2D::row_major(a as f32, b as f32, c as f32, d as f32, e as f32, f as f32); Transform2D::new(a as f32, b as f32, c as f32, d as f32, e as f32, f as f32);
self.update_transform() self.update_transform()
} }

View file

@ -181,7 +181,7 @@ impl DOMMatrixReadOnly {
dommatrixinit_to_matrix(&other).map(|(is2D, other_matrix)| { dommatrixinit_to_matrix(&other).map(|(is2D, other_matrix)| {
// Step 2. // Step 2.
let mut matrix = self.matrix.borrow_mut(); let mut matrix = self.matrix.borrow_mut();
*matrix = other_matrix.post_transform(&matrix); *matrix = other_matrix.then(&matrix);
// Step 3. // Step 3.
if !is2D { if !is2D {
self.is2D.set(false); self.is2D.set(false);
@ -196,7 +196,7 @@ impl DOMMatrixReadOnly {
dommatrixinit_to_matrix(&other).map(|(is2D, other_matrix)| { dommatrixinit_to_matrix(&other).map(|(is2D, other_matrix)| {
// Step 2. // Step 2.
let mut matrix = self.matrix.borrow_mut(); let mut matrix = self.matrix.borrow_mut();
*matrix = other_matrix.pre_transform(&matrix); *matrix = matrix.then(&other_matrix);
// Step 3. // Step 3.
if !is2D { if !is2D {
self.is2D.set(false); self.is2D.set(false);
@ -208,9 +208,9 @@ impl DOMMatrixReadOnly {
// https://drafts.fxtf.org/geometry-1/#dom-dommatrix-translateself // https://drafts.fxtf.org/geometry-1/#dom-dommatrix-translateself
pub fn translate_self(&self, tx: f64, ty: f64, tz: f64) { pub fn translate_self(&self, tx: f64, ty: f64, tz: f64) {
// Step 1. // Step 1.
let translation = Transform3D::create_translation(tx, ty, tz); let translation = Transform3D::translation(tx, ty, tz);
let mut matrix = self.matrix.borrow_mut(); let mut matrix = self.matrix.borrow_mut();
*matrix = translation.post_transform(&matrix); *matrix = translation.then(&matrix);
// Step 2. // Step 2.
if tz != 0.0 { if tz != 0.0 {
self.is2D.set(false); self.is2D.set(false);
@ -234,9 +234,9 @@ impl DOMMatrixReadOnly {
let scaleY = scaleY.unwrap_or(scaleX); let scaleY = scaleY.unwrap_or(scaleX);
// Step 3. // Step 3.
{ {
let scale3D = Transform3D::create_scale(scaleX, scaleY, scaleZ); let scale3D = Transform3D::scale(scaleX, scaleY, scaleZ);
let mut matrix = self.matrix.borrow_mut(); let mut matrix = self.matrix.borrow_mut();
*matrix = scale3D.post_transform(&matrix); *matrix = scale3D.then(&matrix);
} }
// Step 4. // Step 4.
originX = -originX; originX = -originX;
@ -257,9 +257,9 @@ impl DOMMatrixReadOnly {
self.translate_self(originX, originY, originZ); self.translate_self(originX, originY, originZ);
// Step 2. // Step 2.
{ {
let scale3D = Transform3D::create_scale(scale, scale, scale); let scale3D = Transform3D::scale(scale, scale, scale);
let mut matrix = self.matrix.borrow_mut(); let mut matrix = self.matrix.borrow_mut();
*matrix = scale3D.post_transform(&matrix); *matrix = scale3D.then(&matrix);
} }
// Step 3. // Step 3.
self.translate_self(-originX, -originY, -originZ); self.translate_self(-originX, -originY, -originZ);
@ -288,27 +288,21 @@ impl DOMMatrixReadOnly {
} }
if rotZ != 0.0 { if rotZ != 0.0 {
// Step 5. // Step 5.
// Beware: pass negated value until https://github.com/servo/euclid/issues/354 let rotation = Transform3D::rotation(0.0, 0.0, 1.0, Angle::radians(rotZ.to_radians()));
let rotation =
Transform3D::create_rotation(0.0, 0.0, -1.0, Angle::radians(rotZ.to_radians()));
let mut matrix = self.matrix.borrow_mut(); let mut matrix = self.matrix.borrow_mut();
*matrix = rotation.post_transform(&matrix); *matrix = rotation.then(&matrix);
} }
if rotY != 0.0 { if rotY != 0.0 {
// Step 6. // Step 6.
// Beware: pass negated value until https://github.com/servo/euclid/issues/354 let rotation = Transform3D::rotation(0.0, 1.0, 0.0, Angle::radians(rotY.to_radians()));
let rotation =
Transform3D::create_rotation(0.0, -1.0, 0.0, Angle::radians(rotY.to_radians()));
let mut matrix = self.matrix.borrow_mut(); let mut matrix = self.matrix.borrow_mut();
*matrix = rotation.post_transform(&matrix); *matrix = rotation.then(&matrix);
} }
if rotX != 0.0 { if rotX != 0.0 {
// Step 7. // Step 7.
// Beware: pass negated value until https://github.com/servo/euclid/issues/354 let rotation = Transform3D::rotation(1.0, 0.0, 0.0, Angle::radians(rotX.to_radians()));
let rotation =
Transform3D::create_rotation(-1.0, 0.0, 0.0, Angle::radians(rotX.to_radians()));
let mut matrix = self.matrix.borrow_mut(); let mut matrix = self.matrix.borrow_mut();
*matrix = rotation.post_transform(&matrix); *matrix = rotation.then(&matrix);
} }
// Step 8 in DOMMatrix.RotateSelf // Step 8 in DOMMatrix.RotateSelf
} }
@ -319,10 +313,9 @@ impl DOMMatrixReadOnly {
if y != 0.0 || x < 0.0 { if y != 0.0 || x < 0.0 {
// Step 1. // Step 1.
let rotZ = Angle::radians(f64::atan2(y, x)); let rotZ = Angle::radians(f64::atan2(y, x));
// Beware: pass negated value until https://github.com/servo/euclid/issues/354 let rotation = Transform3D::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(); let mut matrix = self.matrix.borrow_mut();
*matrix = rotation.post_transform(&matrix); *matrix = rotation.then(&matrix);
} }
// Step 2 in DOMMatrix.RotateFromVectorSelf // Step 2 in DOMMatrix.RotateFromVectorSelf
} }
@ -332,14 +325,10 @@ impl DOMMatrixReadOnly {
// Step 1. // Step 1.
let (norm_x, norm_y, norm_z) = normalize_point(x, y, z); let (norm_x, norm_y, norm_z) = normalize_point(x, y, z);
// Beware: pass negated value until https://github.com/servo/euclid/issues/354 // Beware: pass negated value until https://github.com/servo/euclid/issues/354
let rotation = Transform3D::create_rotation( let rotation =
-norm_x, Transform3D::rotation(norm_x, norm_y, norm_z, Angle::radians(angle.to_radians()));
-norm_y,
-norm_z,
Angle::radians(angle.to_radians()),
);
let mut matrix = self.matrix.borrow_mut(); let mut matrix = self.matrix.borrow_mut();
*matrix = rotation.post_transform(&matrix); *matrix = rotation.then(&matrix);
// Step 2. // Step 2.
if x != 0.0 || y != 0.0 { if x != 0.0 || y != 0.0 {
self.is2D.set(false); self.is2D.set(false);
@ -350,18 +339,18 @@ impl DOMMatrixReadOnly {
// https://drafts.fxtf.org/geometry-1/#dom-dommatrix-skewxself // https://drafts.fxtf.org/geometry-1/#dom-dommatrix-skewxself
pub fn skew_x_self(&self, sx: f64) { pub fn skew_x_self(&self, sx: f64) {
// Step 1. // Step 1.
let skew = Transform3D::create_skew(Angle::radians(sx.to_radians()), Angle::radians(0.0)); let skew = Transform3D::skew(Angle::radians(sx.to_radians()), Angle::radians(0.0));
let mut matrix = self.matrix.borrow_mut(); let mut matrix = self.matrix.borrow_mut();
*matrix = skew.post_transform(&matrix); *matrix = skew.then(&matrix);
// Step 2 in DOMMatrix.SkewXSelf // Step 2 in DOMMatrix.SkewXSelf
} }
// https://drafts.fxtf.org/geometry-1/#dom-dommatrix-skewyself // https://drafts.fxtf.org/geometry-1/#dom-dommatrix-skewyself
pub fn skew_y_self(&self, sy: f64) { pub fn skew_y_self(&self, sy: f64) {
// Step 1. // Step 1.
let skew = Transform3D::create_skew(Angle::radians(0.0), Angle::radians(sy.to_radians())); let skew = Transform3D::skew(Angle::radians(0.0), Angle::radians(sy.to_radians()));
let mut matrix = self.matrix.borrow_mut(); let mut matrix = self.matrix.borrow_mut();
*matrix = skew.post_transform(&matrix); *matrix = skew.then(&matrix);
// Step 2 in DOMMatrix.SkewYSelf // Step 2 in DOMMatrix.SkewYSelf
} }
@ -372,7 +361,7 @@ impl DOMMatrixReadOnly {
*matrix = matrix.inverse().unwrap_or_else(|| { *matrix = matrix.inverse().unwrap_or_else(|| {
// Step 2. // Step 2.
self.is2D.set(false); self.is2D.set(false);
Transform3D::row_major( Transform3D::new(
f64::NAN, f64::NAN,
f64::NAN, f64::NAN,
f64::NAN, f64::NAN,
@ -628,20 +617,20 @@ impl DOMMatrixReadOnlyMethods for DOMMatrixReadOnly {
// https://drafts.fxtf.org/geometry-1/#dom-dommatrixreadonly-flipx // https://drafts.fxtf.org/geometry-1/#dom-dommatrixreadonly-flipx
fn FlipX(&self) -> DomRoot<DOMMatrix> { fn FlipX(&self) -> DomRoot<DOMMatrix> {
let is2D = self.is2D.get(); let is2D = self.is2D.get();
let flip = Transform3D::row_major( let flip = Transform3D::new(
-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, -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,
); );
let matrix = flip.post_transform(&self.matrix.borrow()); let matrix = flip.then(&self.matrix.borrow());
DOMMatrix::new(&self.global(), is2D, matrix) DOMMatrix::new(&self.global(), is2D, matrix)
} }
// https://drafts.fxtf.org/geometry-1/#dom-dommatrixreadonly-flipy // https://drafts.fxtf.org/geometry-1/#dom-dommatrixreadonly-flipy
fn FlipY(&self) -> DomRoot<DOMMatrix> { fn FlipY(&self) -> DomRoot<DOMMatrix> {
let is2D = self.is2D.get(); let is2D = self.is2D.get();
let flip = Transform3D::row_major( let flip = Transform3D::new(
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, 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,
); );
let matrix = flip.post_transform(&self.matrix.borrow()); let matrix = flip.then(&self.matrix.borrow());
DOMMatrix::new(&self.global(), is2D, matrix) DOMMatrix::new(&self.global(), is2D, matrix)
} }
@ -673,7 +662,7 @@ impl DOMMatrixReadOnlyMethods for DOMMatrixReadOnly {
let vec: Vec<f32> = self let vec: Vec<f32> = self
.matrix .matrix
.borrow() .borrow()
.to_row_major_array() .to_array()
.iter() .iter()
.map(|&x| x as f32) .map(|&x| x as f32)
.collect(); .collect();
@ -687,7 +676,7 @@ impl DOMMatrixReadOnlyMethods for DOMMatrixReadOnly {
// https://drafts.fxtf.org/geometry-1/#dom-dommatrixreadonly-tofloat64array // https://drafts.fxtf.org/geometry-1/#dom-dommatrixreadonly-tofloat64array
#[allow(unsafe_code)] #[allow(unsafe_code)]
fn ToFloat64Array(&self, cx: JSContext) -> NonNull<JSObject> { fn ToFloat64Array(&self, cx: JSContext) -> NonNull<JSObject> {
let arr = self.matrix.borrow().to_row_major_array(); let arr = self.matrix.borrow().to_array();
unsafe { unsafe {
rooted!(in (*cx) let mut array = ptr::null_mut::<JSObject>()); rooted!(in (*cx) let mut array = ptr::null_mut::<JSObject>());
let _ = Float64Array::create(*cx, CreateWith::Slice(&arr), array.handle_mut()).unwrap(); let _ = Float64Array::create(*cx, CreateWith::Slice(&arr), array.handle_mut()).unwrap();
@ -698,7 +687,7 @@ impl DOMMatrixReadOnlyMethods for DOMMatrixReadOnly {
// https://drafts.fxtf.org/geometry-1/#create-a-2d-matrix // https://drafts.fxtf.org/geometry-1/#create-a-2d-matrix
fn create_2d_matrix(entries: &[f64]) -> Transform3D<f64> { fn create_2d_matrix(entries: &[f64]) -> Transform3D<f64> {
Transform3D::row_major( Transform3D::new(
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[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, entries[4], entries[5], 0.0, 1.0,
) )
@ -706,7 +695,7 @@ fn create_2d_matrix(entries: &[f64]) -> Transform3D<f64> {
// https://drafts.fxtf.org/geometry-1/#create-a-3d-matrix // https://drafts.fxtf.org/geometry-1/#create-a-3d-matrix
fn create_3d_matrix(entries: &[f64]) -> Transform3D<f64> { fn create_3d_matrix(entries: &[f64]) -> Transform3D<f64> {
Transform3D::row_major( Transform3D::new(
entries[0], entries[0],
entries[1], entries[1],
entries[2], entries[2],
@ -794,7 +783,7 @@ pub fn dommatrixinit_to_matrix(dict: &DOMMatrixInit) -> Fallible<(bool, Transfor
if is_2d.is_none() { if is_2d.is_none() {
is_2d = Some(true); is_2d = Some(true);
} }
let matrix = Transform3D::row_major( let matrix = Transform3D::new(
m11, m12, dict.m13, dict.m14, m21, m22, dict.m23, dict.m24, dict.m31, dict.m32, 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, dict.m33, dict.m34, m41, m42, dict.m43, dict.m44,
); );

View file

@ -248,7 +248,7 @@ impl PaintWorkletGlobalScope {
arguments: &[String], arguments: &[String],
) -> DrawAPaintImageResult { ) -> DrawAPaintImageResult {
debug!( debug!(
"Invoking a paint callback {}({},{}) at {}.", "Invoking a paint callback {}({},{}) at {:?}.",
name, size_in_px.width, size_in_px.height, device_pixel_ratio name, size_in_px.width, size_in_px.height, device_pixel_ratio
); );

View file

@ -130,7 +130,7 @@ impl XRFrameMethods for XRFrame {
} else { } else {
return Ok(None); return Ok(None);
}; };
let pose = relative_to.inverse().pre_transform(&space); let pose = space.then(&relative_to.inverse());
Ok(Some(XRPose::new(&self.global(), pose))) Ok(Some(XRPose::new(&self.global(), pose)))
} }
@ -158,7 +158,7 @@ impl XRFrameMethods for XRFrame {
} else { } else {
return Ok(None); return Ok(None);
}; };
let pose = relative_to.inverse().pre_transform(&joint_frame.pose); let pose = joint_frame.pose.then(&relative_to.inverse());
Ok(Some(XRJointPose::new( Ok(Some(XRJointPose::new(
&self.global(), &self.global(),
pose.cast_unit(), pose.cast_unit(),

View file

@ -45,7 +45,7 @@ impl XRHitTestResultMethods for XRHitTestResult {
// https://immersive-web.github.io/hit-test/#dom-xrhittestresult-getpose // https://immersive-web.github.io/hit-test/#dom-xrhittestresult-getpose
fn GetPose(&self, base: &XRSpace) -> Option<DomRoot<XRPose>> { fn GetPose(&self, base: &XRSpace) -> Option<DomRoot<XRPose>> {
let base = self.frame.get_pose(base)?; let base = self.frame.get_pose(base)?;
let pose = base.inverse().pre_transform(&self.result.space); let pose = self.result.space.then(&base.inverse());
Some(XRPose::new(&self.global(), pose.cast_unit())) Some(XRPose::new(&self.global(), pose.cast_unit()))
} }
} }

View file

@ -136,10 +136,10 @@ impl XRRayMethods for XRRay {
let translation = self.ray.origin; let translation = self.ray.origin;
// Step 7 // Step 7
// According to the spec all matrices are column-major, // According to the spec all matrices are column-major,
// however euclid uses row vectors so we use .to_row_major_array() // however euclid uses row vectors so we use .to_array()
let arr = RigidTransform3D::new(rotation, translation) let arr = RigidTransform3D::new(rotation, translation)
.to_transform() .to_transform()
.to_row_major_array(); .to_array();
create_typed_array(cx, &arr, &self.matrix); create_typed_array(cx, &arr, &self.matrix);
} }
NonNull::new(self.matrix.get()).unwrap() NonNull::new(self.matrix.get()).unwrap()

View file

@ -73,7 +73,7 @@ impl XRReferenceSpace {
impl XRReferenceSpaceMethods for XRReferenceSpace { impl XRReferenceSpaceMethods for XRReferenceSpace {
/// https://immersive-web.github.io/webxr/#dom-xrreferencespace-getoffsetreferencespace /// https://immersive-web.github.io/webxr/#dom-xrreferencespace-getoffsetreferencespace
fn GetOffsetReferenceSpace(&self, new: &XRRigidTransform) -> DomRoot<Self> { fn GetOffsetReferenceSpace(&self, new: &XRRigidTransform) -> DomRoot<Self> {
let offset = self.offset.transform().pre_transform(&new.transform()); let offset = new.transform().then(&self.offset.transform());
let offset = XRRigidTransform::new(&self.global(), offset); let offset = XRRigidTransform::new(&self.global(), offset);
Self::new_offset( Self::new_offset(
&self.global(), &self.global(),
@ -106,7 +106,7 @@ impl XRReferenceSpace {
// offset is a transform from offset space to unoffset space, // offset is a transform from offset space to unoffset space,
// we want a transform from unoffset space to native space, // we want a transform from unoffset space to native space,
// which is pose * offset in column vector notation // which is pose * offset in column vector notation
Some(pose.pre_transform(&offset)) Some(offset.then(&pose))
} }
/// Gets pose represented by this space /// Gets pose represented by this space

View file

@ -119,8 +119,8 @@ impl XRRigidTransformMethods for XRRigidTransform {
if self.matrix.get().is_null() { if self.matrix.get().is_null() {
let cx = self.global().get_cx(); let cx = self.global().get_cx();
// According to the spec all matrices are column-major, // According to the spec all matrices are column-major,
// however euclid uses row vectors so we use .to_row_major_array() // however euclid uses row vectors so we use .to_array()
let arr = self.transform.to_transform().to_row_major_array(); let arr = self.transform.to_transform().to_array();
create_typed_array(cx, &arr, &self.matrix); create_typed_array(cx, &arr, &self.matrix);
} }
NonNull::new(self.matrix.get()).unwrap() NonNull::new(self.matrix.get()).unwrap()

View file

@ -57,7 +57,7 @@ impl XRView {
viewport_index: usize, viewport_index: usize,
to_base: &BaseTransform, to_base: &BaseTransform,
) -> DomRoot<XRView> { ) -> DomRoot<XRView> {
let transform: RigidTransform3D<f32, V, BaseSpace> = to_base.pre_transform(&view.transform); let transform: RigidTransform3D<f32, V, BaseSpace> = view.transform.then(&to_base);
let transform = XRRigidTransform::new(global, cast_transform(transform)); let transform = XRRigidTransform::new(global, cast_transform(transform));
reflect_dom_object( reflect_dom_object(
@ -92,7 +92,7 @@ impl XRViewMethods for XRView {
if self.proj.get().is_null() { if self.proj.get().is_null() {
let cx = self.global().get_cx(); let cx = self.global().get_cx();
// row_major since euclid uses row vectors // row_major since euclid uses row vectors
let proj = self.view.projection.to_row_major_array(); let proj = self.view.projection.to_array();
create_typed_array(cx, &proj, &self.proj); create_typed_array(cx, &proj, &self.proj);
} }
NonNull::new(self.proj.get()).unwrap() NonNull::new(self.proj.get()).unwrap()

View file

@ -150,7 +150,7 @@ impl XRViewerPose {
}, },
}; };
let transform: RigidTransform3D<f32, Viewer, BaseSpace> = let transform: RigidTransform3D<f32, Viewer, BaseSpace> =
to_base.pre_transform(&viewer_pose.transform); viewer_pose.transform.then(&to_base);
let transform = XRRigidTransform::new(global, cast_transform(transform)); let transform = XRRigidTransform::new(global, cast_transform(transform));
let pose = reflect_dom_object(Box::new(XRViewerPose::new_inherited(&transform)), global); let pose = reflect_dom_object(Box::new(XRViewerPose::new_inherited(&transform)), global);

View file

@ -15,7 +15,7 @@ app_units = "0.7"
atomic_refcell = "0.1" atomic_refcell = "0.1"
canvas_traits = { path = "../canvas_traits" } canvas_traits = { path = "../canvas_traits" }
crossbeam-channel = "0.4" crossbeam-channel = "0.4"
euclid = "0.20" euclid = "0.22"
fxhash = "0.2" fxhash = "0.2"
gfx_traits = { path = "../gfx_traits" } gfx_traits = { path = "../gfx_traits" }
html5ever = "0.26" html5ever = "0.26"

View file

@ -18,7 +18,7 @@ cookie = "0.12"
crossbeam-channel = "0.4" crossbeam-channel = "0.4"
devtools_traits = { path = "../devtools_traits" } devtools_traits = { path = "../devtools_traits" }
embedder_traits = { path = "../embedder_traits" } embedder_traits = { path = "../embedder_traits" }
euclid = "0.20" euclid = "0.22"
gfx_traits = { path = "../gfx_traits" } gfx_traits = { path = "../gfx_traits" }
headers = "0.3" headers = "0.3"
http = "0.2" http = "0.2"

View file

@ -50,7 +50,7 @@ devtools = { path = "../devtools" }
devtools_traits = { path = "../devtools_traits" } devtools_traits = { path = "../devtools_traits" }
embedder_traits = { path = "../embedder_traits" } embedder_traits = { path = "../embedder_traits" }
env_logger = "0.8" env_logger = "0.8"
euclid = "0.20" euclid = "0.22"
gfx = { path = "../gfx" } gfx = { path = "../gfx" }
gfx_traits = { path = "../gfx_traits" } gfx_traits = { path = "../gfx_traits" }
gleam = "0.12" gleam = "0.12"
@ -78,7 +78,7 @@ servo_url = { path = "../url" }
sparkle = "0.1" sparkle = "0.1"
style = { path = "../style", features = ["servo"] } style = { path = "../style", features = ["servo"] }
style_traits = { path = "../style_traits", features = ["servo"] } style_traits = { path = "../style_traits", features = ["servo"] }
surfman = "0.4" surfman = "0.5"
webdriver_server = { path = "../webdriver_server", optional = true } webdriver_server = { path = "../webdriver_server", optional = true }
webgpu = { path = "../webgpu" } webgpu = { path = "../webgpu" }
webrender = { git = "https://github.com/servo/webrender" } webrender = { git = "https://github.com/servo/webrender" }

View file

@ -38,7 +38,7 @@ byteorder = "1.0"
cssparser = "0.29" cssparser = "0.29"
derive_more = "0.99" derive_more = "0.99"
encoding_rs = { version = "0.8", optional = true } encoding_rs = { version = "0.8", optional = true }
euclid = "0.20" euclid = "0.22"
fallible = { path = "../fallible" } fallible = { path = "../fallible" }
fxhash = "0.2" fxhash = "0.2"
hashglobe = { path = "../hashglobe" } hashglobe = { path = "../hashglobe" }

View file

@ -76,7 +76,7 @@ pub use self::GenericMatrix3D as Matrix3D;
impl<T: Into<f64>> From<Matrix<T>> for Transform3D<f64> { impl<T: Into<f64>> From<Matrix<T>> for Transform3D<f64> {
#[inline] #[inline]
fn from(m: Matrix<T>) -> Self { fn from(m: Matrix<T>) -> Self {
Transform3D::row_major( Transform3D::new(
m.a.into(), m.b.into(), 0.0, 0.0, m.a.into(), m.b.into(), 0.0, 0.0,
m.c.into(), m.d.into(), 0.0, 0.0, m.c.into(), m.d.into(), 0.0, 0.0,
0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0, 0.0,
@ -89,7 +89,7 @@ impl<T: Into<f64>> From<Matrix<T>> for Transform3D<f64> {
impl<T: Into<f64>> From<Matrix3D<T>> for Transform3D<f64> { impl<T: Into<f64>> From<Matrix3D<T>> for Transform3D<f64> {
#[inline] #[inline]
fn from(m: Matrix3D<T>) -> Self { fn from(m: Matrix3D<T>) -> Self {
Transform3D::row_major( Transform3D::new(
m.m11.into(), m.m12.into(), m.m13.into(), m.m14.into(), m.m11.into(), m.m12.into(), m.m13.into(), m.m14.into(),
m.m21.into(), m.m22.into(), m.m23.into(), m.m24.into(), m.m21.into(), m.m22.into(), m.m23.into(), m.m24.into(),
m.m31.into(), m.m32.into(), m.m33.into(), m.m34.into(), m.m31.into(), m.m32.into(), m.m33.into(), m.m34.into(),
@ -451,64 +451,62 @@ where
let theta = TWO_PI - theta.radians64(); let theta = TWO_PI - theta.radians64();
let (ax, ay, az, theta) = let (ax, ay, az, theta) =
get_normalized_vector_and_angle(ax.into(), ay.into(), az.into(), theta); get_normalized_vector_and_angle(ax.into(), ay.into(), az.into(), theta);
Transform3D::create_rotation( Transform3D::rotation(
ax as f64, ax as f64,
ay as f64, ay as f64,
az as f64, az as f64,
euclid::Angle::radians(theta), -euclid::Angle::radians(theta),
) )
}, },
RotateX(theta) => { RotateX(theta) => {
let theta = euclid::Angle::radians(TWO_PI - theta.radians64()); let theta = euclid::Angle::radians(TWO_PI - theta.radians64());
Transform3D::create_rotation(1., 0., 0., theta) Transform3D::rotation(1., 0., 0., -theta)
}, },
RotateY(theta) => { RotateY(theta) => {
let theta = euclid::Angle::radians(TWO_PI - theta.radians64()); let theta = euclid::Angle::radians(TWO_PI - theta.radians64());
Transform3D::create_rotation(0., 1., 0., theta) Transform3D::rotation(0., 1., 0., -theta)
}, },
RotateZ(theta) | Rotate(theta) => { RotateZ(theta) | Rotate(theta) => {
let theta = euclid::Angle::radians(TWO_PI - theta.radians64()); let theta = euclid::Angle::radians(TWO_PI - theta.radians64());
Transform3D::create_rotation(0., 0., 1., theta) Transform3D::rotation(0., 0., 1., -theta)
}, },
Perspective(ref d) => { Perspective(ref d) => {
let m = create_perspective_matrix(d.to_pixel_length(None)?); let m = create_perspective_matrix(d.to_pixel_length(None)?);
m.cast() m.cast()
}, },
Scale3D(sx, sy, sz) => Transform3D::create_scale(sx.into(), sy.into(), sz.into()), Scale3D(sx, sy, sz) => Transform3D::scale(sx.into(), sy.into(), sz.into()),
Scale(sx, sy) => Transform3D::create_scale(sx.into(), sy.into(), 1.), Scale(sx, sy) => Transform3D::scale(sx.into(), sy.into(), 1.),
ScaleX(s) => Transform3D::create_scale(s.into(), 1., 1.), ScaleX(s) => Transform3D::scale(s.into(), 1., 1.),
ScaleY(s) => Transform3D::create_scale(1., s.into(), 1.), ScaleY(s) => Transform3D::scale(1., s.into(), 1.),
ScaleZ(s) => Transform3D::create_scale(1., 1., s.into()), ScaleZ(s) => Transform3D::scale(1., 1., s.into()),
Translate3D(ref tx, ref ty, ref tz) => { Translate3D(ref tx, ref ty, ref tz) => {
let tx = tx.to_pixel_length(reference_width)? as f64; let tx = tx.to_pixel_length(reference_width)? as f64;
let ty = ty.to_pixel_length(reference_height)? as f64; let ty = ty.to_pixel_length(reference_height)? as f64;
Transform3D::create_translation(tx, ty, tz.to_pixel_length(None)? as f64) Transform3D::translation(tx, ty, tz.to_pixel_length(None)? as f64)
}, },
Translate(ref tx, ref ty) => { Translate(ref tx, ref ty) => {
let tx = tx.to_pixel_length(reference_width)? as f64; let tx = tx.to_pixel_length(reference_width)? as f64;
let ty = ty.to_pixel_length(reference_height)? as f64; let ty = ty.to_pixel_length(reference_height)? as f64;
Transform3D::create_translation(tx, ty, 0.) Transform3D::translation(tx, ty, 0.)
}, },
TranslateX(ref t) => { TranslateX(ref t) => {
let t = t.to_pixel_length(reference_width)? as f64; let t = t.to_pixel_length(reference_width)? as f64;
Transform3D::create_translation(t, 0., 0.) Transform3D::translation(t, 0., 0.)
}, },
TranslateY(ref t) => { TranslateY(ref t) => {
let t = t.to_pixel_length(reference_height)? as f64; let t = t.to_pixel_length(reference_height)? as f64;
Transform3D::create_translation(0., t, 0.) Transform3D::translation(0., t, 0.)
}, },
TranslateZ(ref z) => { TranslateZ(ref z) => Transform3D::translation(0., 0., z.to_pixel_length(None)? as f64),
Transform3D::create_translation(0., 0., z.to_pixel_length(None)? as f64) Skew(theta_x, theta_y) => Transform3D::skew(
},
Skew(theta_x, theta_y) => Transform3D::create_skew(
euclid::Angle::radians(theta_x.radians64()), euclid::Angle::radians(theta_x.radians64()),
euclid::Angle::radians(theta_y.radians64()), euclid::Angle::radians(theta_y.radians64()),
), ),
SkewX(theta) => Transform3D::create_skew( SkewX(theta) => Transform3D::skew(
euclid::Angle::radians(theta.radians64()), euclid::Angle::radians(theta.radians64()),
euclid::Angle::radians(0.), euclid::Angle::radians(0.),
), ),
SkewY(theta) => Transform3D::create_skew( SkewY(theta) => Transform3D::skew(
euclid::Angle::radians(0.), euclid::Angle::radians(0.),
euclid::Angle::radians(theta.radians64()), euclid::Angle::radians(theta.radians64()),
), ),
@ -547,7 +545,7 @@ impl<T: ToMatrix> Transform<T> {
let cast_3d_transform = |m: Transform3D<f64>| -> Transform3D<CSSFloat> { let cast_3d_transform = |m: Transform3D<f64>| -> Transform3D<CSSFloat> {
use std::{f32, f64}; use std::{f32, f64};
let cast = |v: f64| { v.min(f32::MAX as f64).max(f32::MIN as f64) as f32 }; let cast = |v: f64| { v.min(f32::MAX as f64).max(f32::MIN as f64) as f32 };
Transform3D::row_major( Transform3D::new(
cast(m.m11), cast(m.m12), cast(m.m13), cast(m.m14), cast(m.m11), cast(m.m12), cast(m.m13), cast(m.m14),
cast(m.m21), cast(m.m22), cast(m.m23), cast(m.m24), cast(m.m21), cast(m.m22), cast(m.m23), cast(m.m24),
cast(m.m31), cast(m.m32), cast(m.m33), cast(m.m34), cast(m.m31), cast(m.m32), cast(m.m33), cast(m.m34),
@ -565,7 +563,7 @@ impl<T: ToMatrix> Transform<T> {
reference_box: Option<&Rect<ComputedLength>>, reference_box: Option<&Rect<ComputedLength>>,
) -> Result<(Transform3D<f64>, bool), ()> { ) -> Result<(Transform3D<f64>, bool), ()> {
// We intentionally use Transform3D<f64> during computation to avoid error propagation // We intentionally use Transform3D<f64> during computation to avoid error propagation
// because using f32 to compute triangle functions (e.g. in create_rotation()) is not // because using f32 to compute triangle functions (e.g. in rotation()) is not
// accurate enough. In Gecko, we also use "double" to compute the triangle functions. // accurate enough. In Gecko, we also use "double" to compute the triangle functions.
// Therefore, let's use Transform3D<f64> during matrix computation and cast it into f32 // Therefore, let's use Transform3D<f64> during matrix computation and cast it into f32
// in the end. // in the end.
@ -575,7 +573,7 @@ impl<T: ToMatrix> Transform<T> {
for operation in &*self.0 { for operation in &*self.0 {
let matrix = operation.to_3d_matrix(reference_box)?; let matrix = operation.to_3d_matrix(reference_box)?;
contain_3d |= operation.is_3d(); contain_3d |= operation.is_3d();
transform = transform.pre_transform(&matrix); transform = matrix.then(&transform);
} }
Ok((transform, contain_3d)) Ok((transform, contain_3d))
@ -595,7 +593,7 @@ pub fn create_perspective_matrix(d: CSSFloat) -> Transform3D<CSSFloat> {
if d <= 0.0 { if d <= 0.0 {
Transform3D::identity() Transform3D::identity()
} else { } else {
Transform3D::create_perspective(d) Transform3D::perspective(d)
} }
} }

View file

@ -17,7 +17,7 @@ gecko = []
app_units = "0.7" app_units = "0.7"
bitflags = "1.0" bitflags = "1.0"
cssparser = "0.29" cssparser = "0.29"
euclid = "0.20" euclid = "0.22"
lazy_static = "1" lazy_static = "1"
malloc_size_of = { path = "../malloc_size_of" } malloc_size_of = { path = "../malloc_size_of" }
malloc_size_of_derive = "0.1" malloc_size_of_derive = "0.1"

View file

@ -15,7 +15,7 @@ base64 = "0.10"
compositing = { path = "../compositing" } compositing = { path = "../compositing" }
cookie = "0.12" cookie = "0.12"
crossbeam-channel = "0.4" crossbeam-channel = "0.4"
euclid = "0.20" euclid = "0.22"
headers = "0.3" headers = "0.3"
http = "0.2" http = "0.2"
image = "0.24" image = "0.24"

View file

@ -12,7 +12,7 @@ path = "lib.rs"
[dependencies] [dependencies]
arrayvec = { version = "0.7", features = ["serde"] } arrayvec = { version = "0.7", features = ["serde"] }
euclid = "0.20" euclid = "0.22"
ipc-channel = "0.14" ipc-channel = "0.14"
log = "0.4" log = "0.4"
malloc_size_of = { path = "../malloc_size_of" } malloc_size_of = { path = "../malloc_size_of" }

View file

@ -11,7 +11,7 @@ name = "webrender_surfman"
path = "lib.rs" path = "lib.rs"
[dependencies] [dependencies]
euclid = "0.20" euclid = "0.22"
surfman = "0.4" surfman = "0.5"
surfman-chains = "0.6" surfman-chains = "0.7"

View file

@ -11,6 +11,6 @@ name = "webrender_traits"
path = "lib.rs" path = "lib.rs"
[dependencies] [dependencies]
euclid = "0.20" euclid = "0.22"
webrender_api = { git = "https://github.com/servo/webrender" } webrender_api = { git = "https://github.com/servo/webrender" }

View file

@ -16,7 +16,7 @@ path = "lib.rs"
[dependencies] [dependencies]
crossbeam-channel = "0.4" crossbeam-channel = "0.4"
euclid = "0.20" euclid = "0.22"
glib = "0.9" glib = "0.9"
gstreamer = "0.15" gstreamer = "0.15"
gstreamer-base = "0.15" gstreamer-base = "0.15"
@ -29,8 +29,8 @@ libservo = { path = "../../components/servo" }
log = "0.4" log = "0.4"
servo-media = { git = "https://github.com/servo/media" } servo-media = { git = "https://github.com/servo/media" }
sparkle = "0.1" sparkle = "0.1"
surfman = "0.4" surfman = "0.5"
surfman-chains = "0.6" surfman-chains = "0.7"
surfman-chains-api = "0.2" surfman-chains-api = "0.2"
webxr = { git = "https://github.com/servo/webxr", features = ["glwindow"] } webxr = { git = "https://github.com/servo/webxr", features = ["glwindow"] }

View file

@ -12,7 +12,7 @@ ipc-channel = "0.14"
libservo = { path = "../../../components/servo" } libservo = { path = "../../../components/servo" }
log = "0.4" log = "0.4"
servo-media = { git = "https://github.com/servo/media" } servo-media = { git = "https://github.com/servo/media" }
surfman = { version = "0.4", features = ["sm-angle-default"] } surfman = { version = "0.5", features = ["sm-angle-default"] }
webxr = { git = "https://github.com/servo/webxr"} webxr = { git = "https://github.com/servo/webxr"}
webxr-api = { git = "https://github.com/servo/webxr", features = ["ipc"] } webxr-api = { git = "https://github.com/servo/webxr", features = ["ipc"] }

View file

@ -18,7 +18,7 @@ env_logger = "0.8"
lazy_static = "1" lazy_static = "1"
log = "0.4" log = "0.4"
simpleservo = { path = "../api" } simpleservo = { path = "../api" }
surfman = "0.4" surfman = "0.5"
keyboard-types = "0.6" keyboard-types = "0.6"
[target.'cfg(target_os = "windows")'.dependencies] [target.'cfg(target_os = "windows")'.dependencies]

View file

@ -48,7 +48,7 @@ xr-profile = ["libservo/xr-profile"]
[target.'cfg(not(target_os = "android"))'.dependencies] [target.'cfg(not(target_os = "android"))'.dependencies]
backtrace = "0.3" backtrace = "0.3"
clipboard = "0.5" clipboard = "0.5"
euclid = "0.20" euclid = "0.22"
getopts = "0.2.11" getopts = "0.2.11"
keyboard-types = "0.6" keyboard-types = "0.6"
lazy_static = "1" lazy_static = "1"
@ -57,7 +57,7 @@ libservo = { path = "../../components/servo" }
log = "0.4" log = "0.4"
servo-media = { git = "https://github.com/servo/media" } servo-media = { git = "https://github.com/servo/media" }
shellwords = "1.0.0" shellwords = "1.0.0"
surfman = { version = "0.4", features = ["sm-winit", "sm-x11"] } surfman = { version = "0.5", features = ["sm-winit", "sm-x11"] }
tinyfiledialogs = "3.0" tinyfiledialogs = "3.0"
webxr = { git = "https://github.com/servo/webxr", features = ["ipc", "glwindow", "headless"] } webxr = { git = "https://github.com/servo/webxr", features = ["ipc", "glwindow", "headless"] }
winit = "0.24" winit = "0.24"

View file

@ -762,7 +762,7 @@ impl XRWindowPose {
} }
let x: Rotation3D<_, UnknownUnit, UnknownUnit> = Rotation3D::around_x(Angle::degrees(x)); let x: Rotation3D<_, UnknownUnit, UnknownUnit> = Rotation3D::around_x(Angle::degrees(x));
let y: Rotation3D<_, UnknownUnit, UnknownUnit> = Rotation3D::around_y(Angle::degrees(y)); let y: Rotation3D<_, UnknownUnit, UnknownUnit> = Rotation3D::around_y(Angle::degrees(y));
let rotation = self.xr_rotation.get().post_rotate(&x).post_rotate(&y); let rotation = self.xr_rotation.get().then(&x).then(&y);
self.xr_rotation.set(rotation); self.xr_rotation.set(rotation);
} }
} }

View file

@ -10,7 +10,7 @@ name = "script_tests"
path = "lib.rs" path = "lib.rs"
[dependencies] [dependencies]
euclid = "0.20" euclid = "0.22"
keyboard-types = "0.6" keyboard-types = "0.6"
script = {path = "../../../components/script"} script = {path = "../../../components/script"}
servo_url = {path = "../../../components/url"} servo_url = {path = "../../../components/url"}

View file

@ -12,7 +12,7 @@ doctest = false
[dependencies] [dependencies]
app_units = "0.7" app_units = "0.7"
cssparser = "0.29" cssparser = "0.29"
euclid = "0.20" euclid = "0.22"
html5ever = "0.26" html5ever = "0.26"
rayon = "1" rayon = "1"
serde_json = "1.0" serde_json = "1.0"

View file

@ -0,0 +1,4 @@
[2d.path.arc.shape.1.html]
[arc() from 0 to pi does not draw anything in the wrong half]
bug: https://github.com/jrmuizel/raqote/issues/96
expected: FAIL

View file

@ -0,0 +1,4 @@
[2d.path.arc.shape.1.html]
[arc() from 0 to pi does not draw anything in the wrong half]
bug: https://github.com/jrmuizel/raqote/issues/96
expected: FAIL

View file

@ -0,0 +1,4 @@
[2d.path.arc.shape.1.worker.html]
[arc() from 0 to pi does not draw anything in the wrong half]
bug: https://github.com/jrmuizel/raqote/issues/96
expected: FAIL