diff --git a/examples/servo/Cargo.lock b/examples/servo/Cargo.lock index f90c4f6de44..9bd6e7deffc 100644 --- a/examples/servo/Cargo.lock +++ b/examples/servo/Cargo.lock @@ -198,6 +198,15 @@ dependencies = [ "memchr", ] +[[package]] +name = "aligned" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "377e4c0ba83e4431b10df45c1d4666f178ea9c552cac93e60c3a88bf32785923" +dependencies = [ + "as-slice", +] + [[package]] name = "aligned-vec" version = "0.6.4" @@ -339,22 +348,22 @@ dependencies = [ [[package]] name = "anstyle-query" -version = "1.1.4" +version = "1.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e231f6134f61b71076a3eab506c379d4f36122f2af15a9ff04415ea4c3339e2" +checksum = "40c48f72fd53cd289104fc64099abca73db4166ad86ea0b4341abe65af83dadc" dependencies = [ - "windows-sys 0.60.2", + "windows-sys 0.61.2", ] [[package]] name = "anstyle-wincon" -version = "3.0.10" +version = "3.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e0633414522a32ffaac8ac6cc8f748e090c5717661fddeea04219e2344f5f2a" +checksum = "291e6a250ff86cd4a820112fb8898808a366d8f9f58ce16d1f538353ad55747d" dependencies = [ "anstyle", "once_cell_polyfill", - "windows-sys 0.60.2", + "windows-sys 0.61.2", ] [[package]] @@ -395,7 +404,7 @@ dependencies = [ "objc2-foundation 0.3.2", "parking_lot", "percent-encoding", - "windows-sys 0.59.0", + "windows-sys 0.60.2", "x11rb", ] @@ -431,6 +440,15 @@ version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "175571dd1d178ced59193a6fc02dde1b972eb0bc56c892cde9beeceac5bf0f6b" +[[package]] +name = "as-slice" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "516b6b4f0e40d50dcda9365d53964ec74560ad4284da2e7fc97122cd83174516" +dependencies = [ + "stable_deref_trait", +] + [[package]] name = "ash" version = "0.38.0+1.3.281" @@ -466,9 +484,9 @@ dependencies = [ [[package]] name = "async-compression" -version = "0.4.33" +version = "0.4.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93c1f86859c1af3d514fa19e8323147ff10ea98684e6c7b307912509f50e67b2" +checksum = "0e86f6d3dc9dc4352edeea6b8e499e13e3f5dc3b964d7ca5fd411415a3498473" dependencies = [ "compression-codecs", "compression-core", @@ -706,6 +724,26 @@ version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c08606f8c3cbf4ce6ec8e28fb0014a2c086708fe954eaa885384a6165172e7e8" +[[package]] +name = "av-scenechange" +version = "0.14.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0f321d77c20e19b92c39e7471cf986812cbb46659d2af674adc4331ef3f18394" +dependencies = [ + "aligned", + "anyhow", + "arg_enum_proc_macro", + "arrayvec", + "log", + "num-rational", + "num-traits", + "pastey", + "rayon", + "thiserror 2.0.17", + "v_frame", + "y4m", +] + [[package]] name = "av1-grain" version = "0.2.5" @@ -731,9 +769,9 @@ dependencies = [ [[package]] name = "aws-lc-rs" -version = "1.14.1" +version = "1.15.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "879b6c89592deb404ba4dc0ae6b58ffd1795c78991cbb5b8bc441c48a070440d" +checksum = "6b5ce75405893cd713f9ab8e297d8e438f624dde7d706108285f7e17a25a180f" dependencies = [ "aws-lc-sys", "zeroize", @@ -741,11 +779,10 @@ dependencies = [ [[package]] name = "aws-lc-sys" -version = "0.32.3" +version = "0.34.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "107a4e9d9cab9963e04e84bb8dee0e25f2a987f9a8bad5ed054abd439caa8f8c" +checksum = "179c3777a8b5e70e90ea426114ffc565b2c1a9f82f6c4a0c5a34aa6ef5e781b6" dependencies = [ - "bindgen 0.72.1", "cc", "cmake", "dunce", @@ -755,7 +792,7 @@ dependencies = [ [[package]] name = "background_hang_monitor" version = "0.0.1" -source = "git+https://github.com/servo/servo?rev=158bf97e#158bf97e30779b1068b7b69f05c85a98ac4ab06d" +source = "git+https://github.com/servo/servo?rev=39d3fc6c#39d3fc6c1329b398e8622d5686af47d31b73dada" dependencies = [ "background_hang_monitor_api", "backtrace", @@ -771,7 +808,7 @@ dependencies = [ [[package]] name = "background_hang_monitor_api" version = "0.0.1" -source = "git+https://github.com/servo/servo?rev=158bf97e#158bf97e30779b1068b7b69f05c85a98ac4ab06d" +source = "git+https://github.com/servo/servo?rev=39d3fc6c#39d3fc6c1329b398e8622d5686af47d31b73dada" dependencies = [ "base", "ipc-channel", @@ -796,7 +833,7 @@ dependencies = [ [[package]] name = "base" version = "0.0.1" -source = "git+https://github.com/servo/servo?rev=158bf97e#158bf97e30779b1068b7b69f05c85a98ac4ab06d" +source = "git+https://github.com/servo/servo?rev=39d3fc6c#39d3fc6c1329b398e8622d5686af47d31b73dada" dependencies = [ "crossbeam-channel", "ipc-channel", @@ -859,24 +896,6 @@ dependencies = [ "unty", ] -[[package]] -name = "bindgen" -version = "0.71.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f58bf3d7db68cfbac37cfc485a8d711e87e064c3d0fe0435b92f7a407f9d6b3" -dependencies = [ - "bitflags 2.10.0", - "cexpr", - "clang-sys", - "itertools 0.12.1", - "proc-macro2", - "quote", - "regex", - "rustc-hash 2.1.1", - "shlex", - "syn", -] - [[package]] name = "bindgen" version = "0.72.1" @@ -886,7 +905,7 @@ dependencies = [ "bitflags 2.10.0", "cexpr", "clang-sys", - "itertools 0.12.1", + "itertools 0.13.0", "log", "prettyplease", "proc-macro2", @@ -935,9 +954,12 @@ dependencies = [ [[package]] name = "bitstream-io" -version = "2.6.0" +version = "4.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6099cdc01846bc367c4e7dd630dc5966dccf36b652fae7a74e17b640411a91b2" +checksum = "60d4bd9d1db2c6bdf285e223a7fa369d5ce98ec767dec949c6ca62863ce61757" +dependencies = [ + "core2", +] [[package]] name = "block" @@ -996,9 +1018,9 @@ dependencies = [ [[package]] name = "borsh" -version = "1.5.7" +version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad8646f98db542e39fc66e68a20b2144f6a732636df7c2354e74645faaa433ce" +checksum = "d1da5ab77c1437701eeff7c88d968729e7766172279eab0676857b3d63af7a6f" dependencies = [ "cfg_aliases", ] @@ -1037,9 +1059,9 @@ dependencies = [ [[package]] name = "built" -version = "0.7.7" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56ed6191a7e78c36abdb16ab65341eefd73d64d303fffccdbb00d51e4205967b" +checksum = "f4ad8f11f288f48ca24471bbd51ac257aaeaaa07adae295591266b792902ae64" [[package]] name = "bumpalo" @@ -1055,9 +1077,9 @@ checksum = "64fa3c856b712db6612c019f14756e64e4bcea13337a6b33b696333a9eaa2d06" [[package]] name = "byte-slice-cast" -version = "0.2.0" +version = "1.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28346c117b50270785fbc123bd6e4ecad20d0c6d5f43d081dc80a3abcc62be64" +checksum = "7575182f7272186991736b70173b0ea045398f984bf5ebbb3804736ce1330c9d" [[package]] name = "bytemuck" @@ -1093,9 +1115,9 @@ checksum = "8f1fe948ff07f4bd06c30984e69f5b4899c516a3ef74f34df92a2df2ab535495" [[package]] name = "bytes" -version = "1.10.1" +version = "1.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d71b6127be86fdcfddb610f7182ac57211d4b18a3e9c82eb2d17662f2227ad6a" +checksum = "b35204fbdc0b3f4446b89fc1ac2cf84a8a68971995d0bf2e925ec7cd960f9cb3" [[package]] name = "calendrical_calculations" @@ -1161,7 +1183,7 @@ dependencies = [ [[package]] name = "canvas" version = "0.0.1" -source = "git+https://github.com/servo/servo?rev=158bf97e#158bf97e30779b1068b7b69f05c85a98ac4ab06d" +source = "git+https://github.com/servo/servo?rev=39d3fc6c#39d3fc6c1329b398e8622d5686af47d31b73dada" dependencies = [ "app_units", "base", @@ -1178,6 +1200,7 @@ dependencies = [ "net_traits", "peniko", "pixels", + "profile_traits", "range", "rustc-hash 2.1.1", "servo-tracing", @@ -1192,7 +1215,7 @@ dependencies = [ [[package]] name = "canvas_traits" version = "0.0.1" -source = "git+https://github.com/servo/servo?rev=158bf97e#158bf97e30779b1068b7b69f05c85a98ac4ab06d" +source = "git+https://github.com/servo/servo?rev=39d3fc6c#39d3fc6c1329b398e8622d5686af47d31b73dada" dependencies = [ "base", "crossbeam-channel", @@ -1223,9 +1246,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.2.45" +version = "1.2.48" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35900b6c8d709fb1d854671ae27aeaa9eec2f8b01b364e1619a40da3e6fe2afe" +checksum = "c481bdbf0ed3b892f6f806287d72acd515b352a4ec27a208489b8c1bc839633a" dependencies = [ "find-msvc-tools", "jobserver", @@ -1248,16 +1271,6 @@ dependencies = [ "nom 7.1.3", ] -[[package]] -name = "cfg-expr" -version = "0.15.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d067ad48b8650848b989a59a86c6c36a995d02d2bf778d45c3c5d57bc2718f02" -dependencies = [ - "smallvec", - "target-lexicon", -] - [[package]] name = "cfg-if" version = "1.0.4" @@ -1383,7 +1396,7 @@ dependencies = [ [[package]] name = "compositing" version = "0.0.1" -source = "git+https://github.com/servo/servo?rev=158bf97e#158bf97e30779b1068b7b69f05c85a98ac4ab06d" +source = "git+https://github.com/servo/servo?rev=39d3fc6c#39d3fc6c1329b398e8622d5686af47d31b73dada" dependencies = [ "base", "bincode 1.3.3", @@ -1401,6 +1414,7 @@ dependencies = [ "libc", "log", "media", + "parking_lot", "pixels", "profile_traits", "rayon", @@ -1412,6 +1426,7 @@ dependencies = [ "servo_malloc_size_of", "smallvec", "stylo_traits", + "surfman", "timers", "webgl", "webrender", @@ -1422,11 +1437,12 @@ dependencies = [ [[package]] name = "compositing_traits" version = "0.0.1" -source = "git+https://github.com/servo/servo?rev=158bf97e#158bf97e30779b1068b7b69f05c85a98ac4ab06d" +source = "git+https://github.com/servo/servo?rev=39d3fc6c#39d3fc6c1329b398e8622d5686af47d31b73dada" dependencies = [ "base", "bincode 1.3.3", "bitflags 2.10.0", + "canvas_traits", "crossbeam-channel", "dpi", "embedder_traits", @@ -1437,6 +1453,7 @@ dependencies = [ "ipc-channel", "log", "malloc_size_of_derive", + "parking_lot", "profile_traits", "raw-window-handle", "rustc-hash 2.1.1", @@ -1444,7 +1461,7 @@ dependencies = [ "servo_geometry", "servo_malloc_size_of", "smallvec", - "strum_macros", + "strum", "stylo", "stylo_traits", "surfman", @@ -1453,9 +1470,9 @@ dependencies = [ [[package]] name = "compression-codecs" -version = "0.4.32" +version = "0.4.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "680dc087785c5230f8e8843e2e57ac7c1c90488b6a91b88caa265410568f441b" +checksum = "302266479cb963552d11bd042013a58ef1adc56768016c8b82b4199488f2d4ad" dependencies = [ "brotli", "compression-core", @@ -1467,9 +1484,9 @@ dependencies = [ [[package]] name = "compression-core" -version = "0.4.30" +version = "0.4.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3a9b614a5787ef0c8802a55766480563cb3a93b435898c422ed2a359cf811582" +checksum = "75984efb6ed102a0d42db99afb6c1948f0380d1d91808d5529916e6c08b49d8d" [[package]] name = "concurrent-queue" @@ -1506,7 +1523,7 @@ checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8" [[package]] name = "constellation" version = "0.0.1" -source = "git+https://github.com/servo/servo?rev=158bf97e#158bf97e30779b1068b7b69f05c85a98ac4ab06d" +source = "git+https://github.com/servo/servo?rev=39d3fc6c#39d3fc6c1329b398e8622d5686af47d31b73dada" dependencies = [ "background_hang_monitor", "background_hang_monitor_api", @@ -1533,7 +1550,7 @@ dependencies = [ "parking_lot", "profile", "profile_traits", - "rand 0.9.2", + "rand", "rustc-hash 2.1.1", "script_traits", "serde", @@ -1553,7 +1570,7 @@ dependencies = [ [[package]] name = "constellation_traits" version = "0.0.1" -source = "git+https://github.com/servo/servo?rev=158bf97e#158bf97e30779b1068b7b69f05c85a98ac4ab06d" +source = "git+https://github.com/servo/servo?rev=39d3fc6c#39d3fc6c1329b398e8622d5686af47d31b73dada" dependencies = [ "base", "canvas_traits", @@ -1563,7 +1580,7 @@ dependencies = [ "embedder_traits", "euclid", "fonts_traits", - "http 1.3.1", + "http 1.4.0", "hyper_serde", "ipc-channel", "keyboard-types 0.8.3", @@ -1579,7 +1596,6 @@ dependencies = [ "servo_url", "storage_traits", "strum", - "strum_macros", "stylo_traits", "uuid", "webgpu_traits", @@ -1721,6 +1737,15 @@ dependencies = [ "libc", ] +[[package]] +name = "core2" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b49ba7ef1ad6107f8824dbe97de947cbaac53c44e7f9756a1fba0d37c1eec505" +dependencies = [ + "memchr", +] + [[package]] name = "core_maths" version = "0.1.1" @@ -1864,9 +1889,9 @@ dependencies = [ [[package]] name = "crypto-common" -version = "0.1.6" +version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" +checksum = "78c8292055d1c1df0cce5d180393dc8cce0abec0a7102adb6c7b1eef6016d60a" dependencies = [ "generic-array", "rand_core 0.6.4", @@ -1875,9 +1900,9 @@ dependencies = [ [[package]] name = "cssparser" -version = "0.35.0" +version = "0.36.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e901edd733a1472f944a45116df3f846f54d37e67e68640ac8bb69689aca2aa" +checksum = "dae61cf9c0abb83bd659dab65b7e4e38d8236824c85f0f804f173567bda257d2" dependencies = [ "cssparser-macros", "dtoa-short", @@ -1993,7 +2018,7 @@ checksum = "be1e0bca6c3637f992fc1cc7cbc52a78c1ef6db076dbf1059c4323d6a2048376" [[package]] name = "deny_public_fields" version = "0.0.1" -source = "git+https://github.com/servo/servo?rev=158bf97e#158bf97e30779b1068b7b69f05c85a98ac4ab06d" +source = "git+https://github.com/servo/servo?rev=39d3fc6c#39d3fc6c1329b398e8622d5686af47d31b73dada" dependencies = [ "syn", "synstructure", @@ -2055,7 +2080,7 @@ dependencies = [ [[package]] name = "devtools" version = "0.0.1" -source = "git+https://github.com/servo/servo?rev=158bf97e#158bf97e30779b1068b7b69f05c85a98ac4ab06d" +source = "git+https://github.com/servo/servo?rev=39d3fc6c#39d3fc6c1329b398e8622d5686af47d31b73dada" dependencies = [ "base", "base64 0.22.1", @@ -2064,12 +2089,12 @@ dependencies = [ "devtools_traits", "embedder_traits", "headers 0.4.1", - "http 1.3.1", + "http 1.4.0", "ipc-channel", "log", "net", "net_traits", - "rand 0.9.2", + "rand", "rustc-hash 2.1.1", "serde", "serde_json", @@ -2081,12 +2106,12 @@ dependencies = [ [[package]] name = "devtools_traits" version = "0.0.1" -source = "git+https://github.com/servo/servo?rev=158bf97e#158bf97e30779b1068b7b69f05c85a98ac4ab06d" +source = "git+https://github.com/servo/servo?rev=39d3fc6c#39d3fc6c1329b398e8622d5686af47d31b73dada" dependencies = [ "base", "bitflags 2.10.0", "embedder_traits", - "http 1.3.1", + "http 1.4.0", "ipc-channel", "log", "malloc_size_of_derive", @@ -2175,7 +2200,7 @@ version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "330c60081dcc4c72131f8eb70510f1ac07223e5d4163db481a04a0befcffa412" dependencies = [ - "libloading 0.7.4", + "libloading 0.8.9", ] [[package]] @@ -2190,7 +2215,7 @@ dependencies = [ [[package]] name = "dom_struct" version = "0.0.1" -source = "git+https://github.com/servo/servo?rev=158bf97e#158bf97e30779b1068b7b69f05c85a98ac4ab06d" +source = "git+https://github.com/servo/servo?rev=39d3fc6c#39d3fc6c1329b398e8622d5686af47d31b73dada" dependencies = [ "quote", "syn", @@ -2199,7 +2224,7 @@ dependencies = [ [[package]] name = "domobject_derive" version = "0.0.1" -source = "git+https://github.com/servo/servo?rev=158bf97e#158bf97e30779b1068b7b69f05c85a98ac4ab06d" +source = "git+https://github.com/servo/servo?rev=39d3fc6c#39d3fc6c1329b398e8622d5686af47d31b73dada" dependencies = [ "proc-macro2", "quote", @@ -2337,14 +2362,14 @@ dependencies = [ [[package]] name = "embedder_traits" version = "0.0.1" -source = "git+https://github.com/servo/servo?rev=158bf97e#158bf97e30779b1068b7b69f05c85a98ac4ab06d" +source = "git+https://github.com/servo/servo?rev=39d3fc6c#39d3fc6c1329b398e8622d5686af47d31b73dada" dependencies = [ "base", "bitflags 2.10.0", "cookie 0.18.1", "crossbeam-channel", "euclid", - "http 1.3.1", + "http 1.4.0", "hyper_serde", "image", "ipc-channel", @@ -2359,7 +2384,6 @@ dependencies = [ "servo_malloc_size_of", "servo_url", "strum", - "strum_macros", "stylo", "stylo_traits", "url", @@ -2397,9 +2421,9 @@ dependencies = [ [[package]] name = "endi" -version = "1.1.0" +version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3d8a32ae18130a3c84dd492d4215c3d913c3b07c6b63c2eb3eb7ff1101ab7bf" +checksum = "66b7e2430c6dff6a955451e2cfc438f09cea1965a9d6f87f7e3b90decc014099" [[package]] name = "enumflags2" @@ -2478,7 +2502,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "39cab71617ae0d63f51a36d69f866391735b51691dbda63cf6f96d042b63efeb" dependencies = [ "libc", - "windows-sys 0.59.0", + "windows-sys 0.61.2", ] [[package]] @@ -2662,9 +2686,9 @@ dependencies = [ [[package]] name = "find-msvc-tools" -version = "0.1.4" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "52051878f80a721bb68ebfbc930e07b65ba72f2da88968ea5c06fd6ca3d3a127" +checksum = "3a3076410a55c90011c298b04d0cfa770b00fa04e1e3c97d3f6c9de105a03844" [[package]] name = "fixed_decimal" @@ -2786,13 +2810,14 @@ dependencies = [ [[package]] name = "fonts" version = "0.0.1" -source = "git+https://github.com/servo/servo?rev=158bf97e#158bf97e30779b1068b7b69f05c85a98ac4ab06d" +source = "git+https://github.com/servo/servo?rev=39d3fc6c#39d3fc6c1329b398e8622d5686af47d31b73dada" dependencies = [ "app_units", "base", "bitflags 2.10.0", "byteorder", "compositing_traits", + "content-security-policy", "core-foundation 0.9.4", "core-graphics 0.23.2", "core-text", @@ -2838,7 +2863,7 @@ dependencies = [ [[package]] name = "fonts_traits" version = "0.0.1" -source = "git+https://github.com/servo/servo?rev=158bf97e#158bf97e30779b1068b7b69f05c85a98ac4ab06d" +source = "git+https://github.com/servo/servo?rev=39d3fc6c#39d3fc6c1329b398e8622d5686af47d31b73dada" dependencies = [ "atomic_refcell", "base", @@ -3094,9 +3119,9 @@ dependencies = [ [[package]] name = "generic-array" -version = "0.14.9" +version = "0.14.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4bb6743198531e02858aeaea5398fcc883e71851fcbcb5a2f773e2fb6cb1edf2" +checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" dependencies = [ "typenum", "version_check", @@ -3165,6 +3190,16 @@ dependencies = [ "weezl", ] +[[package]] +name = "gif" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f954a9e9159ec994f73a30a12b96a702dde78f5547bcb561174597924f7d4162" +dependencies = [ + "color_quant", + "weezl", +] + [[package]] name = "gimli" version = "0.32.3" @@ -3346,9 +3381,9 @@ dependencies = [ [[package]] name = "grid" -version = "0.18.0" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "12101ecc8225ea6d675bc70263074eab6169079621c2186fe0c66590b2df9681" +checksum = "f9e2d4c0a8296178d8802098410ca05d86b17a10bb5ab559b3fb404c1f948220" [[package]] name = "group" @@ -3391,7 +3426,7 @@ dependencies = [ "fnv", "futures-core", "futures-sink", - "http 1.3.1", + "http 1.4.0", "indexmap", "slab", "tokio", @@ -3502,7 +3537,7 @@ dependencies = [ "base64 0.22.1", "bytes", "headers-core 0.3.0", - "http 1.3.1", + "http 1.4.0", "httpdate", "mime", "sha1", @@ -3523,7 +3558,7 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "54b4a22553d4242c49fddb9ba998a99962b5cc6f22cb5a3482bec22522403ce4" dependencies = [ - "http 1.3.1", + "http 1.4.0", ] [[package]] @@ -3582,13 +3617,12 @@ dependencies = [ [[package]] name = "html5ever" -version = "0.35.0" +version = "0.36.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "55d958c2f74b664487a2035fe1dadb032c48718a03b63f3ab0b8537db8549ed4" +checksum = "6452c4751a24e1b99c3260d505eaeee76a050573e61f30ac2c924ddc7236f01e" dependencies = [ "log", "markup5ever", - "match_token", ] [[package]] @@ -3610,12 +3644,11 @@ dependencies = [ [[package]] name = "http" -version = "1.3.1" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4a85d31aea989eead29a3aaf9e1115a180df8282431156e533de47660892565" +checksum = "e3ba2a386d7f85a81f119ad7498ebe444d2e22c2af0b86b069416ace48b3311a" dependencies = [ "bytes", - "fnv", "itoa", ] @@ -3637,7 +3670,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1efedce1fb8e6913f23e0c92de8e62cd5b772a67e7b3946df930a62566c93184" dependencies = [ "bytes", - "http 1.3.1", + "http 1.4.0", ] [[package]] @@ -3648,7 +3681,7 @@ checksum = "b021d93e26becf5dc7e1b75b1bed1fd93124b374ceb73f43d4d4eafec896a64a" dependencies = [ "bytes", "futures-core", - "http 1.3.1", + "http 1.4.0", "http-body 1.0.1", "pin-project-lite", ] @@ -3691,16 +3724,16 @@ dependencies = [ [[package]] name = "hyper" -version = "1.8.0" +version = "1.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1744436df46f0bde35af3eda22aeaba453aada65d8f1c171cd8a5f59030bd69f" +checksum = "2ab2d4f250c3d7b1c9fcdff1cece94ea4e2dfbec68614f7b87cb205f24ca9d11" dependencies = [ "atomic-waker", "bytes", "futures-channel", "futures-core", "h2 0.4.12", - "http 1.3.1", + "http 1.4.0", "http-body 1.0.1", "httparse", "itoa", @@ -3717,8 +3750,8 @@ version = "0.27.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e3c93eb611681b207e1fe55d5a71ecf91572ec8a6705cdb6857f7d8d5242cf58" dependencies = [ - "http 1.3.1", - "hyper 1.8.0", + "http 1.4.0", + "hyper 1.8.1", "hyper-util", "log", "rustls", @@ -3731,17 +3764,17 @@ dependencies = [ [[package]] name = "hyper-util" -version = "0.1.17" +version = "0.1.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c6995591a8f1380fcb4ba966a252a4b29188d51d2b89e3a252f5305be65aea8" +checksum = "52e9a2a24dc5c6821e71a7030e1e14b7b632acac55c40e9d2e082c621261bb56" dependencies = [ "bytes", "futures-channel", "futures-core", "futures-util", - "http 1.3.1", + "http 1.4.0", "http-body 1.0.1", - "hyper 1.8.0", + "hyper 1.8.1", "libc", "pin-project-lite", "socket2 0.6.1", @@ -3753,12 +3786,12 @@ dependencies = [ [[package]] name = "hyper_serde" version = "0.13.2" -source = "git+https://github.com/servo/servo?rev=158bf97e#158bf97e30779b1068b7b69f05c85a98ac4ab06d" +source = "git+https://github.com/servo/servo?rev=39d3fc6c#39d3fc6c1329b398e8622d5686af47d31b73dada" dependencies = [ "cookie 0.18.1", "headers 0.4.1", - "http 1.3.1", - "hyper 1.8.0", + "http 1.4.0", + "hyper 1.8.1", "mime", "serde_bytes", "serde_core", @@ -4102,7 +4135,7 @@ dependencies = [ "icu_properties 1.5.1", "icu_provider 1.5.0", "icu_provider_adapters", - "icu_segmenter", + "icu_segmenter 1.5.0", "icu_timezone", "tinystr 0.7.6", "unicode-bidi", @@ -4286,6 +4319,21 @@ version = "1.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "52b1a7fbdbf3958f1be8354cb59ac73f165b7b7082d447ff2090355c9a069120" +[[package]] +name = "icu_locale" +version = "2.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "532b11722e350ab6bf916ba6eb0efe3ee54b932666afec989465f9243fe6dd60" +dependencies = [ + "icu_collections 2.1.1", + "icu_locale_core", + "icu_locale_data", + "icu_provider 2.1.1", + "potential_utf", + "tinystr 0.8.2", + "zerovec 0.11.5", +] + [[package]] name = "icu_locale_core" version = "2.1.1" @@ -4300,6 +4348,12 @@ dependencies = [ "zerovec 0.11.5", ] +[[package]] +name = "icu_locale_data" +version = "2.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f03e2fcaefecdf05619f3d6f91740e79ab969b4dd54f77cbf546b1d0d28e3147" + [[package]] name = "icu_locid" version = "1.5.0" @@ -4477,6 +4531,8 @@ checksum = "85962cf0ce02e1e0a629cc34e7ca3e373ce20dda4c4d7294bbd0bf1fdb59e614" dependencies = [ "displaydoc", "icu_locale_core", + "serde", + "stable_deref_trait", "writeable 0.6.2", "yoke 0.8.1", "zerofrom", @@ -4519,17 +4575,39 @@ dependencies = [ "icu_collections 1.5.0", "icu_locid", "icu_provider 1.5.0", - "icu_segmenter_data", + "icu_segmenter_data 1.5.1", "utf8_iter", "zerovec 0.10.4", ] +[[package]] +name = "icu_segmenter" +version = "2.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43da5e7e9b540df15e53ca27f69b50e36e01b652584b40b3335ed65d18303834" +dependencies = [ + "core_maths", + "icu_collections 2.1.1", + "icu_locale", + "icu_provider 2.1.1", + "icu_segmenter_data 2.1.1", + "potential_utf", + "utf8_iter", + "zerovec 0.11.5", +] + [[package]] name = "icu_segmenter_data" version = "1.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a1e52775179941363cc594e49ce99284d13d6948928d8e72c755f55e98caa1eb" +[[package]] +name = "icu_segmenter_data" +version = "2.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ebbb7321d9e21d25f5660366cb6c08201d0175898a3a6f7a41ee9685af21c80" + [[package]] name = "icu_timezone" version = "1.5.0" @@ -4580,15 +4658,15 @@ dependencies = [ [[package]] name = "image" -version = "0.25.8" +version = "0.25.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "529feb3e6769d234375c4cf1ee2ce713682b8e76538cb13f9fc23e1400a591e7" +checksum = "e6506c6c10786659413faa717ceebcb8f70731c0a60cbae39795fdf114519c1a" dependencies = [ "bytemuck", "byteorder-lite", "color_quant", "exr", - "gif", + "gif 0.14.0", "image-webp", "moxcms", "num-traits", @@ -4598,8 +4676,8 @@ dependencies = [ "rayon", "rgb", "tiff", - "zune-core", - "zune-jpeg", + "zune-core 0.5.0", + "zune-jpeg 0.5.5", ] [[package]] @@ -4632,9 +4710,9 @@ checksum = "396dda16a82727ec2d14aabc1167832bb823d849c54a246ca0cff6cfb7bc697c" [[package]] name = "indexmap" -version = "2.12.0" +version = "2.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6717a8d2a5a929a1a2eb43a12812498ed141a0bcfb7e8f7844fbdbe4303bba9f" +checksum = "0ad4bb2b565bca0645f4d68c5c9af97fba094e9791da685bf83cb5f3ce74acf2" dependencies = [ "equivalent", "hashbrown 0.16.1", @@ -4722,7 +4800,7 @@ dependencies = [ "fnv", "libc", "mio", - "rand 0.9.2", + "rand", "serde", "tempfile", "uuid", @@ -4737,9 +4815,9 @@ checksum = "a6cb138bb79a146c1bd460005623e142ef0181e3d0219cb493e02f7d08a35695" [[package]] name = "itertools" -version = "0.12.1" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba291022dbbd398a455acf126c1e341954079855bc60dfdda641363bd6922569" +checksum = "413ee7dfc52ee1a4949ceeb7dbc8a33f2d6c088194d9f922fb8318faf1f01186" dependencies = [ "either", ] @@ -4828,9 +4906,9 @@ dependencies = [ [[package]] name = "js-sys" -version = "0.3.82" +version = "0.3.83" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b011eec8cc36da2aab2d5cff675ec18454fad408585853910a202391cf9f8e65" +checksum = "464a3709c7f55f1f721e5389aa6ea4e3bc6aba669353300af094b29ffbdde1d8" dependencies = [ "once_cell", "wasm-bindgen", @@ -4839,13 +4917,22 @@ dependencies = [ [[package]] name = "jstraceable_derive" version = "0.0.1" -source = "git+https://github.com/servo/servo?rev=158bf97e#158bf97e30779b1068b7b69f05c85a98ac4ab06d" +source = "git+https://github.com/servo/servo?rev=39d3fc6c#39d3fc6c1329b398e8622d5686af47d31b73dada" dependencies = [ "proc-macro2", "syn", "synstructure", ] +[[package]] +name = "keccak" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ecc2af9a1119c51f12a14607e783cb977bde58bc069ff0c3da1095e635d70654" +dependencies = [ + "cpufeatures", +] + [[package]] name = "keyboard-types" version = "0.7.0" @@ -4911,7 +4998,7 @@ dependencies = [ [[package]] name = "layout" version = "0.0.1" -source = "git+https://github.com/servo/servo?rev=158bf97e#158bf97e30779b1068b7b69f05c85a98ac4ab06d" +source = "git+https://github.com/servo/servo?rev=39d3fc6c#39d3fc6c1329b398e8622d5686af47d31b73dada" dependencies = [ "app_units", "atomic_refcell", @@ -4926,7 +5013,7 @@ dependencies = [ "fonts_traits", "html5ever", "icu_locid", - "icu_segmenter", + "icu_segmenter 1.5.0", "ipc-channel", "itertools 0.14.0", "kurbo 0.12.0", @@ -4965,14 +5052,16 @@ dependencies = [ [[package]] name = "layout_api" version = "0.0.1" -source = "git+https://github.com/servo/servo?rev=158bf97e#158bf97e30779b1068b7b69f05c85a98ac4ab06d" +source = "git+https://github.com/servo/servo?rev=39d3fc6c#39d3fc6c1329b398e8622d5686af47d31b73dada" dependencies = [ "app_units", "atomic_refcell", + "background_hang_monitor_api", "base", "bitflags 2.10.0", "compositing_traits", "constellation_traits", + "crossbeam-channel", "embedder_traits", "euclid", "fonts", @@ -5066,7 +5155,7 @@ dependencies = [ [[package]] name = "libservo" version = "0.0.1" -source = "git+https://github.com/servo/servo?rev=158bf97e#158bf97e30779b1068b7b69f05c85a98ac4ab06d" +source = "git+https://github.com/servo/servo?rev=39d3fc6c#39d3fc6c1329b398e8622d5686af47d31b73dada" dependencies = [ "arboard", "background_hang_monitor", @@ -5105,7 +5194,7 @@ dependencies = [ "script", "script_traits", "serde", - "servo-media", + "servo-media 0.1.0 (git+https://github.com/servo/media)", "servo-media-dummy", "servo-tracing", "servo_allocator", @@ -5231,6 +5320,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "224399e74b87b5f3557511d98dff8b14089b3dadafcab6bb93eab67d3aace965" dependencies = [ "scopeguard", + "serde", ] [[package]] @@ -5270,9 +5360,9 @@ dependencies = [ [[package]] name = "lyon_geom" -version = "1.0.17" +version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e16770d760c7848b0c1c2d209101e408207a65168109509f8483837a36cf2e7" +checksum = "e260b6de923e6e47adfedf6243013a7a874684165a6a277594ee3906021b2343" dependencies = [ "arrayvec", "euclid", @@ -5326,26 +5416,15 @@ dependencies = [ [[package]] name = "markup5ever" -version = "0.35.0" +version = "0.36.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "311fe69c934650f8f19652b3946075f0fc41ad8757dbb68f1ca14e7900ecc1c3" +checksum = "6c3294c4d74d0742910f8c7b466f44dda9eb2d5742c1e430138df290a1e8451c" dependencies = [ "log", "tendril", "web_atoms", ] -[[package]] -name = "match_token" -version = "0.35.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac84fd3f360fcc43dc5f5d186f02a94192761a080e8bc58621ad4d12296a58cf" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - [[package]] name = "matches" version = "0.1.10" @@ -5365,7 +5444,7 @@ dependencies = [ [[package]] name = "media" version = "0.0.1" -source = "git+https://github.com/servo/servo?rev=158bf97e#158bf97e30779b1068b7b69f05c85a98ac4ab06d" +source = "git+https://github.com/servo/servo?rev=39d3fc6c#39d3fc6c1329b398e8622d5686af47d31b73dada" dependencies = [ "compositing_traits", "euclid", @@ -5373,7 +5452,7 @@ dependencies = [ "log", "rustc-hash 2.1.1", "serde", - "servo-media", + "servo-media 0.1.0 (git+https://github.com/servo/media)", "servo_config", "webrender_api", ] @@ -5435,7 +5514,7 @@ dependencies = [ [[package]] name = "metrics" version = "0.0.1" -source = "git+https://github.com/servo/servo?rev=158bf97e#158bf97e30779b1068b7b69f05c85a98ac4ab06d" +source = "git+https://github.com/servo/servo?rev=39d3fc6c#39d3fc6c1329b398e8622d5686af47d31b73dada" dependencies = [ "base", "compositing_traits", @@ -5494,9 +5573,9 @@ dependencies = [ [[package]] name = "moxcms" -version = "0.7.9" +version = "0.7.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fbdd3d7436f8b5e892b8b7ea114271ff0fa00bc5acae845d53b07d498616ef6" +checksum = "80986bbbcf925ebd3be54c26613d861255284584501595cf418320c078945608" dependencies = [ "num-traits", "pxfm", @@ -5504,21 +5583,21 @@ dependencies = [ [[package]] name = "mozangle" -version = "0.5.3" +version = "0.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ab823731ea6297e7280dade983df955d1a8209d2deb44f505932b8873168992" +checksum = "97f4fcc47005b28e642cc098f2048a236fd8c531fc7a11b8b8bf14fb1230f122" dependencies = [ - "bindgen 0.71.1", + "bindgen", "cc", "walkdir", ] [[package]] name = "mozjs" -version = "0.14.1" -source = "git+https://github.com/servo/mozjs#18029eac79a9f80043a30cc809184e569a47fd0f" +version = "0.14.2" +source = "git+https://github.com/servo/mozjs#4c928791be0effe46d6810edbf63d4a728b13821" dependencies = [ - "bindgen 0.71.1", + "bindgen", "cc", "encoding_rs", "libc", @@ -5528,10 +5607,10 @@ dependencies = [ [[package]] name = "mozjs_sys" -version = "0.140.0-8" -source = "git+https://github.com/servo/mozjs#18029eac79a9f80043a30cc809184e569a47fd0f" +version = "0.140.5-6" +source = "git+https://github.com/servo/mozjs#4c928791be0effe46d6810edbf63d4a728b13821" dependencies = [ - "bindgen 0.71.1", + "bindgen", "cc", "encoding_c", "encoding_c_mem", @@ -5670,7 +5749,7 @@ dependencies = [ [[package]] name = "net" version = "0.0.1" -source = "git+https://github.com/servo/servo?rev=158bf97e#158bf97e30779b1068b7b69f05c85a98ac4ab06d" +source = "git+https://github.com/servo/servo?rev=39d3fc6c#39d3fc6c1329b398e8622d5686af47d31b73dada" dependencies = [ "async-compression", "async-recursion", @@ -5692,9 +5771,9 @@ dependencies = [ "futures-util", "generic-array", "headers 0.4.1", - "http 1.3.1", + "http 1.4.0", "http-body-util", - "hyper 1.8.0", + "hyper 1.8.1", "hyper-rustls", "hyper-util", "hyper_serde", @@ -5707,6 +5786,7 @@ dependencies = [ "mime_guess", "net_traits", "nom 8.0.0", + "parking_lot", "pixels", "profile_traits", "rayon", @@ -5738,7 +5818,7 @@ dependencies = [ [[package]] name = "net_traits" version = "0.0.1" -source = "git+https://github.com/servo/servo?rev=158bf97e#158bf97e30779b1068b7b69f05c85a98ac4ab06d" +source = "git+https://github.com/servo/servo?rev=39d3fc6c#39d3fc6c1329b398e8622d5686af47d31b73dada" dependencies = [ "base", "compositing_traits", @@ -5748,7 +5828,7 @@ dependencies = [ "data-url", "embedder_traits", "headers 0.4.1", - "http 1.3.1", + "http 1.4.0", "hyper-util", "hyper_serde", "indexmap", @@ -5757,10 +5837,11 @@ dependencies = [ "malloc_size_of_derive", "mime", "num-traits", + "parking_lot", "percent-encoding", "pixels", "profile_traits", - "rand 0.9.2", + "rand", "rustc-hash 2.1.1", "rustls-pki-types", "serde", @@ -6518,6 +6599,12 @@ version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" +[[package]] +name = "pastey" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "35fb2e5f958ec131621fdd531e9fc186ed768cbe395337403ae56c17a74c68ec" + [[package]] name = "peek-poke" version = "0.3.0" @@ -6578,19 +6665,20 @@ dependencies = [ [[package]] name = "phf" -version = "0.11.3" +version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fd6780a80ae0c52cc120a26a1a42c1ae51b247a253e4e06113d23d2c2edd078" +checksum = "c1562dc717473dbaa4c1f85a36410e03c047b2e7df7f45ee938fbef64ae7fadf" dependencies = [ "phf_macros", "phf_shared", + "serde", ] [[package]] name = "phf_codegen" -version = "0.11.3" +version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aef8048c789fa5e851558d709946d6d79a8ff88c0440c587967f8e94bfb1216a" +checksum = "49aa7f9d80421bca176ca8dbfebe668cc7a2684708594ec9f3c0db0805d5d6e1" dependencies = [ "phf_generator", "phf_shared", @@ -6598,19 +6686,19 @@ dependencies = [ [[package]] name = "phf_generator" -version = "0.11.3" +version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c80231409c20246a13fddb31776fb942c38553c51e871f8cbd687a4cfb5843d" +checksum = "135ace3a761e564ec88c03a77317a7c6b80bb7f7135ef2544dbe054243b89737" dependencies = [ + "fastrand", "phf_shared", - "rand 0.8.5", ] [[package]] name = "phf_macros" -version = "0.11.3" +version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f84ac04429c13a7ff43785d75ad27569f2951ce0ffd30a3321230db2fc727216" +checksum = "812f032b54b1e759ccd5f8b6677695d5268c588701effba24601f6932f8269ef" dependencies = [ "phf_generator", "phf_shared", @@ -6621,9 +6709,9 @@ dependencies = [ [[package]] name = "phf_shared" -version = "0.11.3" +version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67eabc2ef2a60eb7faa00097bd1ffdb5bd28e62bf39990626a582201b7a754e5" +checksum = "e57fef6bc5981e38c2ce2d63bfa546861309f875b8a75f092d1d54ae2d64f266" dependencies = [ "siphasher", ] @@ -6686,7 +6774,7 @@ dependencies = [ [[package]] name = "pixels" version = "0.0.1" -source = "git+https://github.com/servo/servo?rev=158bf97e#158bf97e30779b1068b7b69f05c85a98ac4ab06d" +source = "git+https://github.com/servo/servo?rev=39d3fc6c#39d3fc6c1329b398e8622d5686af47d31b73dada" dependencies = [ "euclid", "image", @@ -6705,6 +6793,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f950b2377845cebe5cf8b5165cb3cc1a5e0fa5cfa3e1f7f55707d8fd82e0a7b7" dependencies = [ "der", + "rand_core 0.6.4", "spki", ] @@ -6810,6 +6899,8 @@ version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b73949432f5e2a09657003c25bca5e19a0e9c84f8058ca374f49e0ebe605af77" dependencies = [ + "serde_core", + "writeable 0.6.2", "zerovec 0.11.5", ] @@ -6865,7 +6956,7 @@ version = "3.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "219cb19e96be00ab2e37d6e299658a0cfa83e52429179969b0f0121b4ac46983" dependencies = [ - "toml_edit 0.23.7", + "toml_edit", ] [[package]] @@ -6880,7 +6971,7 @@ dependencies = [ [[package]] name = "profile" version = "0.0.1" -source = "git+https://github.com/servo/servo?rev=158bf97e#158bf97e30779b1068b7b69f05c85a98ac4ab06d" +source = "git+https://github.com/servo/servo?rev=39d3fc6c#39d3fc6c1329b398e8622d5686af47d31b73dada" dependencies = [ "base", "ipc-channel", @@ -6900,7 +6991,7 @@ dependencies = [ [[package]] name = "profile_traits" version = "0.0.1" -source = "git+https://github.com/servo/servo?rev=158bf97e#158bf97e30779b1068b7b69f05c85a98ac4ab06d" +source = "git+https://github.com/servo/servo?rev=39d3fc6c#39d3fc6c1329b398e8622d5686af47d31b73dada" dependencies = [ "base", "crossbeam-channel", @@ -6954,9 +7045,9 @@ checksum = "007d8adb5ddab6f8e3f491ac63566a7d5002cc7ed73901f72057943fa71ae1ae" [[package]] name = "pxfm" -version = "0.1.25" +version = "0.1.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3cbdf373972bf78df4d3b518d07003938e2c7d1fb5891e55f9cb6df57009d84" +checksum = "b3502d6155304a4173a5f2c34b52b7ed0dd085890326cb50fd625fdf39e86b3b" dependencies = [ "num-traits", ] @@ -7021,37 +7112,16 @@ version = "5.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "69cdb34c158ceb288df11e18b4bd39de994f6657d83847bdffdbd7f346754b0f" -[[package]] -name = "rand" -version = "0.8.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" -dependencies = [ - "libc", - "rand_chacha 0.3.1", - "rand_core 0.6.4", -] - [[package]] name = "rand" version = "0.9.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6db2770f06117d490610c7488547d543617b21bfa07796d7a12f6f1bd53850d1" dependencies = [ - "rand_chacha 0.9.0", + "rand_chacha", "rand_core 0.9.3", ] -[[package]] -name = "rand_chacha" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" -dependencies = [ - "ppv-lite86", - "rand_core 0.6.4", -] - [[package]] name = "rand_chacha" version = "0.9.0" @@ -7083,7 +7153,7 @@ dependencies = [ [[package]] name = "range" version = "0.0.1" -source = "git+https://github.com/servo/servo?rev=158bf97e#158bf97e30779b1068b7b69f05c85a98ac4ab06d" +source = "git+https://github.com/servo/servo?rev=39d3fc6c#39d3fc6c1329b398e8622d5686af47d31b73dada" dependencies = [ "malloc_size_of_derive", "num-traits", @@ -7099,19 +7169,21 @@ checksum = "c3d6831663a5098ea164f89cff59c6284e95f4e3c76ce9848d4529f5ccca9bde" [[package]] name = "rav1e" -version = "0.7.1" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd87ce80a7665b1cce111f8a16c1f3929f6547ce91ade6addf4ec86a8dda5ce9" +checksum = "43b6dd56e85d9483277cde964fd1bdb0428de4fec5ebba7540995639a21cb32b" dependencies = [ + "aligned-vec", "arbitrary", "arg_enum_proc_macro", "arrayvec", + "av-scenechange", "av1-grain", "bitstream-io", "built", "cfg-if", "interpolate_name", - "itertools 0.12.1", + "itertools 0.14.0", "libc", "libfuzzer-sys", "log", @@ -7120,23 +7192,21 @@ dependencies = [ "noop_proc_macro", "num-derive", "num-traits", - "once_cell", "paste", "profiling", - "rand 0.8.5", - "rand_chacha 0.3.1", + "rand", + "rand_chacha", "simd_helpers", - "system-deps", - "thiserror 1.0.69", + "thiserror 2.0.17", "v_frame", "wasm-bindgen", ] [[package]] name = "ravif" -version = "0.11.20" +version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5825c26fddd16ab9f515930d49028a630efec172e903483c94796cfe31893e6b" +checksum = "ef69c1990ceef18a116855938e74793a5f7496ee907562bd0857b6ac734ab285" dependencies = [ "avif-serialize", "imgref", @@ -7264,7 +7334,7 @@ version = "0.45.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a8928798c0a55e03c9ca6c4c6846f76377427d2c1e1f7e6de3c06ae57942df43" dependencies = [ - "gif", + "gif 0.13.3", "image-webp", "log", "pico-args", @@ -7272,7 +7342,7 @@ dependencies = [ "svgtypes", "tiny-skia", "usvg", - "zune-jpeg", + "zune-jpeg 0.4.21", ] [[package]] @@ -7412,7 +7482,7 @@ dependencies = [ "errno", "libc", "linux-raw-sys 0.11.0", - "windows-sys 0.59.0", + "windows-sys 0.61.2", ] [[package]] @@ -7441,9 +7511,9 @@ dependencies = [ [[package]] name = "rustls-pki-types" -version = "1.13.0" +version = "1.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94182ad936a0c91c324cd46c6511b9510ed16af436d7b5bab34beab0afd55f7a" +checksum = "708c0f9d5f54ba0272468c1d306a52c495b31fa155e91bc25371e6df7996908c" dependencies = [ "zeroize", ] @@ -7520,7 +7590,7 @@ checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" [[package]] name = "script" version = "0.0.1" -source = "git+https://github.com/servo/servo?rev=158bf97e#158bf97e30779b1068b7b69f05c85a98ac4ab06d" +source = "git+https://github.com/servo/servo?rev=39d3fc6c#39d3fc6c1329b398e8622d5686af47d31b73dada" dependencies = [ "aes", "aes-gcm", @@ -7536,6 +7606,7 @@ dependencies = [ "base64ct", "bincode 1.3.3", "bitflags 2.10.0", + "brotli", "canvas_traits", "cbc", "chrono", @@ -7550,8 +7621,10 @@ dependencies = [ "data-url", "deny_public_fields", "devtools_traits", + "digest", "dom_struct", "domobject_derive", + "ecdsa", "elliptic-curve", "embedder_traits", "encoding_rs", @@ -7561,8 +7634,9 @@ dependencies = [ "fonts_traits", "glow", "headers 0.4.1", + "hkdf", "html5ever", - "http 1.3.1", + "http 1.4.0", "hyper_serde", "image", "indexmap", @@ -7596,7 +7670,7 @@ dependencies = [ "pixels", "pkcs8", "profile_traits", - "rand 0.9.2", + "rand", "range", "regex", "rustc-hash 2.1.1", @@ -7606,16 +7680,18 @@ dependencies = [ "selectors", "serde", "serde_json", - "servo-media", + "servo-media 0.1.0 (git+https://github.com/servo/media)", "servo_arc", "servo_config", "servo_geometry", "servo_malloc_size_of", "servo_url", + "sha1", + "sha2", + "sha3", "smallvec", "storage_traits", "strum", - "strum_macros", "stylo", "stylo_atoms", "stylo_dom", @@ -7646,7 +7722,7 @@ dependencies = [ [[package]] name = "script_bindings" version = "0.0.1" -source = "git+https://github.com/servo/servo?rev=158bf97e#158bf97e30779b1068b7b69f05c85a98ac4ab06d" +source = "git+https://github.com/servo/servo?rev=39d3fc6c#39d3fc6c1329b398e8622d5686af47d31b73dada" dependencies = [ "bitflags 2.10.0", "crossbeam-channel", @@ -7683,7 +7759,7 @@ dependencies = [ [[package]] name = "script_traits" version = "0.0.1" -source = "git+https://github.com/servo/servo?rev=158bf97e#158bf97e30779b1068b7b69f05c85a98ac4ab06d" +source = "git+https://github.com/servo/servo?rev=39d3fc6c#39d3fc6c1329b398e8622d5686af47d31b73dada" dependencies = [ "background_hang_monitor_api", "base", @@ -7695,6 +7771,7 @@ dependencies = [ "devtools_traits", "embedder_traits", "euclid", + "fonts_traits", "ipc-channel", "keyboard-types 0.8.3", "log", @@ -7710,7 +7787,6 @@ dependencies = [ "servo_url", "storage_traits", "strum", - "strum_macros", "stylo_atoms", "stylo_traits", "webrender_api", @@ -7732,9 +7808,9 @@ dependencies = [ [[package]] name = "sea-query" -version = "1.0.0-rc.17" +version = "1.0.0-rc.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30d190945ff6b2914ef0631c1933ef67ee142b15f00b72d40bf241147d24b522" +checksum = "89ebab2b9d558deec08e43887a63ed4d96d56b32cb9d98578bd1749e2c8c7e24" dependencies = [ "inherent", "sea-query-derive", @@ -7780,8 +7856,8 @@ dependencies = [ [[package]] name = "selectors" -version = "0.32.0" -source = "git+https://github.com/servo/stylo?branch=2025-10-01#a9f1997d4ff9227c14b4555fd2e812bee48891b8" +version = "0.33.0" +source = "git+https://github.com/servo/stylo?branch=2025-11-01#ae78004b3056c90b66dbba4d92edc0edbc24bc49" dependencies = [ "bitflags 2.10.0", "cssparser", @@ -7868,15 +7944,6 @@ dependencies = [ "syn", ] -[[package]] -name = "serde_spanned" -version = "0.6.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf41e0cfaf7226dca15e8197172c295a782857fcb97fad1808a166870dee75a3" -dependencies = [ - "serde", -] - [[package]] name = "serde_spanned" version = "1.0.3" @@ -7919,6 +7986,7 @@ dependencies = [ "objc2-io-surface", "objc2-metal 0.3.2", "rustls", + "servo-media 0.1.0 (git+https://github.com/servo/media?rev=6c1766f5)", "slint", "slint-build", "smol", @@ -7937,20 +8005,54 @@ dependencies = [ [[package]] name = "servo-media" version = "0.1.0" -source = "git+https://github.com/servo/media#5b788a91d4d69772a4c00f53e7231008df70df9a" +source = "git+https://github.com/servo/media?rev=6c1766f5#6c1766f5f5d5c18d770af002bcd8f79a7910b6d8" +dependencies = [ + "once_cell", + "servo-media-audio 0.2.0 (git+https://github.com/servo/media?rev=6c1766f5)", + "servo-media-player 0.1.0 (git+https://github.com/servo/media?rev=6c1766f5)", + "servo-media-streams 0.1.0 (git+https://github.com/servo/media?rev=6c1766f5)", + "servo-media-traits 0.1.0 (git+https://github.com/servo/media?rev=6c1766f5)", + "servo-media-webrtc 0.1.0 (git+https://github.com/servo/media?rev=6c1766f5)", +] + +[[package]] +name = "servo-media" +version = "0.1.0" +source = "git+https://github.com/servo/media#2c036f20bb03b86dd8fc77acde7aa18c78ec1fbe" dependencies = [ "once_cell", - "servo-media-audio", - "servo-media-player", - "servo-media-streams", - "servo-media-traits", - "servo-media-webrtc", + "servo-media-audio 0.2.0 (git+https://github.com/servo/media)", + "servo-media-player 0.1.0 (git+https://github.com/servo/media)", + "servo-media-streams 0.1.0 (git+https://github.com/servo/media)", + "servo-media-traits 0.1.0 (git+https://github.com/servo/media)", + "servo-media-webrtc 0.1.0 (git+https://github.com/servo/media)", +] + +[[package]] +name = "servo-media-audio" +version = "0.2.0" +source = "git+https://github.com/servo/media?rev=6c1766f5#6c1766f5f5d5c18d770af002bcd8f79a7910b6d8" +dependencies = [ + "byte-slice-cast", + "euclid", + "log", + "num-complex", + "num-traits", + "petgraph", + "serde", + "serde_derive", + "servo-media-derive 0.1.0 (git+https://github.com/servo/media?rev=6c1766f5)", + "servo-media-player 0.1.0 (git+https://github.com/servo/media?rev=6c1766f5)", + "servo-media-streams 0.1.0 (git+https://github.com/servo/media?rev=6c1766f5)", + "servo-media-traits 0.1.0 (git+https://github.com/servo/media?rev=6c1766f5)", + "smallvec", + "speexdsp-resampler", ] [[package]] name = "servo-media-audio" version = "0.2.0" -source = "git+https://github.com/servo/media#5b788a91d4d69772a4c00f53e7231008df70df9a" +source = "git+https://github.com/servo/media#2c036f20bb03b86dd8fc77acde7aa18c78ec1fbe" dependencies = [ "byte-slice-cast", "euclid", @@ -7960,10 +8062,10 @@ dependencies = [ "petgraph", "serde", "serde_derive", - "servo-media-derive", - "servo-media-player", - "servo-media-streams", - "servo-media-traits", + "servo-media-derive 0.1.0 (git+https://github.com/servo/media)", + "servo-media-player 0.1.0 (git+https://github.com/servo/media)", + "servo-media-streams 0.1.0 (git+https://github.com/servo/media)", + "servo-media-traits 0.1.0 (git+https://github.com/servo/media)", "smallvec", "speexdsp-resampler", ] @@ -7971,7 +8073,17 @@ dependencies = [ [[package]] name = "servo-media-derive" version = "0.1.0" -source = "git+https://github.com/servo/media#5b788a91d4d69772a4c00f53e7231008df70df9a" +source = "git+https://github.com/servo/media?rev=6c1766f5#6c1766f5f5d5c18d770af002bcd8f79a7910b6d8" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "servo-media-derive" +version = "0.1.0" +source = "git+https://github.com/servo/media#2c036f20bb03b86dd8fc77acde7aa18c78ec1fbe" dependencies = [ "proc-macro2", "quote", @@ -7981,56 +8093,91 @@ dependencies = [ [[package]] name = "servo-media-dummy" version = "0.1.0" -source = "git+https://github.com/servo/media#5b788a91d4d69772a4c00f53e7231008df70df9a" +source = "git+https://github.com/servo/media#2c036f20bb03b86dd8fc77acde7aa18c78ec1fbe" +dependencies = [ + "ipc-channel", + "servo-media 0.1.0 (git+https://github.com/servo/media)", + "servo-media-audio 0.2.0 (git+https://github.com/servo/media)", + "servo-media-player 0.1.0 (git+https://github.com/servo/media)", + "servo-media-streams 0.1.0 (git+https://github.com/servo/media)", + "servo-media-traits 0.1.0 (git+https://github.com/servo/media)", + "servo-media-webrtc 0.1.0 (git+https://github.com/servo/media)", +] + +[[package]] +name = "servo-media-player" +version = "0.1.0" +source = "git+https://github.com/servo/media?rev=6c1766f5#6c1766f5f5d5c18d770af002bcd8f79a7910b6d8" dependencies = [ "ipc-channel", - "servo-media", - "servo-media-audio", - "servo-media-player", - "servo-media-streams", - "servo-media-traits", - "servo-media-webrtc", + "serde", + "serde_derive", + "servo-media-streams 0.1.0 (git+https://github.com/servo/media?rev=6c1766f5)", + "servo-media-traits 0.1.0 (git+https://github.com/servo/media?rev=6c1766f5)", ] [[package]] name = "servo-media-player" version = "0.1.0" -source = "git+https://github.com/servo/media#5b788a91d4d69772a4c00f53e7231008df70df9a" +source = "git+https://github.com/servo/media#2c036f20bb03b86dd8fc77acde7aa18c78ec1fbe" dependencies = [ "ipc-channel", "serde", "serde_derive", - "servo-media-streams", - "servo-media-traits", + "servo-media-streams 0.1.0 (git+https://github.com/servo/media)", + "servo-media-traits 0.1.0 (git+https://github.com/servo/media)", ] [[package]] name = "servo-media-streams" version = "0.1.0" -source = "git+https://github.com/servo/media#5b788a91d4d69772a4c00f53e7231008df70df9a" +source = "git+https://github.com/servo/media?rev=6c1766f5#6c1766f5f5d5c18d770af002bcd8f79a7910b6d8" dependencies = [ "uuid", ] +[[package]] +name = "servo-media-streams" +version = "0.1.0" +source = "git+https://github.com/servo/media#2c036f20bb03b86dd8fc77acde7aa18c78ec1fbe" +dependencies = [ + "uuid", +] + +[[package]] +name = "servo-media-traits" +version = "0.1.0" +source = "git+https://github.com/servo/media?rev=6c1766f5#6c1766f5f5d5c18d770af002bcd8f79a7910b6d8" + [[package]] name = "servo-media-traits" version = "0.1.0" -source = "git+https://github.com/servo/media#5b788a91d4d69772a4c00f53e7231008df70df9a" +source = "git+https://github.com/servo/media#2c036f20bb03b86dd8fc77acde7aa18c78ec1fbe" + +[[package]] +name = "servo-media-webrtc" +version = "0.1.0" +source = "git+https://github.com/servo/media?rev=6c1766f5#6c1766f5f5d5c18d770af002bcd8f79a7910b6d8" +dependencies = [ + "log", + "servo-media-streams 0.1.0 (git+https://github.com/servo/media?rev=6c1766f5)", + "uuid", +] [[package]] name = "servo-media-webrtc" version = "0.1.0" -source = "git+https://github.com/servo/media#5b788a91d4d69772a4c00f53e7231008df70df9a" +source = "git+https://github.com/servo/media#2c036f20bb03b86dd8fc77acde7aa18c78ec1fbe" dependencies = [ "log", - "servo-media-streams", + "servo-media-streams 0.1.0 (git+https://github.com/servo/media)", "uuid", ] [[package]] name = "servo-tracing" version = "0.0.1" -source = "git+https://github.com/servo/servo?rev=158bf97e#158bf97e30779b1068b7b69f05c85a98ac4ab06d" +source = "git+https://github.com/servo/servo?rev=39d3fc6c#39d3fc6c1329b398e8622d5686af47d31b73dada" dependencies = [ "proc-macro2", "quote", @@ -8040,7 +8187,7 @@ dependencies = [ [[package]] name = "servo_allocator" version = "0.0.1" -source = "git+https://github.com/servo/servo?rev=158bf97e#158bf97e30779b1068b7b69f05c85a98ac4ab06d" +source = "git+https://github.com/servo/servo?rev=39d3fc6c#39d3fc6c1329b398e8622d5686af47d31b73dada" dependencies = [ "libc", "tikv-jemalloc-sys", @@ -8050,8 +8197,8 @@ dependencies = [ [[package]] name = "servo_arc" -version = "0.4.2" -source = "git+https://github.com/servo/stylo?branch=2025-10-01#a9f1997d4ff9227c14b4555fd2e812bee48891b8" +version = "0.4.3" +source = "git+https://github.com/servo/stylo?branch=2025-11-01#ae78004b3056c90b66dbba4d92edc0edbc24bc49" dependencies = [ "serde", "stable_deref_trait", @@ -8060,7 +8207,7 @@ dependencies = [ [[package]] name = "servo_config" version = "0.0.1" -source = "git+https://github.com/servo/servo?rev=158bf97e#158bf97e30779b1068b7b69f05c85a98ac4ab06d" +source = "git+https://github.com/servo/servo?rev=39d3fc6c#39d3fc6c1329b398e8622d5686af47d31b73dada" dependencies = [ "serde", "serde_json", @@ -8072,7 +8219,7 @@ dependencies = [ [[package]] name = "servo_config_macro" version = "0.0.1" -source = "git+https://github.com/servo/servo?rev=158bf97e#158bf97e30779b1068b7b69f05c85a98ac4ab06d" +source = "git+https://github.com/servo/servo?rev=39d3fc6c#39d3fc6c1329b398e8622d5686af47d31b73dada" dependencies = [ "proc-macro2", "quote", @@ -8083,7 +8230,7 @@ dependencies = [ [[package]] name = "servo_geometry" version = "0.0.1" -source = "git+https://github.com/servo/servo?rev=158bf97e#158bf97e30779b1068b7b69f05c85a98ac4ab06d" +source = "git+https://github.com/servo/servo?rev=39d3fc6c#39d3fc6c1329b398e8622d5686af47d31b73dada" dependencies = [ "app_units", "euclid", @@ -8096,7 +8243,7 @@ dependencies = [ [[package]] name = "servo_malloc_size_of" version = "0.0.1" -source = "git+https://github.com/servo/servo?rev=158bf97e#158bf97e30779b1068b7b69f05c85a98ac4ab06d" +source = "git+https://github.com/servo/servo?rev=39d3fc6c#39d3fc6c1329b398e8622d5686af47d31b73dada" dependencies = [ "accountable-refcell", "app_units", @@ -8104,7 +8251,7 @@ dependencies = [ "content-security-policy", "crossbeam-channel", "euclid", - "http 1.3.1", + "http 1.4.0", "indexmap", "ipc-channel", "keyboard-types 0.8.3", @@ -8125,6 +8272,7 @@ dependencies = [ "unicode-script", "url", "urlpattern", + "utf-8", "uuid", "webrender", "webrender_api", @@ -8134,11 +8282,11 @@ dependencies = [ [[package]] name = "servo_url" version = "0.0.1" -source = "git+https://github.com/servo/servo?rev=158bf97e#158bf97e30779b1068b7b69f05c85a98ac4ab06d" +source = "git+https://github.com/servo/servo?rev=39d3fc6c#39d3fc6c1329b398e8622d5686af47d31b73dada" dependencies = [ "encoding_rs", "malloc_size_of_derive", - "rand 0.9.2", + "rand", "serde", "servo_arc", "servo_malloc_size_of", @@ -8174,6 +8322,16 @@ dependencies = [ "digest", ] +[[package]] +name = "sha3" +version = "0.10.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75872d278a8f37ef87fa0ddbda7802605cb18344497949862c0d4dcb291eba60" +dependencies = [ + "digest", + "keccak", +] + [[package]] name = "shlex" version = "1.3.0" @@ -8182,9 +8340,9 @@ checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" [[package]] name = "signal-hook-registry" -version = "1.4.6" +version = "1.4.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2a4719bff48cee6b39d12c020eeb490953ad2443b7055bd0b21fca26bd8c28b" +checksum = "7664a098b8e616bdfcc2dc0e9ac44eb231eedf41db4e9fe95d8d32ec728dedad" dependencies = [ "libc", ] @@ -8235,7 +8393,7 @@ version = "0.90.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8f6f96e00735f14a781aac8a6870c862b8cc831df6d8e4ad77ab78e11411b9af" dependencies = [ - "bindgen 0.72.1", + "bindgen", "cc", "flate2", "heck 0.5.0", @@ -8243,7 +8401,7 @@ dependencies = [ "regex", "serde_json", "tar", - "toml 0.9.8", + "toml", ] [[package]] @@ -8302,7 +8460,7 @@ dependencies = [ "derive_more", "i-slint-compiler", "spin_on", - "toml_edit 0.23.7", + "toml_edit", ] [[package]] @@ -8538,7 +8696,7 @@ checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" [[package]] name = "storage" version = "0.0.1" -source = "git+https://github.com/servo/servo?rev=158bf97e#158bf97e30779b1068b7b69f05c85a98ac4ab06d" +source = "git+https://github.com/servo/servo?rev=39d3fc6c#39d3fc6c1329b398e8622d5686af47d31b73dada" dependencies = [ "base", "bincode 1.3.3", @@ -8567,7 +8725,7 @@ dependencies = [ [[package]] name = "storage_traits" version = "0.0.1" -source = "git+https://github.com/servo/servo?rev=158bf97e#158bf97e30779b1068b7b69f05c85a98ac4ab06d" +source = "git+https://github.com/servo/servo?rev=39d3fc6c#39d3fc6c1329b398e8622d5686af47d31b73dada" dependencies = [ "base", "ipc-channel", @@ -8605,9 +8763,9 @@ dependencies = [ [[package]] name = "string_cache" -version = "0.8.9" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf776ba3fa74f83bf4b63c3dcbbf82173db2632ed8452cb2d891d33f459de70f" +checksum = "a18596f8c785a729f2819c0f6a7eae6ebeebdfffbfe4214ae6b087f690e31901" dependencies = [ "new_debug_unreachable", "parking_lot", @@ -8618,9 +8776,9 @@ dependencies = [ [[package]] name = "string_cache_codegen" -version = "0.5.4" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c711928715f1fe0fe509c53b43e993a9a557babc2d0a3567d0a3006f1ac931a0" +checksum = "585635e46db231059f76c5849798146164652513eb9e8ab2685939dd90f29b69" dependencies = [ "phf_generator", "phf_shared", @@ -8651,8 +8809,8 @@ dependencies = [ [[package]] name = "stylo" -version = "0.8.0" -source = "git+https://github.com/servo/stylo?branch=2025-10-01#a9f1997d4ff9227c14b4555fd2e812bee48891b8" +version = "0.9.0" +source = "git+https://github.com/servo/stylo?branch=2025-11-01#ae78004b3056c90b66dbba4d92edc0edbc24bc49" dependencies = [ "app_units", "arrayvec", @@ -8663,7 +8821,7 @@ dependencies = [ "derive_more", "encoding_rs", "euclid", - "icu_segmenter", + "icu_segmenter 2.1.1", "indexmap", "itertools 0.14.0", "itoa", @@ -8708,8 +8866,8 @@ dependencies = [ [[package]] name = "stylo_atoms" -version = "0.8.0" -source = "git+https://github.com/servo/stylo?branch=2025-10-01#a9f1997d4ff9227c14b4555fd2e812bee48891b8" +version = "0.9.0" +source = "git+https://github.com/servo/stylo?branch=2025-11-01#ae78004b3056c90b66dbba4d92edc0edbc24bc49" dependencies = [ "string_cache", "string_cache_codegen", @@ -8717,13 +8875,13 @@ dependencies = [ [[package]] name = "stylo_config" -version = "0.8.0" -source = "git+https://github.com/servo/stylo?branch=2025-10-01#a9f1997d4ff9227c14b4555fd2e812bee48891b8" +version = "0.9.0" +source = "git+https://github.com/servo/stylo?branch=2025-11-01#ae78004b3056c90b66dbba4d92edc0edbc24bc49" [[package]] name = "stylo_derive" -version = "0.8.0" -source = "git+https://github.com/servo/stylo?branch=2025-10-01#a9f1997d4ff9227c14b4555fd2e812bee48891b8" +version = "0.9.0" +source = "git+https://github.com/servo/stylo?branch=2025-11-01#ae78004b3056c90b66dbba4d92edc0edbc24bc49" dependencies = [ "darling", "proc-macro2", @@ -8734,8 +8892,8 @@ dependencies = [ [[package]] name = "stylo_dom" -version = "0.8.0" -source = "git+https://github.com/servo/stylo?branch=2025-10-01#a9f1997d4ff9227c14b4555fd2e812bee48891b8" +version = "0.9.0" +source = "git+https://github.com/servo/stylo?branch=2025-11-01#ae78004b3056c90b66dbba4d92edc0edbc24bc49" dependencies = [ "bitflags 2.10.0", "stylo_malloc_size_of", @@ -8743,8 +8901,8 @@ dependencies = [ [[package]] name = "stylo_malloc_size_of" -version = "0.8.0" -source = "git+https://github.com/servo/stylo?branch=2025-10-01#a9f1997d4ff9227c14b4555fd2e812bee48891b8" +version = "0.9.0" +source = "git+https://github.com/servo/stylo?branch=2025-11-01#ae78004b3056c90b66dbba4d92edc0edbc24bc49" dependencies = [ "app_units", "cssparser", @@ -8760,13 +8918,13 @@ dependencies = [ [[package]] name = "stylo_static_prefs" -version = "0.8.0" -source = "git+https://github.com/servo/stylo?branch=2025-10-01#a9f1997d4ff9227c14b4555fd2e812bee48891b8" +version = "0.9.0" +source = "git+https://github.com/servo/stylo?branch=2025-11-01#ae78004b3056c90b66dbba4d92edc0edbc24bc49" [[package]] name = "stylo_traits" -version = "0.8.0" -source = "git+https://github.com/servo/stylo?branch=2025-10-01#a9f1997d4ff9227c14b4555fd2e812bee48891b8" +version = "0.9.0" +source = "git+https://github.com/servo/stylo?branch=2025-11-01#ae78004b3056c90b66dbba4d92edc0edbc24bc49" dependencies = [ "app_units", "bitflags 2.10.0", @@ -8792,9 +8950,9 @@ checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" [[package]] name = "surfman" -version = "0.10.0" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab6d64f9d99bbbab83405a1aa65ac373e4f98440df9912ea8a3640bf164da234" +checksum = "04d3973284ef0dc7362cdaee41c2356c4c39a5a5ebd8490c5163ebf21a7adc02" dependencies = [ "bitflags 2.10.0", "cfg_aliases", @@ -8805,7 +8963,6 @@ dependencies = [ "glow", "libc", "log", - "mach2", "objc2 0.6.3", "objc2-app-kit 0.3.2", "objc2-core-foundation", @@ -8856,9 +9013,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.110" +version = "2.0.111" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a99801b5bd34ede4cf3fc688c5919368fea4e4814a4664359503e6015b280aea" +checksum = "390cc9a294ab71bdb1aa2e99d13be9c753cd2d7bd6560c77118597410c4d2e87" dependencies = [ "proc-macro2", "quote", @@ -8888,24 +9045,11 @@ dependencies = [ "web-sys", ] -[[package]] -name = "system-deps" -version = "6.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3e535eb8dded36d55ec13eddacd30dec501792ff23a0b1682c38601b8cf2349" -dependencies = [ - "cfg-expr", - "heck 0.5.0", - "pkg-config", - "toml 0.8.23", - "version-compare", -] - [[package]] name = "taffy" -version = "0.9.1" +version = "0.9.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b25026fb8cc9ab51ab9fdabe5d11706796966f6d1c78e19871ef63be2b8f0644" +checksum = "41ba83ebaf2954d31d05d67340fd46cebe99da2b7133b0dd68d70c65473a437b" dependencies = [ "arrayvec", "grid", @@ -8924,16 +9068,10 @@ dependencies = [ "xattr", ] -[[package]] -name = "target-lexicon" -version = "0.12.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61c41af27dd6d1e27b1b16b489db798443478cef1f06a660c96db617ba5de3b1" - [[package]] name = "task_info" version = "0.0.1" -source = "git+https://github.com/servo/servo?rev=158bf97e#158bf97e30779b1068b7b69f05c85a98ac4ab06d" +source = "git+https://github.com/servo/servo?rev=39d3fc6c#39d3fc6c1329b398e8622d5686af47d31b73dada" dependencies = [ "cc", ] @@ -8948,7 +9086,7 @@ dependencies = [ "getrandom 0.3.4", "once_cell", "rustix 1.1.2", - "windows-sys 0.59.0", + "windows-sys 0.61.2", ] [[package]] @@ -9035,7 +9173,7 @@ dependencies = [ "half", "quick-error", "weezl", - "zune-jpeg", + "zune-jpeg 0.4.21", ] [[package]] @@ -9100,7 +9238,7 @@ checksum = "6ee8a8f2ac1a27ccb3a3e5cce6bc4244fff349e52929387ea6a1f9dd90e55a0d" [[package]] name = "timers" version = "0.0.1" -source = "git+https://github.com/servo/servo?rev=158bf97e#158bf97e30779b1068b7b69f05c85a98ac4ab06d" +source = "git+https://github.com/servo/servo?rev=39d3fc6c#39d3fc6c1329b398e8622d5686af47d31b73dada" dependencies = [ "crossbeam-channel", "malloc_size_of_derive", @@ -9184,8 +9322,8 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "to_shmem" -version = "0.2.0" -source = "git+https://github.com/servo/stylo?branch=2025-10-01#a9f1997d4ff9227c14b4555fd2e812bee48891b8" +version = "0.3.0" +source = "git+https://github.com/servo/stylo?branch=2025-11-01#ae78004b3056c90b66dbba4d92edc0edbc24bc49" dependencies = [ "cssparser", "servo_arc", @@ -9198,7 +9336,7 @@ dependencies = [ [[package]] name = "to_shmem_derive" version = "0.1.0" -source = "git+https://github.com/servo/stylo?branch=2025-10-01#a9f1997d4ff9227c14b4555fd2e812bee48891b8" +source = "git+https://github.com/servo/stylo?branch=2025-11-01#ae78004b3056c90b66dbba4d92edc0edbc24bc49" dependencies = [ "darling", "proc-macro2", @@ -9267,18 +9405,6 @@ dependencies = [ "tokio", ] -[[package]] -name = "toml" -version = "0.8.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc1beb996b9d83529a9e75c17a1686767d148d70663143c7854d8b4a09ced362" -dependencies = [ - "serde", - "serde_spanned 0.6.9", - "toml_datetime 0.6.11", - "toml_edit 0.22.27", -] - [[package]] name = "toml" version = "0.9.8" @@ -9287,22 +9413,13 @@ checksum = "f0dc8b1fb61449e27716ec0e1bdf0f6b8f3e8f6b05391e8497b8b6d7804ea6d8" dependencies = [ "indexmap", "serde_core", - "serde_spanned 1.0.3", - "toml_datetime 0.7.3", + "serde_spanned", + "toml_datetime", "toml_parser", "toml_writer", "winnow", ] -[[package]] -name = "toml_datetime" -version = "0.6.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22cddaf88f4fbc13c51aebbf5f8eceb5c7c5a9da2ac40a13519eb5b0a0e8f11c" -dependencies = [ - "serde", -] - [[package]] name = "toml_datetime" version = "0.7.3" @@ -9312,19 +9429,6 @@ dependencies = [ "serde_core", ] -[[package]] -name = "toml_edit" -version = "0.22.27" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41fe8c660ae4257887cf66394862d21dbca4a6ddd26f04a3560410406a2f819a" -dependencies = [ - "indexmap", - "serde", - "serde_spanned 0.6.9", - "toml_datetime 0.6.11", - "winnow", -] - [[package]] name = "toml_edit" version = "0.23.7" @@ -9332,7 +9436,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6485ef6d0d9b5d0ec17244ff7eb05310113c3f316f2d14200d4de56b3cb98f8d" dependencies = [ "indexmap", - "toml_datetime 0.7.3", + "toml_datetime", "toml_parser", "toml_writer", "winnow", @@ -9367,9 +9471,9 @@ checksum = "8df9b6e13f2d32c91b9bd719c00d1958837bc7dec474d94952798cc8e69eeec3" [[package]] name = "tracing" -version = "0.1.41" +version = "0.1.43" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "784e0ac535deb450455cbfa28a6f0df145ea1bb7ae51b821cf5e7927fdcfbdd0" +checksum = "2d15d90a0b5c19378952d479dc858407149d7bb45a14de0142f6c534b16fc647" dependencies = [ "log", "pin-project-lite", @@ -9379,9 +9483,9 @@ dependencies = [ [[package]] name = "tracing-attributes" -version = "0.1.30" +version = "0.1.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81383ab64e72a7a8b8e13130c49e3dab29def6d0c7d76a03087b3cf71c5c6903" +checksum = "7490cfa5ec963746568740651ac6781f701c9c5ea257c58e057f3ba8cf69e8da" dependencies = [ "proc-macro2", "quote", @@ -9390,9 +9494,9 @@ dependencies = [ [[package]] name = "tracing-core" -version = "0.1.34" +version = "0.1.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9d12581f227e93f094d3af2ae690a574abb8a2b9b7a96e7cfe9647b2b617678" +checksum = "7a04e24fab5c89c6a36eb8558c9656f30d81de51dfa4d3b45f26b21d61fa0a6c" dependencies = [ "once_cell", ] @@ -9432,10 +9536,10 @@ checksum = "8628dcc84e5a09eb3d8423d6cb682965dea9133204e8fb3efee74c2a0c259442" dependencies = [ "bytes", "data-encoding", - "http 1.3.1", + "http 1.4.0", "httparse", "log", - "rand 0.9.2", + "rand", "rustls", "rustls-pki-types", "sha1", @@ -9757,12 +9861,6 @@ dependencies = [ "vello_common", ] -[[package]] -name = "version-compare" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03c2856837ef78f57382f06b2b8563a2f512f7185d732608fd9176cb3b8edf0e" - [[package]] name = "version_check" version = "0.9.5" @@ -9857,9 +9955,9 @@ dependencies = [ [[package]] name = "wasm-bindgen" -version = "0.2.105" +version = "0.2.106" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da95793dfc411fbbd93f5be7715b0578ec61fe87cb1a42b12eb625caa5c5ea60" +checksum = "0d759f433fa64a2d763d1340820e46e111a7a5ab75f993d1852d70b03dbb80fd" dependencies = [ "cfg-if", "once_cell", @@ -9870,9 +9968,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-futures" -version = "0.4.55" +version = "0.4.56" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "551f88106c6d5e7ccc7cd9a16f312dd3b5d36ea8b4954304657d5dfba115d4a0" +checksum = "836d9622d604feee9e5de25ac10e3ea5f2d65b41eac0d9ce72eb5deae707ce7c" dependencies = [ "cfg-if", "js-sys", @@ -9883,9 +9981,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.105" +version = "0.2.106" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04264334509e04a7bf8690f2384ef5265f05143a4bff3889ab7a3269adab59c2" +checksum = "48cb0d2638f8baedbc542ed444afc0644a29166f1595371af4fecf8ce1e7eeb3" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -9893,9 +9991,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.105" +version = "0.2.106" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "420bc339d9f322e562942d52e115d57e950d12d88983a14c79b86859ee6c7ebc" +checksum = "cefb59d5cd5f92d9dcf80e4683949f15ca4b511f4ac0a6e14d4e1ac60c6ecd40" dependencies = [ "bumpalo", "proc-macro2", @@ -9906,9 +10004,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-shared" -version = "0.2.105" +version = "0.2.106" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76f218a38c84bcb33c25ec7059b07847d465ce0e0a76b995e134a45adcb6af76" +checksum = "cbc538057e648b67f72a982e708d485b2efa771e1ac05fec311f9f63e5800db4" dependencies = [ "unicode-ident", ] @@ -10050,9 +10148,9 @@ dependencies = [ [[package]] name = "web-sys" -version = "0.3.82" +version = "0.3.83" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3a1f95c0d03a47f4ae1f7a64643a6bb97465d9b740f0fa8f90ea33915c99a9a1" +checksum = "9b32828d774c412041098d182a8b38b16ea816958e07cf40eec2bc080ae137ac" dependencies = [ "js-sys", "wasm-bindgen", @@ -10070,9 +10168,9 @@ dependencies = [ [[package]] name = "web_atoms" -version = "0.1.3" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57ffde1dc01240bdf9992e3205668b235e59421fd085e8a317ed98da0178d414" +checksum = "acd0c322f146d0f8aad130ce6c187953889359584497dac6561204c8e17bb43d" dependencies = [ "phf", "phf_codegen", @@ -10106,7 +10204,7 @@ dependencies = [ "bytes", "cookie 0.16.2", "http 0.2.12", - "icu_segmenter", + "icu_segmenter 1.5.0", "log", "serde", "serde_derive", @@ -10122,7 +10220,7 @@ dependencies = [ [[package]] name = "webgl" version = "0.0.1" -source = "git+https://github.com/servo/servo?rev=158bf97e#158bf97e30779b1068b7b69f05c85a98ac4ab06d" +source = "git+https://github.com/servo/servo?rev=39d3fc6c#39d3fc6c1329b398e8622d5686af47d31b73dada" dependencies = [ "base", "bitflags 2.10.0", @@ -10136,6 +10234,7 @@ dependencies = [ "ipc-channel", "itertools 0.14.0", "log", + "parking_lot", "pixels", "rustc-hash 2.1.1", "surfman", @@ -10146,7 +10245,7 @@ dependencies = [ [[package]] name = "webgpu" version = "0.0.1" -source = "git+https://github.com/servo/servo?rev=158bf97e#158bf97e30779b1068b7b69f05c85a98ac4ab06d" +source = "git+https://github.com/servo/servo?rev=39d3fc6c#39d3fc6c1329b398e8622d5686af47d31b73dada" dependencies = [ "arrayvec", "base", @@ -10167,7 +10266,7 @@ dependencies = [ [[package]] name = "webgpu_traits" version = "0.0.1" -source = "git+https://github.com/servo/servo?rev=158bf97e#158bf97e30779b1068b7b69f05c85a98ac4ab06d" +source = "git+https://github.com/servo/servo?rev=39d3fc6c#39d3fc6c1329b398e8622d5686af47d31b73dada" dependencies = [ "arrayvec", "base", @@ -10256,7 +10355,7 @@ dependencies = [ [[package]] name = "webxr" version = "0.0.1" -source = "git+https://github.com/servo/servo?rev=158bf97e#158bf97e30779b1068b7b69f05c85a98ac4ab06d" +source = "git+https://github.com/servo/servo?rev=39d3fc6c#39d3fc6c1329b398e8622d5686af47d31b73dada" dependencies = [ "crossbeam-channel", "euclid", @@ -10274,7 +10373,7 @@ dependencies = [ [[package]] name = "webxr-api" version = "0.0.1" -source = "git+https://github.com/servo/servo?rev=158bf97e#158bf97e30779b1068b7b69f05c85a98ac4ab06d" +source = "git+https://github.com/servo/servo?rev=39d3fc6c#39d3fc6c1329b398e8622d5686af47d31b73dada" dependencies = [ "embedder_traits", "euclid", @@ -10579,7 +10678,7 @@ version = "0.1.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c2a7b1c03c876122aa43f3020e6c3c3ee5c05081c9a00739faf7503aeba10d22" dependencies = [ - "windows-sys 0.48.0", + "windows-sys 0.61.2", ] [[package]] @@ -11202,9 +11301,9 @@ dependencies = [ [[package]] name = "winnow" -version = "0.7.13" +version = "0.7.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21a0236b59786fed61e2a80582dd500fe61f18b5dca67a4a067d0bc9039339cf" +checksum = "5a5364e9d77fcdeeaa6062ced926ee3381faa2ee02d3eb83a5c27a8825540829" dependencies = [ "memchr", ] @@ -11406,9 +11505,9 @@ checksum = "3ae8337f8a065cfc972643663ea4279e04e7256de865aa66fe25cec5fb912d3f" [[package]] name = "xml5ever" -version = "0.35.0" +version = "0.36.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee3f1e41afb31a75aef076563b0ad3ecc24f5bd9d12a72b132222664eb76b494" +checksum = "f57dd51b88a4b9f99f9b55b136abb86210629d61c48117ddb87f567e51e66be7" dependencies = [ "log", "markup5ever", @@ -11423,7 +11522,7 @@ checksum = "ec7a2a501ed189703dba8b08142f057e887dfc4b2cc4db2d343ac6376ba3e0b9" [[package]] name = "xpath" version = "0.0.1" -source = "git+https://github.com/servo/servo?rev=158bf97e#158bf97e30779b1068b7b69f05c85a98ac4ab06d" +source = "git+https://github.com/servo/servo?rev=39d3fc6c#39d3fc6c1329b398e8622d5686af47d31b73dada" dependencies = [ "log", "malloc_size_of_derive", @@ -11431,6 +11530,12 @@ dependencies = [ "servo_malloc_size_of", ] +[[package]] +name = "y4m" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a5a4b21e1a62b67a2970e6831bc091d7b87e119e7f9791aef9702e3bef04448" + [[package]] name = "yazi" version = "0.2.1" @@ -11613,18 +11718,18 @@ checksum = "6df3dc4292935e51816d896edcd52aa30bc297907c26167fec31e2b0c6a32524" [[package]] name = "zerocopy" -version = "0.8.27" +version = "0.8.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0894878a5fa3edfd6da3f88c4805f4c8558e2b996227a3d864f47fe11e38282c" +checksum = "4ea879c944afe8a2b25fef16bb4ba234f47c694565e97383b36f3a878219065c" dependencies = [ "zerocopy-derive", ] [[package]] name = "zerocopy-derive" -version = "0.8.27" +version = "0.8.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88d2b8d9c68ad2b9e4340d7832716a4d21a22a1154777ad56ea55c51a9cf3831" +checksum = "cf955aa904d6040f70dc8e9384444cb1030aed272ba3cb09bbc4ab9e7c1f34f5" dependencies = [ "proc-macro2", "quote", @@ -11773,6 +11878,12 @@ version = "0.4.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f423a2c17029964870cfaabb1f13dfab7d092a62a29a89264f4d36990ca414a" +[[package]] +name = "zune-core" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "111f7d9820f05fd715df3144e254d6fc02ee4088b0644c0ffd0efc9e6d9d2773" + [[package]] name = "zune-inflate" version = "0.2.54" @@ -11788,7 +11899,16 @@ version = "0.4.21" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "29ce2c8a9384ad323cf564b67da86e21d3cfdff87908bc1223ed5c99bc792713" dependencies = [ - "zune-core", + "zune-core 0.4.12", +] + +[[package]] +name = "zune-jpeg" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc6fb7703e32e9a07fb3f757360338b3a567a5054f21b5f52a666752e333d58e" +dependencies = [ + "zune-core 0.5.0", ] [[package]] diff --git a/examples/servo/Cargo.toml b/examples/servo/Cargo.toml index e70d67d4626..9051f8a8c8e 100644 --- a/examples/servo/Cargo.toml +++ b/examples/servo/Cargo.toml @@ -34,24 +34,26 @@ winit = "0.30.12" spin_on = "0.1.1" rustls = "0.23.34" euclid = "0.22.11" -surfman = "0.10.0" +surfman = "0.11.0" time-now = "0.1.2" termcolor = "1.4.1" thiserror = "2.0.17" foreign-types-shared = "0.3.1" -wgpu-hal = "27.0.2" -wgpu-core = "27.0.1" +wgpu-hal = "27.0.4" +wgpu-core = "27.0.3" wgpu = { version = "27.0.1", features = ["metal"] } -libservo = { git = "https://github.com/servo/servo", rev = "158bf97e" } -embedder_traits = { git = "https://github.com/servo/servo", rev = "158bf97e", features = ["baked-default-resources"] } +libservo = { git = "https://github.com/servo/servo", rev = "39d3fc6c" } +embedder_traits = { git = "https://github.com/servo/servo", rev = "39d3fc6c", features = ["baked-default-resources"] } +# not used in code but added for no need to set specific rev whenever run cargo update or freash install and without this its not building +servo-media = { git = "https://github.com/servo/media", rev = "6c1766f5" } -[target.'cfg(target_os = "linux")'.dependencies] +[target.'cfg(any(target_os = "linux", target_os = "android"))'.dependencies] ash = "0.38.0" [target.'cfg(target_os = "android")'.dependencies] -slint = { path = "../../api/rs/slint", features = ["backend-android-activity-06"] } +slint = { path = "../../api/rs/slint", features = ["backend-android-activity-06", "unstable-wgpu-27"] } [target.'cfg(not(target_os = "android"))'.dependencies] slint = { path = "../../api/rs/slint", features = ["unstable-winit-030", "unstable-wgpu-27"] } @@ -64,10 +66,9 @@ objc2-foundation = "0.3.2" objc2-metal = { version = "0.3.2", features = ["MTLDevice", "MTLAllocation", "MTLResource", "MTLTexture", "objc2-io-surface"] } [build-dependencies] -slint-build = { path = "../../api/rs/build" } - -[target.'cfg(target_os = "linux")'.build-dependencies] +# need to add to for all host to generate gl_bindings for android gl_generator = "0.14.0" +slint-build = { path = "../../api/rs/build" } [[package.metadata.android.uses_permission]] name = "android.permission.INTERNET" diff --git a/examples/servo/build.rs b/examples/servo/build.rs index b55fe85cc1f..1c405cf539c 100644 --- a/examples/servo/build.rs +++ b/examples/servo/build.rs @@ -6,10 +6,8 @@ use std::fs::File; use std::io::Write; use std::path::Path; -#[cfg(target_os = "linux")] use gl_generator::{Api, Fallbacks, Profile, Registry, StructGenerator}; -#[cfg(target_os = "linux")] extern crate gl_generator; fn main() { @@ -18,16 +16,21 @@ fn main() { let out = env::var("OUT_DIR").unwrap(); let out = Path::new(&out); - #[cfg(target_os = "linux")] + let target_os = std::env::var("CARGO_CFG_TARGET_OS").unwrap(); + { let mut file = File::create(&out.join("gl_bindings.rs")).unwrap(); // Config copied from https://github.com/YaLTeR/bxt-rs/blob/9f621251b8ce5c2af00b67d2feab731e48d1dae9/build.rs. + let api = if target_os == "android" { Api::Gles2 } else { Api::Gl }; + let version = if target_os == "android" { (3, 0) } else { (4, 6) }; + let profile = if target_os == "android" { Profile::Core } else { Profile::Compatibility }; + Registry::new( - Api::Gl, - (4, 6), - Profile::Compatibility, + api, + version, + profile, Fallbacks::All, [ "GL_EXT_memory_object", @@ -42,10 +45,6 @@ fn main() { .unwrap(); } - // Note: We can't use `#[cfg(windows)]`, since that would check the host platform - // and not the target platform - let target_os = std::env::var("CARGO_CFG_TARGET_OS").unwrap(); - // On MacOS, all dylib dependencies are shipped along with the binary // in the "/lib" directory. Setting the rpath here, allows the dynamic // linker to locate them. See `man dyld` for more info. diff --git a/examples/servo/src/lib.rs b/examples/servo/src/lib.rs index cbdf737ff5a..77b09378207 100644 --- a/examples/servo/src/lib.rs +++ b/examples/servo/src/lib.rs @@ -3,7 +3,7 @@ pub mod webview; -#[cfg(target_os = "linux")] +#[cfg(any(target_os = "linux", target_os = "android"))] mod gl_bindings { #![allow(unsafe_op_in_unsafe_fn)] @@ -12,26 +12,16 @@ mod gl_bindings { use slint::ComponentHandle; -#[cfg(not(target_os = "android"))] use crate::webview::WebView; slint::include_modules!(); pub fn main() { - #[cfg(not(target_os = "android"))] let (device, queue) = setup_wgpu(); let app = MyApp::new().expect("Failed to create Slint application - check UI resources"); - #[cfg(not(target_os = "android"))] - WebView::new( - app.clone_strong(), - "https://slint.dev".into(), - #[cfg(not(target_os = "android"))] - device, - #[cfg(not(target_os = "android"))] - queue, - ); + WebView::new(app.clone_strong(), "https://slint.dev".into(), device, queue); app.run().expect("Application failed to run - check for runtime errors"); } @@ -43,16 +33,11 @@ pub fn android_main(android_app: slint::android::AndroidApp) { main(); } -#[cfg(not(target_os = "android"))] fn setup_wgpu() -> (wgpu::Device, wgpu::Queue) { let backends = wgpu::Backends::from_env().unwrap_or_default(); - let instance = wgpu::Instance::new(&wgpu::InstanceDescriptor { - backends, - flags: Default::default(), - backend_options: Default::default(), - memory_budget_thresholds: Default::default(), - }); + let instance = + wgpu::Instance::new(&wgpu::InstanceDescriptor { backends, ..Default::default() }); let adapter = spin_on::spin_on(async { instance diff --git a/examples/servo/src/webview/adapter.rs b/examples/servo/src/webview/adapter.rs index f7a84f5d900..93d4dbe0f42 100644 --- a/examples/servo/src/webview/adapter.rs +++ b/examples/servo/src/webview/adapter.rs @@ -9,10 +9,9 @@ use smol::channel::{Receiver, Sender}; use slint::ComponentHandle; -#[cfg(not(target_os = "android"))] use slint::wgpu_27::wgpu; -use crate::{MyApp, WebviewLogic, webview::rendering_context::ServoRenderingAdapter}; +use crate::{MyApp, WebviewLogic, webview::ServoRenderingAdapter}; /// Upgrades a weak reference to `SlintServoAdapter` to a strong reference. /// @@ -61,9 +60,7 @@ pub struct SlintServoAdapterInner { servo: Option, webview: Option, rendering_adapter: Option>>, - #[cfg(not(target_os = "android"))] device: wgpu::Device, - #[cfg(not(target_os = "android"))] queue: wgpu::Queue, } @@ -71,8 +68,8 @@ impl SlintServoAdapter { pub fn new( waker_sender: Sender<()>, waker_receiver: Receiver<()>, - #[cfg(not(target_os = "android"))] device: wgpu::Device, - #[cfg(not(target_os = "android"))] queue: wgpu::Queue, + device: wgpu::Device, + queue: wgpu::Queue, ) -> Self { Self { waker_sender, @@ -81,9 +78,7 @@ impl SlintServoAdapter { servo: None, webview: None, rendering_adapter: None, - #[cfg(not(target_os = "android"))] device: device, - #[cfg(not(target_os = "android"))] queue: queue, }), } @@ -105,12 +100,10 @@ impl SlintServoAdapter { self.waker_receiver.clone() } - #[cfg(not(target_os = "android"))] pub fn wgpu_device(&self) -> wgpu::Device { self.inner().device.clone() } - #[cfg(not(target_os = "android"))] pub fn wgpu_queue(&self) -> wgpu::Queue { self.inner().queue.clone() } diff --git a/examples/servo/src/webview/rendering_context/gpu_rendering_context.rs b/examples/servo/src/webview/rendering_context/gpu_rendering_context.rs index 0fadefca2b1..cbb977f939a 100644 --- a/examples/servo/src/webview/rendering_context/gpu_rendering_context.rs +++ b/examples/servo/src/webview/rendering_context/gpu_rendering_context.rs @@ -14,29 +14,18 @@ use surfman::{ chains::{PreserveBuffer, SwapChain}, }; -#[cfg(not(target_os = "android"))] -use slint::wgpu_27::wgpu; - -#[cfg(target_os = "linux")] -#[derive(thiserror::Error, Debug)] -pub enum VulkanTextureError { - #[error("{0:?}")] - Surfman(surfman::Error), - #[error("{0}")] - Vulkan(#[from] ash::vk::Result), - #[error("No surface returned when the surface was unbound from the context")] - NoSurface, - #[error("The surface didn't have a framebuffer object")] - NoFramebuffer, - #[error("Wgpu is not using the vulkan backend")] - WgpuNotVulkan, - #[error("{0}")] - OpenGL(String), -} +use wgpu; use super::surfman_context::SurfmanRenderingContext; +/// A rendering context that uses GPU acceleration via `wgpu` and `surfman`. +/// +/// This struct manages the `wgpu` device and queue, the `surfman` swap chain, and the underlying +/// `SurfmanRenderingContext`. It handles the interoperability between Servo's OpenGL rendering +/// and `wgpu`'s texture management. pub struct GPURenderingContext { + pub wgpu_device: wgpu::Device, + pub wgpu_queue: wgpu::Queue, pub size: Cell>, pub swap_chain: SwapChain, pub surfman_rendering_info: SurfmanRenderingContext, @@ -51,7 +40,21 @@ impl Drop for GPURenderingContext { } impl GPURenderingContext { - pub fn new(size: PhysicalSize) -> Result { + /// Creates a new `GPURenderingContext`. + /// + /// This initializes the `surfman` connection, adapter, and device, creates a surface, + /// and sets up the swap chain. + /// + /// # Arguments + /// + /// * `size` - The initial size of the rendering context. + /// * `wgpu_device` - The `wgpu` device to use for texture creation. + /// * `wgpu_queue` - The `wgpu` queue for command submission. + pub fn new( + size: PhysicalSize, + wgpu_device: wgpu::Device, + wgpu_queue: wgpu::Queue, + ) -> Result { let connection = Connection::new()?; let adapter = connection.create_adapter()?; @@ -60,8 +63,9 @@ impl GPURenderingContext { let surfman_size = Size2D::new(size.width as i32, size.height as i32); - let surface = - surfman_rendering_info.create_surface(SurfaceType::Generic { size: surfman_size })?; + let surface_type = SurfaceType::Generic { size: surfman_size }; + + let surface = surfman_rendering_info.create_surface(surface_type)?; surfman_rendering_info.bind_surface(surface)?; @@ -69,7 +73,13 @@ impl GPURenderingContext { let swap_chain = surfman_rendering_info.create_attached_swap_chain()?; - Ok(Self { swap_chain, size: Cell::new(size), surfman_rendering_info }) + Ok(Self { + wgpu_device, + wgpu_queue, + swap_chain, + size: Cell::new(size), + surfman_rendering_info, + }) } /// Imports Metal surface as a WGPU texture for rendering on macOS/iOS. @@ -77,243 +87,22 @@ impl GPURenderingContext { #[cfg(target_vendor = "apple")] pub fn get_wgpu_texture_from_metal( &self, - wgpu_device: &wgpu::Device, - wgpu_queue: &wgpu::Queue, - ) -> Result { + ) -> Result { use super::metal::WPGPUTextureFromMetal; - let device = &self.surfman_rendering_info.device.borrow(); - let mut context = self.surfman_rendering_info.context.borrow_mut(); - - let surface = device.unbind_surface_from_context(&mut context)?.unwrap(); - - let size = self.size.get(); - - let wgpu_texture = WPGPUTextureFromMetal::new(size, wgpu_device).get( - wgpu_device, - wgpu_queue, - device, - &surface, - ); - - let _ = - device.bind_surface_to_context(&mut context, surface).map_err(|(err, mut surface)| { - let _ = device.destroy_surface(&mut context, &mut surface); - err - }); - - Ok(wgpu_texture) + WPGPUTextureFromMetal::new(self).get() } - /// Imports Vulkan surface as a WGPU texture for rendering on Linux. - /// Creates a Vulkan image with external memory, imports to OpenGL, blits content, then wraps as WGPU texture. - #[cfg(target_os = "linux")] + /// Imports a Vulkan surface as a WGPU texture for rendering on Linux and Android. + /// This method handles the import of the underlying Vulkan image into WGPU, potentially + /// performing necessary layout transitions or memory barriers. + #[cfg(any(target_os = "linux", target_os = "android"))] pub fn get_wgpu_texture_from_vulkan( &self, - wgpu_device: &wgpu::Device, - _wgpu_queue: &wgpu::Queue, - ) -> Result { - use crate::gl_bindings as gl; - use ash::vk; - use glow::HasContext; - - let device = &self.surfman_rendering_info.device.borrow(); - let mut context = self.surfman_rendering_info.context.borrow_mut(); + ) -> Result { + use super::vulkan::WPGPUTextureFromVulkan; - let surface = device - .unbind_surface_from_context(&mut context) - .map_err(VulkanTextureError::Surfman)? - .ok_or(VulkanTextureError::NoSurface)?; - - device.make_context_current(&mut context).map_err(VulkanTextureError::Surfman)?; - - let surface_info = device.surface_info(&surface); - - let size = self.size.get(); - - let texture = unsafe { - let hal_device = wgpu_device - .as_hal::() - .ok_or(VulkanTextureError::WgpuNotVulkan)?; - let vulkan_device = hal_device.raw_device().clone(); - let vulkan_instance = hal_device.shared_instance().raw_instance(); - - // Create Vulkan image with external memory for sharing with OpenGL - - let mut external_memory_image_info = vk::ExternalMemoryImageCreateInfo::default() - .handle_types(vk::ExternalMemoryHandleTypeFlags::OPAQUE_FD); - - let vulkan_image = vulkan_device.create_image( - &vk::ImageCreateInfo::default() - .image_type(vk::ImageType::TYPE_2D) - .format(vk::Format::R8G8B8A8_UNORM) - .extent(vk::Extent3D { width: size.width, height: size.height, depth: 1 }) - .mip_levels(1) - .array_layers(1) - .samples(vk::SampleCountFlags::TYPE_1) - .tiling(vk::ImageTiling::OPTIMAL) - .usage(vk::ImageUsageFlags::SAMPLED | vk::ImageUsageFlags::COLOR_ATTACHMENT) - .sharing_mode(vk::SharingMode::EXCLUSIVE) - .initial_layout(vk::ImageLayout::UNDEFINED) - .push_next(&mut external_memory_image_info), - None, - )?; - - // Allocate dedicated Vulkan memory and bind to the created image - - let memory_requirements = vulkan_device.get_image_memory_requirements(vulkan_image); - - let mut dedicated_allocate_info = - vk::MemoryDedicatedAllocateInfo::default().image(vulkan_image); - - let mut export_info = vk::ExportMemoryAllocateInfo::default() - .handle_types(vk::ExternalMemoryHandleTypeFlags::OPAQUE_FD); - - let memory = vulkan_device.allocate_memory( - &vk::MemoryAllocateInfo::default() - .allocation_size(memory_requirements.size) - // todo: required? - //.memory_type_index(mem_type_index as _) - .push_next(&mut dedicated_allocate_info) - .push_next(&mut export_info), - None, - )?; - - vulkan_device.bind_image_memory(vulkan_image, memory, 0)?; - - // Export Vulkan memory as a file descriptor for OpenGL import - - let external_memory_fd_api = - ash::khr::external_memory_fd::Device::new(&vulkan_instance, &vulkan_device); - - let memory_handle = external_memory_fd_api.get_memory_fd( - &vk::MemoryGetFdInfoKHR::default() - .memory(memory) - .handle_type(vk::ExternalMemoryHandleTypeFlags::OPAQUE_FD), - )?; - - // Import Vulkan memory into OpenGL using EXT_external_objects - - let gl = &self.surfman_rendering_info.glow_gl; - - let gl_with_extensions = - gl::Gl::load_with(|function_name| device.get_proc_address(&context, function_name)); - - let mut memory_object = 0; - gl_with_extensions.CreateMemoryObjectsEXT(1, &mut memory_object); - // We're using a dedicated allocation. - // todo: taken from https://bxt.rs/blog/fast-half-life-video-recording-with-vulkan/, not sure if required. - gl_with_extensions.MemoryObjectParameterivEXT( - memory_object, - gl::DEDICATED_MEMORY_OBJECT_EXT, - &1, - ); - gl_with_extensions.ImportMemoryFdEXT( - memory_object, - memory_requirements.size, - gl::HANDLE_TYPE_OPAQUE_FD_EXT, - memory_handle, - ); - // Create a texture and bind it to the imported memory. - let texture = gl.create_texture().map_err(VulkanTextureError::OpenGL)?; - gl.bind_texture(gl::TEXTURE_2D, Some(texture)); - gl_with_extensions.TexStorageMem2DEXT( - gl::TEXTURE_2D, - 1, - gl::RGBA8, - size.width as i32, - size.height as i32, - memory_object, - 0, - ); - - // Blit Servo's framebuffer to the imported texture - - let draw_framebuffer = gl.create_framebuffer().map_err(VulkanTextureError::OpenGL)?; - let read_framebuffer = - surface_info.framebuffer_object.ok_or(VulkanTextureError::NoFramebuffer)?; - // todo: tried using gl.named_framebuffer_texture instead but it errored. - gl.bind_framebuffer(gl::DRAW_FRAMEBUFFER, Some(draw_framebuffer)); - gl.framebuffer_texture_2d( - gl::DRAW_FRAMEBUFFER, - gl::COLOR_ATTACHMENT0, - gl::TEXTURE_2D, - Some(texture), - 0, - ); - - gl.blit_named_framebuffer( - Some(read_framebuffer), - Some(draw_framebuffer), - 0, - 0, - size.width as i32, - size.height as i32, - // Flip vertically - OpenGL origin is bottom-left, texture origin is top-left - 0, - size.height as i32, - size.width as i32, - 0, - gl::COLOR_BUFFER_BIT, - gl::NEAREST, - ); - gl.flush(); - // Delete all the opengl objects. Seems to be required to prevent memory leaks - // according to `amdgpu_top`. - gl.delete_framebuffer(draw_framebuffer); - gl.delete_texture(texture); - gl_with_extensions.DeleteMemoryObjectsEXT(1, &memory_object); - - wgpu_device.create_texture_from_hal::( - hal_device.texture_from_raw( - vulkan_image, - &wgpu_hal::TextureDescriptor { - label: None, - size: wgpu::Extent3d { - width: size.width, - height: size.height, - depth_or_array_layers: 1, - }, - format: wgpu::TextureFormat::Rgba8Unorm, - dimension: wgpu::TextureDimension::D2, - mip_level_count: 1, - sample_count: 1, - usage: wgpu::TextureUses::RESOURCE | wgpu::TextureUses::COLOR_TARGET, - view_formats: vec![], - memory_flags: wgpu_hal::MemoryFlags::empty(), - }, - Some(Box::new(move || { - // Images aren't cleaned up by wgpu-hal if theres a drop callback set so do it manually - vulkan_device.destroy_image(vulkan_image, None); - // Free the memory - vulkan_device.free_memory(memory, None); - })), - ), - &wgpu::TextureDescriptor { - label: None, - size: wgpu::Extent3d { - width: size.width, - height: size.height, - depth_or_array_layers: 1, - }, - format: wgpu::TextureFormat::Rgba8Unorm, - dimension: wgpu::TextureDimension::D2, - mip_level_count: 1, - sample_count: 1, - usage: wgpu::TextureUsages::TEXTURE_BINDING - | wgpu::TextureUsages::RENDER_ATTACHMENT, - view_formats: &[], - }, - ) - }; - - let _ = - device.bind_surface_to_context(&mut context, surface).map_err(|(err, mut surface)| { - let _ = device.destroy_surface(&mut context, &mut surface); - err - }); - - Ok(texture) + WPGPUTextureFromVulkan::new(self).get() } } diff --git a/examples/servo/src/webview/rendering_context/metal/metal.rs b/examples/servo/src/webview/rendering_context/metal/metal.rs index 176dec9648d..e5be6472172 100644 --- a/examples/servo/src/webview/rendering_context/metal/metal.rs +++ b/examples/servo/src/webview/rendering_context/metal/metal.rs @@ -13,37 +13,42 @@ use objc2_io_surface::IOSurfaceRef; use objc2_metal::{MTLPixelFormat, MTLTextureDescriptor, MTLTextureType, MTLTextureUsage}; use foreign_types_shared::ForeignType; -use winit::dpi::PhysicalSize; +use super::super::gpu_rendering_context::GPURenderingContext; +use super::super::utils::{SurfaceGuard, TextureError, create_wgpu_texture_descriptor}; use super::ServoTextureImporter; +#[derive(thiserror::Error, Debug)] +pub enum MetalTextureError { + #[error(transparent)] + Utils(#[from] TextureError), + + #[error("Wgpu is not using the metal backend")] + WgpuNotMetal, + #[error("Failed to create Metal texture from IOSurface")] + TextureCreation, +} + /// WGPU texture wrapper for Metal IOSurface textures. /// /// This struct provides functionality to create WGPU textures from Metal IOSurfaces /// and perform coordinate system transformations. -pub struct WPGPUTextureFromMetal { - pub size: PhysicalSize, - pub texture_importer: ServoTextureImporter, +pub struct WPGPUTextureFromMetal<'a> { + context: &'a GPURenderingContext, + texture_importer: ServoTextureImporter, } -impl WPGPUTextureFromMetal { - pub fn new(size: PhysicalSize, wgpu_device: &wgpu::Device) -> Self { - Self { size, texture_importer: ServoTextureImporter::new(wgpu_device) } +impl<'a> WPGPUTextureFromMetal<'a> { + pub fn new(context: &'a GPURenderingContext) -> Self { + Self { context, texture_importer: ServoTextureImporter::new(&context.wgpu_device) } } - pub fn get( - &self, - wgpu_device: &wgpu::Device, - wgpu_queue: &wgpu::Queue, - surfman_device: &surfman::Device, - surfman_surface: &surfman::Surface, - ) -> wgpu::Texture { - let objc2_metal_texture = - self.objc2_metal_texture(wgpu_device, surfman_device, surfman_surface); + pub fn get(&self) -> Result { + let objc2_metal_texture = self.objc2_metal_texture()?; - let hal_texture = self.wgpu_hal_texture(wgpu_device, objc2_metal_texture); + let hal_texture = self.wgpu_hal_texture(objc2_metal_texture); - self.create_flipped_texture_render(wgpu_device, wgpu_queue, &hal_texture) + Ok(self.create_flipped_texture_render(&hal_texture)) } /// Creates a Metal texture from an IOSurface using Objective-C messaging. @@ -72,35 +77,35 @@ impl WPGPUTextureFromMetal { /// This function contains unsafe code for: /// - Extracting the raw Metal device from WGPU /// - Converting device pointers for Objective-C messaging - fn objc2_metal_texture( - &self, - wgpu_device: &wgpu::Device, - - surfman_device: &surfman::Device, - surfman_surface: &surfman::Surface, - ) -> Retained { + fn objc2_metal_texture(&self) -> Result, MetalTextureError> { // SAFETY: We're working with WGPU Metal backend, so the device extraction // and pointer manipulations are safe within this controlled context. unsafe { - let metal_device = wgpu_device + let metal_device = self + .context + .wgpu_device .as_hal::() - .expect("WGPU device is not using Metal backend"); + .ok_or(MetalTextureError::WgpuNotMetal)?; let device_raw = metal_device.raw_device().lock().clone(); + let size = self.context.size.get(); let descriptor = MTLTextureDescriptor::new(); descriptor.setDepth(1); descriptor.setSampleCount(1); - descriptor.setWidth(self.size.width as usize); - descriptor.setHeight(self.size.height as usize); + descriptor.setWidth(size.width as usize); + descriptor.setHeight(size.height as usize); descriptor.setMipmapLevelCount(1); descriptor.setUsage(MTLTextureUsage::ShaderRead); descriptor.setPixelFormat(MTLPixelFormat::BGRA8Unorm); descriptor.setTextureType(MTLTextureType::Type2D); - // let texture_descriptor = Self::create_metal_texture_descriptor(self.size); + let surfman_device = &self.context.surfman_rendering_info.device.borrow(); - let native_surface = surfman_device.native_surface(surfman_surface); + let surface_guard = SurfaceGuard::new(&self.context.surfman_rendering_info) + .map_err(MetalTextureError::Utils)?; + + let native_surface = surfman_device.native_surface(surface_guard.surface()); let io_surface = native_surface.0; // SAFETY: The device_raw pointer is valid (obtained from WGPU Metal backend) @@ -112,32 +117,9 @@ impl WPGPUTextureFromMetal { &io_surface, 0, ) - .expect("Failed to create Metal texture from IOSurface"); + .ok_or(MetalTextureError::TextureCreation)?; - texture - } - } - - /// Creates a WGPU texture descriptor with standard settings for this use case. - fn create_wgpu_texture_descriptor( - size: PhysicalSize, - label: &str, - usage: wgpu::TextureUsages, - format: wgpu::TextureFormat, - ) -> wgpu::TextureDescriptor<'_> { - wgpu::TextureDescriptor { - label: Some(label), - size: wgpu::Extent3d { - width: size.width, - height: size.height, - depth_or_array_layers: 1, - }, - mip_level_count: 1, - sample_count: 1, - dimension: wgpu::TextureDimension::D2, - format, - usage, - view_formats: &[], + Ok(texture) } } @@ -150,11 +132,7 @@ impl WPGPUTextureFromMetal { /// - Converting Objective-C objects to Metal API objects /// - Creating HAL textures from raw Metal textures /// - Managing memory ownership transfer between different APIs - fn wgpu_hal_texture( - &self, - wgpu_device: &wgpu::Device, - metal_texture: Retained, - ) -> wgpu::Texture { + fn wgpu_hal_texture(&self, metal_texture: Retained) -> wgpu::Texture { // SAFETY: We're converting between compatible object types within the same // Metal/WGPU ecosystem. The ownership transfer is handled correctly. unsafe { @@ -163,51 +141,45 @@ impl WPGPUTextureFromMetal { // SAFETY: The ptr comes from a valid Metal texture object let metal_texture = metal::Texture::from_ptr(ptr as *mut _); + let size = self.context.size.get(); let hal_texture = wgpu::hal::metal::Device::texture_from_raw( metal_texture, wgpu::TextureFormat::Bgra8Unorm, metal::MTLTextureType::D2, 0, 0, - wgpu::hal::CopyExtent { - width: self.size.width, - height: self.size.height, - depth: 0, - }, + wgpu::hal::CopyExtent { width: size.width, height: size.height, depth: 0 }, ); - let wgpu_descriptor = Self::create_wgpu_texture_descriptor( - self.size, - "Metal IOSurface Texture", + let wgpu_descriptor = create_wgpu_texture_descriptor( + size, + "Metal WGPU IOSurface Texture", wgpu::TextureUsages::TEXTURE_BINDING | wgpu::TextureUsages::RENDER_ATTACHMENT, wgpu::TextureFormat::Bgra8Unorm, ); - wgpu_device + self.context + .wgpu_device .create_texture_from_hal::(hal_texture, &wgpu_descriptor) } } /// Creates and applies a texture flipping render operation using pre-initialized resources. - fn create_flipped_texture_render( - &self, - wgpu_device: &wgpu::Device, - wgpu_queue: &wgpu::Queue, - source_texture: &wgpu::Texture, - ) -> wgpu::Texture { + fn create_flipped_texture_render(&self, source_texture: &wgpu::Texture) -> wgpu::Texture { + let size = self.context.size.get(); // Create the output texture - let descriptor = WPGPUTextureFromMetal::create_wgpu_texture_descriptor( - self.size, + let descriptor = create_wgpu_texture_descriptor( + size, "Flipped Metal IOSurface Texture", wgpu::TextureUsages::TEXTURE_BINDING | wgpu::TextureUsages::RENDER_ATTACHMENT, wgpu::TextureFormat::Rgba8Unorm, ); - let flipped_texture = wgpu_device.create_texture(&descriptor); + let flipped_texture = self.context.wgpu_device.create_texture(&descriptor); let source_view = source_texture.create_view(&wgpu::TextureViewDescriptor::default()); - let bind_group = wgpu_device.create_bind_group(&wgpu::BindGroupDescriptor { + let bind_group = self.context.wgpu_device.create_bind_group(&wgpu::BindGroupDescriptor { label: Some("Metal Texture Flip Bind Group"), layout: &self.texture_importer.bind_group_layout, entries: &[ @@ -225,9 +197,10 @@ impl WPGPUTextureFromMetal { // Execute the render pass let target_view = &flipped_texture.create_view(&wgpu::TextureViewDescriptor::default()); - let mut encoder = wgpu_device.create_command_encoder(&wgpu::CommandEncoderDescriptor { - label: Some("Metal Texture Flip Command Encoder"), - }); + let mut encoder = + self.context.wgpu_device.create_command_encoder(&wgpu::CommandEncoderDescriptor { + label: Some("Metal Texture Flip Command Encoder"), + }); { let mut render_pass = encoder.begin_render_pass(&wgpu::RenderPassDescriptor { @@ -251,7 +224,7 @@ impl WPGPUTextureFromMetal { render_pass.draw(0..3, 0..1); // Draw a fullscreen triangle } - wgpu_queue.submit(std::iter::once(encoder.finish())); + self.context.wgpu_queue.submit(std::iter::once(encoder.finish())); flipped_texture } diff --git a/examples/servo/src/webview/rendering_context/metal/mod.rs b/examples/servo/src/webview/rendering_context/metal/mod.rs index 1e148124ac5..498ebe0ca39 100644 --- a/examples/servo/src/webview/rendering_context/metal/mod.rs +++ b/examples/servo/src/webview/rendering_context/metal/mod.rs @@ -4,5 +4,6 @@ mod metal; mod texture_importer; -pub use texture_importer::ServoTextureImporter; +pub use metal::MetalTextureError; pub use metal::WPGPUTextureFromMetal; +pub use texture_importer::ServoTextureImporter; diff --git a/examples/servo/src/webview/rendering_context/mod.rs b/examples/servo/src/webview/rendering_context/mod.rs index 107cf5df45f..f7c0c97c35e 100644 --- a/examples/servo/src/webview/rendering_context/mod.rs +++ b/examples/servo/src/webview/rendering_context/mod.rs @@ -1,21 +1,27 @@ // Copyright © SixtyFPS GmbH // SPDX-License-Identifier: MIT +//! This module handles the rendering context for the Servo WebView. +//! +//! It provides abstractions for GPU and software rendering, integrating with +//! `surfman` for cross-platform surface management and `wgpu` for modern graphics API support. +//! +//! Key components: +//! - `GPURenderingContext`: Manages GPU resources and swap chains. +//! - `SurfmanRenderingContext`: Low-level integration with `surfman` and OpenGL. +//! - `ServoRenderingAdapter`: Adapter trait for integrating Servo's rendering with Slint. mod gpu_rendering_context; mod servo_rendering_adapter; mod surfman_context; +mod utils; -pub use servo_rendering_adapter::ServoRenderingAdapter; - -#[cfg(not(target_os = "android"))] pub use gpu_rendering_context::GPURenderingContext; - -#[cfg(not(target_os = "android"))] +pub use servo_rendering_adapter::ServoRenderingAdapter; pub use servo_rendering_adapter::try_create_gpu_context; -#[cfg(target_os = "android")] -pub use servo_rendering_adapter::create_software_context; - #[cfg(target_vendor = "apple")] mod metal; + +#[cfg(any(target_os = "linux", target_os = "android"))] +mod vulkan; diff --git a/examples/servo/src/webview/rendering_context/servo_rendering_adapter.rs b/examples/servo/src/webview/rendering_context/servo_rendering_adapter.rs index 85ea60dcd29..7e29a6617f3 100644 --- a/examples/servo/src/webview/rendering_context/servo_rendering_adapter.rs +++ b/examples/servo/src/webview/rendering_context/servo_rendering_adapter.rs @@ -4,14 +4,17 @@ use std::rc::Rc; use euclid::Point2D; -use slint::{Image, SharedPixelBuffer}; use winit::dpi::PhysicalSize; +use slint::{Image, SharedPixelBuffer, wgpu_27::wgpu}; + use servo::{RenderingContext, SoftwareRenderingContext, webrender_api::units::DeviceIntRect}; -#[cfg(not(target_os = "android"))] -use {super::GPURenderingContext, slint::wgpu_27::wgpu}; +use super::GPURenderingContext; +/// Creates a software rendering context adapter. +/// +/// This adapter uses Servo's software rendering path and copies the pixel buffer to a Slint image. pub fn create_software_context(size: PhysicalSize) -> Box { let rendering_context = Rc::new( SoftwareRenderingContext::new(size).expect("Failed to create software rendering context"), @@ -22,11 +25,10 @@ pub fn create_software_context(size: PhysicalSize) -> Box, device: wgpu::Device, queue: wgpu::Queue, - size: PhysicalSize, ) -> Option> { // Allow forcing software rendering for testing/debugging if std::env::var_os("SLINT_SERVO_FORCE_SOFTWARE").is_some() { @@ -34,14 +36,10 @@ pub fn try_create_gpu_context( } // Try to create GPU rendering context, fall back to software if it fails - match GPURenderingContext::new(size) { + match GPURenderingContext::new(size, device, queue) { Ok(gpu_context) => { let rendering_context = Rc::new(gpu_context); - Some(Box::new(ServoGPURenderingContext { - device: device.clone(), - queue: queue.clone(), - rendering_context, - })) + Some(Box::new(ServoGPURenderingContext { rendering_context })) } Err(_) => { // GPU rendering context creation failed, fall back to software rendering @@ -50,33 +48,29 @@ pub fn try_create_gpu_context( } } +/// A trait for adapting Servo's rendering context to Slint's image format. pub trait ServoRenderingAdapter { + /// Returns the current framebuffer content as a Slint `Image`. fn current_framebuffer_as_image(&self) -> Image; + /// Returns the underlying Servo `RenderingContext`. fn get_rendering_context(&self) -> Rc; } -#[cfg(not(target_os = "android"))] struct ServoGPURenderingContext { - device: wgpu::Device, - queue: wgpu::Queue, rendering_context: Rc, } -#[cfg(not(target_os = "android"))] impl ServoRenderingAdapter for ServoGPURenderingContext { fn current_framebuffer_as_image(&self) -> Image { - #[cfg(target_os = "linux")] - let texture = self.rendering_context - .get_wgpu_texture_from_vulkan(&self.device, &self.queue) - .expect( - "Failed to get WGPU texture from Vulkan texture - ensure rendering context is valid", - ); + #[cfg(any(target_os = "linux", target_os = "android"))] + let texture = self.rendering_context.get_wgpu_texture_from_vulkan().expect( + "Failed to get WGPU texture from Vulkan texture - ensure rendering context is valid", + ); #[cfg(target_vendor = "apple")] - let texture = - self.rendering_context.get_wgpu_texture_from_metal(&self.device, &self.queue).expect( - "Failed to get WGPU texture from Metal texture - ensure rendering context is valid", - ); + let texture = self.rendering_context.get_wgpu_texture_from_metal().expect( + "Failed to get WGPU texture from Metal texture - ensure rendering context is valid", + ); Image::try_from(texture).expect( "Failed to create Slint image from WGPU texture - check texture format compatibility", diff --git a/examples/servo/src/webview/rendering_context/surfman_context.rs b/examples/servo/src/webview/rendering_context/surfman_context.rs index e902c643342..2a7cff75d86 100644 --- a/examples/servo/src/webview/rendering_context/surfman_context.rs +++ b/examples/servo/src/webview/rendering_context/surfman_context.rs @@ -5,18 +5,23 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ -use std::{cell::RefCell, rc::Rc, sync::Arc}; +#![deny(unsafe_code)] -use euclid::default::Size2D; +use std::cell::RefCell; +use std::rc::Rc; +use std::sync::Arc; + +use euclid::default::Size2D as UntypedSize2D; use gleam::gl::{self, Gl}; use glow::NativeFramebuffer; use image::RgbaImage; +use log::{debug, warn}; use servo::webrender_api::units::DeviceIntRect; - +pub use surfman::Error; +use surfman::chains::SwapChain; use surfman::{ - Adapter, Connection, Context, ContextAttributeFlags, ContextAttributes, Device, Error, GLApi, - NativeWidget, Surface, SurfaceAccess, SurfaceInfo, SurfaceTexture, SurfaceType, - chains::SwapChain, + Adapter, Connection, Context, ContextAttributeFlags, ContextAttributes, Device, GLApi, + NativeContext, NativeWidget, Surface, SurfaceAccess, SurfaceInfo, SurfaceTexture, SurfaceType, }; /// A rendering context that uses the Surfman library to create and manage @@ -43,8 +48,11 @@ impl Drop for SurfmanRenderingContext { } impl SurfmanRenderingContext { + /// Creates a new `SurfmanRenderingContext`. + /// + /// Initializes the device, context, and OpenGL function pointers (both `gleam` and `glow`). pub fn new(connection: &Connection, adapter: &Adapter) -> Result { - let mut device = connection.create_device(adapter)?; + let device = connection.create_device(adapter)?; let flags = ContextAttributeFlags::ALPHA | ContextAttributeFlags::DEPTH @@ -58,7 +66,7 @@ impl SurfmanRenderingContext { device.create_context_descriptor(&ContextAttributes { flags, version })?; let context = device.create_context(&context_descriptor, None)?; - #[allow(unsafe_code)] + #[expect(unsafe_code)] let gleam_gl = { match gl_api { GLApi::GL => unsafe { @@ -70,7 +78,7 @@ impl SurfmanRenderingContext { } }; - #[allow(unsafe_code)] + #[expect(unsafe_code)] let glow_gl = unsafe { glow::Context::from_loader_function(|function_name| { device.get_proc_address(&context, function_name) @@ -85,6 +93,7 @@ impl SurfmanRenderingContext { }) } + /// Creates a new surface for the given widget. pub fn create_surface( &self, surface_type: SurfaceType, @@ -94,24 +103,33 @@ impl SurfmanRenderingContext { device.create_surface(context, SurfaceAccess::GPUOnly, surface_type) } + /// Binds a surface to the current context. + /// + /// If binding fails, the surface is destroyed to prevent leaks. pub fn bind_surface(&self, surface: Surface) -> Result<(), Error> { let device = &self.device.borrow(); let context = &mut self.context.borrow_mut(); - device - .bind_surface_to_context(context, surface) - .map_err(|(err, mut surface)| { - let _ = device.destroy_surface(context, &mut surface); - err - })?; + device.bind_surface_to_context(context, surface).map_err(|(err, mut surface)| { + let _ = device.destroy_surface(context, &mut surface); + err + })?; Ok(()) } + /// Creates a swap chain attached to the current context. pub fn create_attached_swap_chain(&self) -> Result, Error> { let device = &mut self.device.borrow_mut(); let context = &mut self.context.borrow_mut(); SwapChain::create_attached(device, context, SurfaceAccess::GPUOnly) } + #[expect(dead_code)] + fn native_context(&self) -> NativeContext { + let device = &self.device.borrow(); + let context = &self.context.borrow(); + device.native_context(context) + } + fn framebuffer(&self) -> Option { let device = &self.device.borrow(); let context = &self.context.borrow(); @@ -121,63 +139,74 @@ impl SurfmanRenderingContext { .and_then(|info| info.framebuffer_object) } + /// Prepares the context for rendering by binding the framebuffer. pub fn prepare_for_rendering(&self) { - let framebuffer_id = self - .framebuffer() - .map_or(0, |framebuffer| framebuffer.0.into()); - self.gleam_gl - .bind_framebuffer(gleam::gl::FRAMEBUFFER, framebuffer_id); + let framebuffer_id = self.get_framebuffer_id(); + self.gleam_gl.bind_framebuffer(gleam::gl::FRAMEBUFFER, framebuffer_id); } + /// Reads the content of the framebuffer into an image. pub fn read_to_image(&self, source_rectangle: DeviceIntRect) -> Option { - let framebuffer_id = self - .framebuffer() - .map_or(0, |framebuffer| framebuffer.0.into()); - Self::read_framebuffer_to_image(&self.gleam_gl, framebuffer_id, source_rectangle) + let framebuffer_id = self.get_framebuffer_id(); + Framebuffer::read_framebuffer_to_image(&self.gleam_gl, framebuffer_id, source_rectangle) } + fn get_framebuffer_id(&self) -> u32 { + self.framebuffer().map_or(0, |framebuffer| framebuffer.0.into()) + } + + /// Makes the context current on the calling thread. pub fn make_current(&self) -> Result<(), Error> { let device = &self.device.borrow(); let context = &mut self.context.borrow(); device.make_context_current(context) } - pub fn create_texture(&self, surface: Surface) -> Option<(SurfaceTexture, u32, Size2D)> { + /// Creates a texture from a surface. + pub fn create_texture( + &self, + surface: Surface, + ) -> Option<(SurfaceTexture, u32, UntypedSize2D)> { let device = &self.device.borrow(); let context = &mut self.context.borrow_mut(); - - let SurfaceInfo { - id: _front_buffer_id, - size, - .. - } = device.surface_info(&surface); - // debug!("... getting texture for surface {:?}", front_buffer_id); - let surface_texture = device.create_surface_texture(context, surface).ok()?; - - let gl_texture = device - .surface_texture_object(&surface_texture) - .map(|tex| tex.0.get()) - .unwrap_or(0); - + let SurfaceInfo { id: front_buffer_id, size, .. } = device.surface_info(&surface); + debug!("... getting texture for surface {:?}", front_buffer_id); + let surface_texture = device.create_surface_texture(context, surface).unwrap(); + let gl_texture = + device.surface_texture_object(&surface_texture).map(|tex| tex.0.get()).unwrap_or(0); Some((surface_texture, gl_texture, size)) } + /// Destroys a texture and returns the underlying surface. pub fn destroy_texture(&self, surface_texture: SurfaceTexture) -> Option { let device = &self.device.borrow(); let context = &mut self.context.borrow_mut(); - - device - .destroy_surface_texture(context, surface_texture) - .map_err(|(error, _)| error) - .ok() + device.destroy_surface_texture(context, surface_texture).map_err(|(error, _)| error).ok() } + /// Returns the connection associated with the device. pub fn connection(&self) -> Option { Some(self.device.borrow().connection()) } +} - /// Reads pixel data from the framebuffer into an RGBA image. - /// Flips the image vertically since OpenGL's origin is bottom-left. +struct Framebuffer { + gl: Rc, + framebuffer_id: gl::GLuint, + renderbuffer_id: gl::GLuint, + texture_id: gl::GLuint, +} + +impl Drop for Framebuffer { + fn drop(&mut self) { + self.gl.bind_framebuffer(gl::FRAMEBUFFER, 0); + self.gl.delete_textures(&[self.texture_id]); + self.gl.delete_renderbuffers(&[self.renderbuffer_id]); + self.gl.delete_framebuffers(&[self.framebuffer_id]); + } +} + +impl Framebuffer { fn read_framebuffer_to_image( gl: &Rc, framebuffer_id: u32, @@ -203,19 +232,17 @@ impl SurfmanRenderingContext { ); let gl_error = gl.get_error(); if gl_error != gl::NO_ERROR { - // warn!("GL error code 0x{gl_error:x} set after read_pixels"); + warn!("GL error code 0x{gl_error:x} set after read_pixels"); } // Flip image vertically (OpenGL textures are upside down) let source_rectangle = source_rectangle.to_usize(); - let orig_pixels = pixels.clone(); - let stride = source_rectangle.width() * 4; // 4 bytes per RGBA pixel - for y in 0..source_rectangle.height() { - let dst_start = y * stride; - let src_start = (source_rectangle.height() - y - 1) * stride; - let src_slice = &orig_pixels[src_start..src_start + stride]; - pixels[dst_start..dst_start + stride].clone_from_slice(&src_slice[..stride]); - } + super::utils::flip_image_vertically( + &mut pixels, + source_rectangle.width(), + source_rectangle.height(), + 4, + ); RgbaImage::from_raw( source_rectangle.width() as u32, diff --git a/examples/servo/src/webview/rendering_context/utils.rs b/examples/servo/src/webview/rendering_context/utils.rs new file mode 100644 index 00000000000..87d7c68878b --- /dev/null +++ b/examples/servo/src/webview/rendering_context/utils.rs @@ -0,0 +1,97 @@ +// Copyright © SixtyFPS GmbH +// SPDX-License-Identifier: MIT + +use super::surfman_context::SurfmanRenderingContext; +use winit::dpi::PhysicalSize; + +#[derive(thiserror::Error, Debug)] +pub enum TextureError { + #[error("{0:?}")] + Surfman(surfman::Error), + #[error("No surface returned when the surface was unbound from the context")] + NoSurface, +} + +/// A guard that unbinds a surface from the context on creation and rebinds it on drop. +/// +/// This is useful for temporarily taking ownership of the surface to perform operations +/// that require it to be unbound, such as importing it into another API. +pub struct SurfaceGuard<'a> { + context: &'a SurfmanRenderingContext, + surface: Option, +} + +impl<'a> SurfaceGuard<'a> { + /// Creates a new `SurfaceGuard`, unbinding the current surface from the context. + pub fn new(context: &'a SurfmanRenderingContext) -> Result { + let mut surfman_context = context.context.borrow_mut(); + let surface = context + .device + .borrow() + .unbind_surface_from_context(&mut surfman_context) + .map_err(TextureError::Surfman)? + .ok_or(TextureError::NoSurface)?; + + Ok(Self { context, surface: Some(surface) }) + } + + /// Returns a reference to the unbound surface. + pub fn surface(&self) -> &surfman::Surface { + self.surface.as_ref().unwrap() + } +} + +impl<'a> Drop for SurfaceGuard<'a> { + fn drop(&mut self) { + if let Some(surface) = self.surface.take() { + let device = self.context.device.borrow(); + let mut context = self.context.context.borrow_mut(); + if let Err((_err, mut surface)) = device.bind_surface_to_context(&mut context, surface) + { + let _ = device.destroy_surface(&mut context, &mut surface); + } + } + } +} + +/// Helper function to create a `wgpu::TextureDescriptor`. +pub fn create_wgpu_texture_descriptor( + size: PhysicalSize, + label: &str, + usage: wgpu::TextureUsages, + format: wgpu::TextureFormat, +) -> wgpu::TextureDescriptor<'_> { + wgpu::TextureDescriptor { + label: Some(label), + size: wgpu::Extent3d { width: size.width, height: size.height, depth_or_array_layers: 1 }, + mip_level_count: 1, + sample_count: 1, + dimension: wgpu::TextureDimension::D2, + format, + usage, + view_formats: &[], + } +} + +/// Flips an image buffer vertically in place. +/// +/// This is used to correct the orientation of textures read from OpenGL, which uses a +/// bottom-left origin, whereas other APIs (like WGPU/Metal/Vulkan) typically use top-left. +pub fn flip_image_vertically( + pixels: &mut [u8], + width: usize, + height: usize, + bytes_per_pixel: usize, +) { + let stride = width * bytes_per_pixel; + let mut row_buffer = vec![0u8; stride]; + for y in 0..height / 2 { + let top_row_start = y * stride; + let bottom_row_start = (height - y - 1) * stride; + + // Swap rows + row_buffer.copy_from_slice(&pixels[top_row_start..top_row_start + stride]); + pixels.copy_within(bottom_row_start..bottom_row_start + stride, top_row_start); + pixels[bottom_row_start..bottom_row_start + stride].copy_from_slice(&row_buffer); + } +} diff --git a/examples/servo/src/webview/rendering_context/vulkan/mod.rs b/examples/servo/src/webview/rendering_context/vulkan/mod.rs new file mode 100644 index 00000000000..baeabec85a9 --- /dev/null +++ b/examples/servo/src/webview/rendering_context/vulkan/mod.rs @@ -0,0 +1,5 @@ +// Copyright © SixtyFPS GmbH +// SPDX-License-Identifier: MIT + +mod vulkan; +pub use vulkan::{VulkanTextureError, WPGPUTextureFromVulkan}; diff --git a/examples/servo/src/webview/rendering_context/vulkan/vulkan.rs b/examples/servo/src/webview/rendering_context/vulkan/vulkan.rs new file mode 100644 index 00000000000..33f14a3068b --- /dev/null +++ b/examples/servo/src/webview/rendering_context/vulkan/vulkan.rs @@ -0,0 +1,380 @@ +// Copyright © SixtyFPS GmbH +// SPDX-License-Identifier: MIT + +use winit::dpi::PhysicalSize; + +use ash::vk; +use glow::HasContext; + +#[cfg(not(target_os = "android"))] +use gl::Gl; +#[cfg(target_os = "android")] +use gl::Gles2 as Gl; + +use crate::gl_bindings as gl; + +use super::super::gpu_rendering_context::GPURenderingContext; +use super::super::utils::{ + SurfaceGuard, TextureError, create_wgpu_texture_descriptor, flip_image_vertically, +}; + +#[cfg(any(target_os = "linux", target_os = "android"))] +#[derive(thiserror::Error, Debug)] +pub enum VulkanTextureError { + #[error(transparent)] + Utils(#[from] TextureError), + #[error("{0}")] + Vulkan(#[from] ash::vk::Result), + #[error("The surface didn't have a framebuffer object")] + NoFramebuffer, + #[error("Wgpu is not using the vulkan backend")] + WgpuNotVulkan, + #[error("{0}")] + OpenGL(String), +} + +pub struct WPGPUTextureFromVulkan<'a> { + context: &'a GPURenderingContext, +} + +impl<'a> WPGPUTextureFromVulkan<'a> { + pub fn new(context: &'a GPURenderingContext) -> Self { + Self { context } + } + + /// Imports Vulkan surface as a WGPU texture for rendering on Linux and Android. + /// Creates a Vulkan image with external memory, imports to OpenGL, blits content, then wraps as WGPU texture. + pub fn get(&self) -> Result { + // Check if we are running on an emulator. + // The optimized path is known to be unstable on the Android Emulator. + let is_emulator = { + let gl = self.context.surfman_rendering_info.glow_gl.clone(); + unsafe { + let renderer = gl.get_parameter_string(glow::RENDERER); + renderer.contains("Android Emulator") + || renderer.contains("Goldfish") + || renderer.contains("SwiftShader") + } + }; + + if is_emulator { + log::warn!( + "Detected Android Emulator. Skipping optimized Vulkan texture sharing and using CPU fallback." + ); + return self.get_wgpu_texture_from_vulkan_cpu_fallback(); + } + + // Try optimized path first + match self.get_wgpu_texture_from_vulkan_optimized() { + Ok(texture) => Ok(texture), + Err(err) => { + log::warn!( + "Optimized Vulkan texture sharing failed: {:?}. Falling back to CPU copy.", + err + ); + self.get_wgpu_texture_from_vulkan_cpu_fallback() + } + } + } + + fn get_wgpu_texture_from_vulkan_optimized(&self) -> Result { + let surface_guard = SurfaceGuard::new(&self.context.surfman_rendering_info)?; + + { + let device = self.context.surfman_rendering_info.device.borrow(); + let mut context = self.context.surfman_rendering_info.context.borrow_mut(); + device + .make_context_current(&mut context) + .map_err(|e| VulkanTextureError::Utils(TextureError::Surfman(e)))?; + } + + let device = self.context.surfman_rendering_info.device.borrow(); + let surface_info = device.surface_info(surface_guard.surface()); + let size = self.context.size.get(); + + unsafe { + let hal_device = self + .context + .wgpu_device + .as_hal::() + .ok_or(VulkanTextureError::WgpuNotVulkan)?; + let vulkan_device = hal_device.raw_device().clone(); + let vulkan_instance = hal_device.shared_instance().raw_instance(); + + // Check if the required extension is supported to avoid panics in ash. + // Ash's `Device::new` (or extension loaders) might panic if functions are missing. + // We verify `vkGetMemoryFdKHR` availability dynamically using `get_device_proc_addr`. + let get_memory_fd_khr_name = std::ffi::CString::new("vkGetMemoryFdKHR").unwrap(); + let get_memory_fd_khr = vulkan_instance + .get_device_proc_addr(vulkan_device.handle(), get_memory_fd_khr_name.as_ptr()); + + if get_memory_fd_khr.is_none() { + return Err(VulkanTextureError::Vulkan(vk::Result::ERROR_EXTENSION_NOT_PRESENT)); + } + + let (vulkan_image, memory) = self.create_and_import_vulkan_image( + &vulkan_device, + &vulkan_instance, + &surface_info, + )?; + + let hal_texture = hal_device.texture_from_raw( + vulkan_image, + &wgpu_hal::TextureDescriptor { + label: Some("Vulkan Hal Texture"), + size: wgpu::Extent3d { + width: size.width, + height: size.height, + depth_or_array_layers: 1, + }, + format: wgpu::TextureFormat::Rgba8Unorm, + dimension: wgpu::TextureDimension::D2, + mip_level_count: 1, + sample_count: 1, + usage: wgpu::TextureUses::RESOURCE | wgpu::TextureUses::COLOR_TARGET, + view_formats: vec![], + memory_flags: wgpu_hal::MemoryFlags::empty(), + }, + Some(Box::new(move || { + // Images aren't cleaned up by wgpu-hal if theres a drop callback set so do it manually + vulkan_device.destroy_image(vulkan_image, None); + // Free the memory + vulkan_device.free_memory(memory, None); + })), + ); + + let wgpu_descriptor = create_wgpu_texture_descriptor( + size, + "Vulkan WGPU Texture", + wgpu::TextureUsages::TEXTURE_BINDING | wgpu::TextureUsages::RENDER_ATTACHMENT, + wgpu::TextureFormat::Rgba8Unorm, + ); + + Ok(self + .context + .wgpu_device + .create_texture_from_hal::(hal_texture, &wgpu_descriptor)) + } + } + + fn get_wgpu_texture_from_vulkan_cpu_fallback( + &self, + ) -> Result { + let surface_guard = SurfaceGuard::new(&self.context.surfman_rendering_info)?; + + { + let device = self.context.surfman_rendering_info.device.borrow(); + let mut context = self.context.surfman_rendering_info.context.borrow_mut(); + device + .make_context_current(&mut context) + .map_err(|e| VulkanTextureError::Utils(TextureError::Surfman(e)))?; + } + + let device = self.context.surfman_rendering_info.device.borrow(); + let surface_info = device.surface_info(surface_guard.surface()); + let size = self.context.size.get(); + + // Fallback to CPU copy for Android/Emulator where extensions might be missing + let gl = &self.context.surfman_rendering_info.glow_gl; + + let read_framebuffer = + surface_info.framebuffer_object.ok_or(VulkanTextureError::NoFramebuffer)?; + + let mut pixels = vec![0u8; (size.width * size.height * 4) as usize]; + + unsafe { + gl.bind_framebuffer(gl::READ_FRAMEBUFFER, Some(read_framebuffer)); + gl.read_pixels( + 0, + 0, + size.width as i32, + size.height as i32, + gl::RGBA, + gl::UNSIGNED_BYTE, + glow::PixelPackData::Slice(Some(&mut pixels)), + ); + } + + // Flip image vertically (OpenGL textures are upside down) + let stride = (size.width * 4) as usize; + let height = size.height as usize; + flip_image_vertically(&mut pixels, size.width as usize, height, 4); + + // Create wgpu texture + let texture_desc = create_wgpu_texture_descriptor( + size, + "Servo Texture Fallback", + wgpu::TextureUsages::TEXTURE_BINDING + | wgpu::TextureUsages::COPY_DST + | wgpu::TextureUsages::RENDER_ATTACHMENT + | wgpu::TextureUsages::COPY_SRC, + wgpu::TextureFormat::Rgba8Unorm, + ); + + let texture = self.context.wgpu_device.create_texture(&texture_desc); + + // Upload pixels + self.context.wgpu_queue.write_texture( + wgpu::TexelCopyTextureInfo { + texture: &texture, + mip_level: 0, + origin: wgpu::Origin3d::ZERO, + aspect: wgpu::TextureAspect::All, + }, + &pixels, + wgpu::TexelCopyBufferLayout { + offset: 0, + bytes_per_row: Some(size.width * 4), + rows_per_image: Some(size.height), + }, + texture_desc.size, + ); + + Ok(texture) + } + + fn create_and_import_vulkan_image( + &self, + vulkan_device: &ash::Device, + vulkan_instance: &ash::Instance, + surface_info: &surfman::SurfaceInfo, + ) -> Result<(vk::Image, vk::DeviceMemory), VulkanTextureError> { + let size = self.context.size.get(); + let gl = &self.context.surfman_rendering_info.glow_gl; + let surfman_device = self.context.surfman_rendering_info.device.borrow(); + let context = self.context.surfman_rendering_info.context.borrow(); + + let (vulkan_image, memory, memory_requirements) = + Self::create_vulkan_image_and_memory(vulkan_device, size)?; + + // Export Vulkan memory as a file descriptor for OpenGL import + let external_memory_fd_api = + ash::khr::external_memory_fd::Device::new(vulkan_instance, vulkan_device); + + let memory_handle = unsafe { + external_memory_fd_api.get_memory_fd( + &vk::MemoryGetFdInfoKHR::default() + .memory(memory) + .handle_type(vk::ExternalMemoryHandleTypeFlags::OPAQUE_FD), + )? + }; + + let gl_with_extensions = + Gl::load_with(|function_name| surfman_device.get_proc_address(&context, function_name)); + + unsafe { + let mut memory_object = 0; + gl_with_extensions.CreateMemoryObjectsEXT(1, &mut memory_object); + // We're using a dedicated allocation. + gl_with_extensions.MemoryObjectParameterivEXT( + memory_object, + gl::DEDICATED_MEMORY_OBJECT_EXT, + &1, + ); + gl_with_extensions.ImportMemoryFdEXT( + memory_object, + memory_requirements.size, + gl::HANDLE_TYPE_OPAQUE_FD_EXT, + memory_handle, + ); + // Create a texture and bind it to the imported memory. + let texture = gl.create_texture().map_err(VulkanTextureError::OpenGL)?; + gl.bind_texture(gl::TEXTURE_2D, Some(texture)); + gl_with_extensions.TexStorageMem2DEXT( + gl::TEXTURE_2D, + 1, + gl::RGBA8, + size.width as i32, + size.height as i32, + memory_object, + 0, + ); + + // Blit Servo's framebuffer to the imported texture + + let draw_framebuffer = gl.create_framebuffer().map_err(VulkanTextureError::OpenGL)?; + let read_framebuffer = + surface_info.framebuffer_object.ok_or(VulkanTextureError::NoFramebuffer)?; + + gl.bind_framebuffer(gl::DRAW_FRAMEBUFFER, Some(draw_framebuffer)); + gl.framebuffer_texture_2d( + gl::DRAW_FRAMEBUFFER, + gl::COLOR_ATTACHMENT0, + gl::TEXTURE_2D, + Some(texture), + 0, + ); + + gl.bind_framebuffer(gl::READ_FRAMEBUFFER, Some(read_framebuffer)); + gl.bind_framebuffer(gl::DRAW_FRAMEBUFFER, Some(draw_framebuffer)); + + gl.blit_framebuffer( + 0, + 0, + size.width as i32, + size.height as i32, + // Flip vertically - OpenGL origin is bottom-left, texture origin is top-left + 0, + size.height as i32, + size.width as i32, + 0, + gl::COLOR_BUFFER_BIT, + gl::NEAREST, + ); + gl.flush(); + // Delete all the opengl objects. Seems to be required to prevent memory leaks + // according to `amdgpu_top`. + gl.delete_framebuffer(draw_framebuffer); + gl.delete_texture(texture); + gl_with_extensions.DeleteMemoryObjectsEXT(1, &memory_object); + } + + Ok((vulkan_image, memory)) + } + + fn create_vulkan_image_and_memory( + vulkan_device: &ash::Device, + size: PhysicalSize, + ) -> Result<(vk::Image, vk::DeviceMemory, vk::MemoryRequirements), VulkanTextureError> { + let mut external_memory_image_info = vk::ExternalMemoryImageCreateInfo::default() + .handle_types(vk::ExternalMemoryHandleTypeFlags::OPAQUE_FD); + + unsafe { + let vulkan_image = vulkan_device.create_image( + &vk::ImageCreateInfo::default() + .image_type(vk::ImageType::TYPE_2D) + .format(vk::Format::R8G8B8A8_UNORM) + .extent(vk::Extent3D { width: size.width, height: size.height, depth: 1 }) + .mip_levels(1) + .array_layers(1) + .samples(vk::SampleCountFlags::TYPE_1) + .tiling(vk::ImageTiling::OPTIMAL) + .usage(vk::ImageUsageFlags::SAMPLED | vk::ImageUsageFlags::COLOR_ATTACHMENT) + .sharing_mode(vk::SharingMode::EXCLUSIVE) + .initial_layout(vk::ImageLayout::UNDEFINED) + .push_next(&mut external_memory_image_info), + None, + )?; + + let memory_requirements = vulkan_device.get_image_memory_requirements(vulkan_image); + + let mut dedicated_allocate_info = + vk::MemoryDedicatedAllocateInfo::default().image(vulkan_image); + + let mut export_info = vk::ExportMemoryAllocateInfo::default() + .handle_types(vk::ExternalMemoryHandleTypeFlags::OPAQUE_FD); + + let memory = vulkan_device.allocate_memory( + &vk::MemoryAllocateInfo::default() + .allocation_size(memory_requirements.size) + .push_next(&mut dedicated_allocate_info) + .push_next(&mut export_info), + None, + )?; + + vulkan_device.bind_image_memory(vulkan_image, memory, 0)?; + + Ok((vulkan_image, memory, memory_requirements)) + } + } +} diff --git a/examples/servo/src/webview/webview.rs b/examples/servo/src/webview/webview.rs index 34d13215e6b..6dbcd08db4d 100644 --- a/examples/servo/src/webview/webview.rs +++ b/examples/servo/src/webview/webview.rs @@ -63,32 +63,28 @@ impl WebView { pub fn new( app: MyApp, initial_url: SharedString, - #[cfg(not(target_os = "android"))] device: slint::wgpu_27::wgpu::Device, - #[cfg(not(target_os = "android"))] queue: slint::wgpu_27::wgpu::Queue, + device: slint::wgpu_27::wgpu::Device, + queue: slint::wgpu_27::wgpu::Queue, ) { let (waker_sender, waker_receiver) = channel::unbounded::<()>(); let adapter = Rc::new(SlintServoAdapter::new( waker_sender.clone(), waker_receiver.clone(), - #[cfg(not(target_os = "android"))] device, - #[cfg(not(target_os = "android"))] queue, )); - let state_weak = Rc::downgrade(&adapter); - let state = super::adapter::upgrade_adapter(&state_weak); + let (rendering_adapter, physical_size) = + Self::init_rendering_adapter(&app, adapter.clone()); - let (rendering_adapter, physical_size) = Self::init_rendering_adapter(&app, state.clone()); - - let servo = Self::init_servo_builder(state.clone(), rendering_adapter.clone()); + let servo = Self::init_servo_builder(adapter.clone()); Self::init_webview( &app, physical_size, initial_url, - state.clone(), + adapter.clone(), servo, rendering_adapter, ); @@ -118,17 +114,13 @@ impl WebView { let size: Size2D = Size2D::new(width, height); let physical_size = PhysicalSize::new(size.width as u32, size.height as u32); - #[cfg(not(target_os = "android"))] let rendering_adapter = super::rendering_context::try_create_gpu_context( + physical_size, adapter.wgpu_device(), adapter.wgpu_queue(), - physical_size, ) .unwrap(); - #[cfg(target_os = "android")] - let rendering_adapter = super::rendering_context::create_software_context(physical_size); - let rendering_adapter_rc = Rc::new(rendering_adapter); (rendering_adapter_rc, physical_size) @@ -147,15 +139,11 @@ impl WebView { /// # Returns /// /// A configured Servo instance ready for use - fn init_servo_builder( - adapter: Rc, - rendering_adapter: Rc>, - ) -> Servo { + fn init_servo_builder(adapter: Rc) -> Servo { let waker = Waker::new(adapter.waker_sender()); let event_loop_waker = Box::new(waker); - let rendering_context = rendering_adapter.get_rendering_context(); - ServoBuilder::new(rendering_context).event_loop_waker(event_loop_waker).build() + ServoBuilder::default().event_loop_waker(event_loop_waker).build() } /// Initializes the Servo WebView with the initial URL and configuration. @@ -188,8 +176,13 @@ impl WebView { let delegate = Rc::new(AppDelegate::new(app, adapter.clone())); - let webview = - WebViewBuilder::new(&servo).url(url).size(physical_size).delegate(delegate).build(); + let rendering_context = rendering_adapter.get_rendering_context(); + + let webview = WebViewBuilder::new(&servo, rendering_context) + .url(url) + .size(physical_size) + .delegate(delegate) + .build(); webview.show(true); diff --git a/examples/servo/ui/app.slint b/examples/servo/ui/app.slint index 3e306c6847f..74fdf64642d 100644 --- a/examples/servo/ui/app.slint +++ b/examples/servo/ui/app.slint @@ -17,8 +17,11 @@ export component MyApp inherits Window { preferred-height: 768px; VerticalBox { - padding: 0px; spacing: 0px; + padding-left: root.safe-area-inset-left; + padding-top: root.safe-area-inset-top; + padding-right: root.safe-area-inset-right; + padding-bottom: root.safe-area-inset-bottom; HorizontalBox { height: 50px;