gpui: Update dependencies (second attempt) (#9836)

Niklas Wimmer created

Updated version of #9741 with fixes for the problems raised in #9774. I
only verified that the images no longer look blueish on Linux, because I
don't have a Mac.

cc @osiewicz

Release Notes:

- N/A

---------

Signed-off-by: Niklas Wimmer <mail@nwimmer.me>

Change summary

Cargo.lock                                      | 536 ++++++++++++------
crates/gpui/Cargo.toml                          |  26 
crates/gpui/build.rs                            | 349 ++++++-----
crates/gpui/src/assets.rs                       |   6 
crates/gpui/src/image_cache.rs                  |   4 
crates/gpui/src/platform/blade/blade_atlas.rs   |   2 
crates/gpui/src/platform/linux/text_system.rs   |   3 
crates/gpui/src/platform/mac/metal_atlas.rs     |   2 
crates/gpui/src/platform/mac/metal_renderer.rs  |  16 
crates/gpui/src/platform/mac/text_system.rs     |   3 
crates/gpui/src/platform/windows/text_system.rs |  21 
crates/gpui/src/svg_renderer.rs                 |  27 
crates/media/src/media.rs                       |   2 
13 files changed, 605 insertions(+), 392 deletions(-)

Detailed changes

Cargo.lock 🔗

@@ -34,12 +34,6 @@ version = "1.0.2"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe"
 
-[[package]]
-name = "adler32"
-version = "1.2.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "aae1277d39aeec15cb388266ecc24b11c80469deae6067e17a1a7aa9e5c1f234"
-
 [[package]]
 name = "aes"
 version = "0.8.4"
@@ -115,6 +109,12 @@ version = "0.1.3"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "250f629c0161ad8107cf89319e990051fae62832fd343083bea452d93e2205fd"
 
+[[package]]
+name = "aligned-vec"
+version = "0.5.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "4aa90d7ce82d4be67b64039a3d588d38dbcc6736577de4a847025ce5b0c468d1"
+
 [[package]]
 name = "allocator-api2"
 version = "0.2.16"
@@ -234,16 +234,21 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "7d5a26814d8dcb93b0e5a0ff3c6d80a8843bafb21b39e8e18a6f05471870e110"
 
 [[package]]
-name = "arrayref"
-version = "0.3.7"
+name = "arg_enum_proc_macro"
+version = "0.3.4"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6b4930d2cb77ce62f89ee5d5289b4ac049559b1c45539271f5ed4fdc7db34545"
+checksum = "0ae92a5119aa49cdbcf6b9f893fe4e1d98b04ccbf82ee0584ad948a44a734dea"
+dependencies = [
+ "proc-macro2",
+ "quote",
+ "syn 2.0.48",
+]
 
 [[package]]
-name = "arrayvec"
-version = "0.5.2"
+name = "arrayref"
+version = "0.3.7"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "23b62fc65de8e4e7f52534fb52b0f3ed04746ae267519eef2a83941e8085068b"
+checksum = "6b4930d2cb77ce62f89ee5d5289b4ac049559b1c45539271f5ed4fdc7db34545"
 
 [[package]]
 name = "arrayvec"
@@ -285,9 +290,9 @@ dependencies = [
 
 [[package]]
 name = "ashpd"
-version = "0.7.0"
+version = "0.8.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "01992ad7774250d5b7fe214e2676cb99bf92564436d8135ab44fe815e71769a9"
+checksum = "1b22517ee647547c01a687cf9b76074e1c91334032a4324f7243c6ee0f949390"
 dependencies = [
  "async-fs 2.1.1",
  "async-net 2.0.0",
@@ -298,7 +303,7 @@ dependencies = [
  "serde",
  "serde_repr",
  "url",
- "zbus 3.15.1",
+ "zbus",
 ]
 
 [[package]]
@@ -351,16 +356,6 @@ dependencies = [
  "workspace",
 ]
 
-[[package]]
-name = "async-broadcast"
-version = "0.5.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7c48ccdbf6ca6b121e0f586cbc0e73ae440e56c67c30fa0873b4e110d9c26d2b"
-dependencies = [
- "event-listener 2.5.3",
- "futures-core",
-]
-
 [[package]]
 name = "async-broadcast"
 version = "0.7.0"
@@ -825,6 +820,29 @@ version = "1.1.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa"
 
+[[package]]
+name = "av1-grain"
+version = "0.2.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "6678909d8c5d46a42abcf571271e15fdbc0a225e3646cf23762cd415046c78bf"
+dependencies = [
+ "anyhow",
+ "arrayvec",
+ "log",
+ "nom",
+ "num-rational",
+ "v_frame",
+]
+
+[[package]]
+name = "avif-serialize"
+version = "0.8.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "876c75a42f6364451a033496a14c44bffe41f5f4a8236f697391f11024e596d2"
+dependencies = [
+ "arrayvec",
+]
+
 [[package]]
 name = "aws-config"
 version = "1.1.5"
@@ -1271,7 +1289,7 @@ dependencies = [
  "cc",
  "cfg-if",
  "libc",
- "miniz_oxide 0.7.1",
+ "miniz_oxide",
  "object",
  "rustc-demangle",
 ]
@@ -1394,6 +1412,12 @@ version = "0.6.3"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "349f9b6a179ed607305526ca489b34ad0a41aed5f7980fa90eb03160b69598fb"
 
+[[package]]
+name = "bit_field"
+version = "0.10.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "dc827186963e592360843fb5ba4b973e145841266c1357f7180c43526f2e5b61"
+
 [[package]]
 name = "bitflags"
 version = "1.3.2"
@@ -1409,6 +1433,12 @@ dependencies = [
  "serde",
 ]
 
+[[package]]
+name = "bitstream-io"
+version = "2.2.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "06c9989a51171e2e81038ab168b6ae22886fe9ded214430dbb4f41c28cf176da"
+
 [[package]]
 name = "bitvec"
 version = "1.0.1"
@@ -1590,6 +1620,12 @@ dependencies = [
  "serde",
 ]
 
+[[package]]
+name = "built"
+version = "0.7.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "38d17f4d6e4dc36d1a02fbedc2753a096848e7c1b0772f7654eab8e2c927dd53"
+
 [[package]]
 name = "bumpalo"
 version = "3.14.0"
@@ -1855,6 +1891,16 @@ dependencies = [
  "nom",
 ]
 
+[[package]]
+name = "cfg-expr"
+version = "0.15.7"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "fa50868b64a9a6fda9d593ce778849ea8715cd2a3d2cc17ffdb4a2f2f2f1961d"
+dependencies = [
+ "smallvec",
+ "target-lexicon",
+]
+
 [[package]]
 name = "cfg-if"
 version = "1.0.0"
@@ -2565,19 +2611,21 @@ dependencies = [
 
 [[package]]
 name = "cosmic-text"
-version = "0.10.0"
+version = "0.11.2"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "75acbfb314aeb4f5210d379af45ed1ec2c98c7f1790bf57b8a4c562ac0c51b71"
+checksum = "c578f2b9abb4d5f3fbb12aba4008084d435dc6a8425c195cfe0b3594bfea0c25"
 dependencies = [
- "fontdb 0.15.0",
+ "bitflags 2.4.2",
+ "fontdb",
  "libm",
  "log",
  "rangemap",
  "rustc-hash",
- "rustybuzz 0.11.0",
+ "rustybuzz",
  "self_cell",
  "swash",
  "sys-locale",
+ "ttf-parser",
  "unicode-bidi",
  "unicode-linebreak",
  "unicode-script",
@@ -2799,7 +2847,7 @@ dependencies = [
  "autocfg",
  "cfg-if",
  "crossbeam-utils",
- "memoffset 0.9.0",
+ "memoffset",
  "scopeguard",
 ]
 
@@ -2822,6 +2870,12 @@ dependencies = [
  "cfg-if",
 ]
 
+[[package]]
+name = "crunchy"
+version = "0.2.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7"
+
 [[package]]
 name = "crypto-bigint"
 version = "0.4.9"
@@ -2948,12 +3002,9 @@ checksum = "7e962a19be5cfc3f3bf6dd8f61eb50107f356ad6270fbb3ed41476571db78be5"
 
 [[package]]
 name = "data-url"
-version = "0.1.1"
+version = "0.3.1"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3a30bfce702bcfa94e906ef82421f2c0e61c076ad76030c16ee5d2e9a32fe193"
-dependencies = [
- "matches",
-]
+checksum = "5c297a1c74b71ae29df00c3e22dd9534821d60eb9af5a0192823fa2acea70c2a"
 
 [[package]]
 name = "db"
@@ -2972,16 +3023,6 @@ dependencies = [
  "util",
 ]
 
-[[package]]
-name = "deflate"
-version = "0.8.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "73770f8e1fe7d64df17ca66ad28994a0a623ea497fa69486e14984e715c5d174"
-dependencies = [
- "adler32",
- "byteorder",
-]
-
 [[package]]
 name = "der"
 version = "0.6.1"
@@ -3475,6 +3516,22 @@ dependencies = [
  "pin-project-lite",
 ]
 
+[[package]]
+name = "exr"
+version = "1.72.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "887d93f60543e9a9362ef8a21beedd0a833c5d9610e18c67abe15a5963dcb1a4"
+dependencies = [
+ "bit_field",
+ "flume",
+ "half",
+ "lebe",
+ "miniz_oxide",
+ "rayon-core",
+ "smallvec",
+ "zune-inflate",
+]
+
 [[package]]
 name = "extension"
 version = "0.1.0"
@@ -3606,6 +3663,15 @@ dependencies = [
  "windows-sys 0.52.0",
 ]
 
+[[package]]
+name = "fdeflate"
+version = "0.3.4"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "4f9bfee30e4dedf0ab8b422f03af778d9612b63f502710fc500a334ebe2de645"
+dependencies = [
+ "simd-adler32",
+]
+
 [[package]]
 name = "feature_flags"
 version = "0.1.0"
@@ -3708,14 +3774,14 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "c6c98ee8095e9d1dcbf2fcc6d95acccb90d1c81db1e44725c6a984b1dbdfb010"
 dependencies = [
  "crc32fast",
- "miniz_oxide 0.7.1",
+ "miniz_oxide",
 ]
 
 [[package]]
 name = "float-cmp"
-version = "0.5.3"
+version = "0.9.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "75224bec9bfe1a65e2d34132933f2de7fe79900c96a0174307554244ece8150e"
+checksum = "98de4bbd547a563b716d8dfa9aad1cb19bfab00f4fa09a6a4ed21dbcf44ce9c4"
 
 [[package]]
 name = "float-ord"
@@ -3777,32 +3843,21 @@ version = "0.5.6"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "6a595cb550439a117696039dfc69830492058211b771a2a165379f2a1a53d84d"
 dependencies = [
- "roxmltree 0.19.0",
-]
-
-[[package]]
-name = "fontdb"
-version = "0.5.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e58903f4f8d5b58c7d300908e4ebe5289c1bfdf5587964330f12023b8ff17fd1"
-dependencies = [
- "log",
- "memmap2 0.2.3",
- "ttf-parser 0.12.3",
+ "roxmltree",
 ]
 
 [[package]]
 name = "fontdb"
-version = "0.15.0"
+version = "0.16.2"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "020e203f177c0fb250fb19455a252e838d2bbbce1f80f25ecc42402aafa8cd38"
+checksum = "b0299020c3ef3f60f526a4f64ab4a3d4ce116b1acbf24cdd22da0068e5d81dc3"
 dependencies = [
  "fontconfig-parser",
  "log",
- "memmap2 0.8.0",
+ "memmap2 0.9.4",
  "slotmap",
  "tinyvec",
- "ttf-parser 0.19.2",
+ "ttf-parser",
 ]
 
 [[package]]
@@ -3849,9 +3904,9 @@ checksum = "aa9a19cbb55df58761df49b23516a86d432839add4af60fc256da840f66ed35b"
 
 [[package]]
 name = "form_urlencoded"
-version = "1.2.0"
+version = "1.2.1"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a62bc1cf6f830c2ec14a513a9fb124d0a213a629668a4186f329db21fe045652"
+checksum = "e13624c2627564efccf4934284bdd98cbaa14e79b0b5a141218e507b3a823456"
 dependencies = [
  "percent-encoding",
 ]
@@ -4161,9 +4216,19 @@ dependencies = [
 
 [[package]]
 name = "gif"
-version = "0.11.4"
+version = "0.12.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3edd93c6756b4dfaf2709eafcc345ba2636565295c198a9cfbf75fa5e3e00b06"
+checksum = "80792593675e051cf94a4b111980da2ba60d4a83e43e0048c5693baab3977045"
+dependencies = [
+ "color_quant",
+ "weezl",
+]
+
+[[package]]
+name = "gif"
+version = "0.13.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "3fb2d69b19215e18bb912fa30f7ce15846e301408695e44e0ef719f1da9e19f2"
 dependencies = [
  "color_quant",
  "weezl",
@@ -4378,8 +4443,6 @@ dependencies = [
  "taffy",
  "thiserror",
  "time",
- "tiny-skia",
- "usvg",
  "util",
  "uuid",
  "waker-fn",
@@ -4437,6 +4500,16 @@ dependencies = [
  "tracing",
 ]
 
+[[package]]
+name = "half"
+version = "2.4.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "b5eceaaeec696539ddaf7b333340f1af35a5aa87ae3e4f3ead0532f72affab2e"
+dependencies = [
+ "cfg-if",
+ "crunchy",
+]
+
 [[package]]
 name = "hashbrown"
 version = "0.12.3"
@@ -4516,6 +4589,12 @@ dependencies = [
  "unicode-segmentation",
 ]
 
+[[package]]
+name = "heck"
+version = "0.5.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea"
+
 [[package]]
 name = "hermit-abi"
 version = "0.1.19"
@@ -4744,9 +4823,9 @@ checksum = "25a2bc672d1148e28034f176e01fffebb08b35768468cc954630da77a1449005"
 
 [[package]]
 name = "idna"
-version = "0.4.0"
+version = "0.5.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7d20d6b07bfbc108882d88ed8e37d39636dcc260e15e30c45e6ba089610b917c"
+checksum = "634d9b1461af396cad843f47fdba5597a4f9e6ddd4bfb6ff5d85028c25cb12f6"
 dependencies = [
  "unicode-bidi",
  "unicode-normalization",
@@ -4770,21 +4849,35 @@ dependencies = [
 
 [[package]]
 name = "image"
-version = "0.23.14"
+version = "0.25.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "24ffcb7e7244a9bf19d35bf2883b9c080c4ced3c07a9895572178cdb8f13f6a1"
+checksum = "a9b4f005360d32e9325029b38ba47ebd7a56f3316df09249368939562d518645"
 dependencies = [
  "bytemuck",
  "byteorder",
  "color_quant",
- "gif",
- "jpeg-decoder",
- "num-iter",
- "num-rational 0.3.2",
+ "exr",
+ "gif 0.13.1",
+ "image-webp",
  "num-traits",
  "png",
- "scoped_threadpool",
+ "qoi",
+ "ravif",
+ "rayon",
+ "rgb",
  "tiff",
+ "zune-core",
+ "zune-jpeg",
+]
+
+[[package]]
+name = "image-webp"
+version = "0.1.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "7a84a25dcae3ac487bc24ef280f9e20c79c9b1a3e5e32cbed3041d1c514aa87c"
+dependencies = [
+ "byteorder",
+ "thiserror",
 ]
 
 [[package]]
@@ -4800,6 +4893,18 @@ dependencies = [
  "workspace",
 ]
 
+[[package]]
+name = "imagesize"
+version = "0.12.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "029d73f573d8e8d63e6d5020011d3255b28c3ba85d6cf870a07184ed23de9284"
+
+[[package]]
+name = "imgref"
+version = "1.10.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "44feda355f4159a7c757171a77de25daf6411e217b4cabd03bd6650690468126"
+
 [[package]]
 name = "indexmap"
 version = "1.9.3"
@@ -4888,6 +4993,17 @@ dependencies = [
  "cfg-if",
 ]
 
+[[package]]
+name = "interpolate_name"
+version = "0.2.4"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "c34819042dc3d3971c46c2190835914dfbe0c3c13f61449b2997f4e9722dfa60"
+dependencies = [
+ "proc-macro2",
+ "quote",
+ "syn 2.0.48",
+]
+
 [[package]]
 name = "io-extras"
 version = "0.18.1"
@@ -5089,12 +5205,9 @@ dependencies = [
 
 [[package]]
 name = "jpeg-decoder"
-version = "0.1.22"
+version = "0.3.1"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "229d53d58899083193af11e15917b5640cd40b29ff475a1fe4ef725deb02d0f2"
-dependencies = [
- "rayon",
-]
+checksum = "f5d4a7da358eff58addd2877a45865158f0d78c911d43a5784ceb7bbf52833b0"
 
 [[package]]
 name = "js-sys"
@@ -5152,11 +5265,21 @@ dependencies = [
 
 [[package]]
 name = "kurbo"
-version = "0.8.3"
+version = "0.9.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "bd85a5776cd9500c2e2059c8c76c3b01528566b7fcbaf8098b55a33fc298849b"
+dependencies = [
+ "arrayvec",
+]
+
+[[package]]
+name = "kurbo"
+version = "0.10.4"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7a53776d271cfb873b17c618af0298445c88afc52837f3e948fa3fafd131f449"
+checksum = "1618d4ebd923e97d67e7cd363d80aef35fe961005cbbbb3d2dad8bdd1bc63440"
 dependencies = [
- "arrayvec 0.7.4",
+ "arrayvec",
+ "smallvec",
 ]
 
 [[package]]
@@ -5362,12 +5485,29 @@ version = "0.2.5"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "884e2677b40cc8c339eaefcb701c32ef1fd2493d71118dc0ca4b6a736c93bd67"
 
+[[package]]
+name = "lebe"
+version = "0.5.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "03087c2bad5e1034e8cace5926dec053fb3790248370865f5117a7d0213354c8"
+
 [[package]]
 name = "libc"
 version = "0.2.153"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "9c198f91728a82281a64e1f4f9eeb25d82cb32a5de251c6bd1b5154d63a8e7bd"
 
+[[package]]
+name = "libfuzzer-sys"
+version = "0.4.7"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "a96cfd5557eb82f2b83fed4955246c988d331975a002961b07c81584d107e7f7"
+dependencies = [
+ "arbitrary",
+ "cc",
+ "once_cell",
+]
+
 [[package]]
 name = "libgit2-sys"
 version = "0.14.2+1.5.1"
@@ -5494,7 +5634,7 @@ name = "live_kit_client"
 version = "0.1.0"
 dependencies = [
  "anyhow",
- "async-broadcast 0.7.0",
+ "async-broadcast",
  "async-trait",
  "collections",
  "core-foundation",
@@ -5549,6 +5689,15 @@ dependencies = [
  "value-bag",
 ]
 
+[[package]]
+name = "loop9"
+version = "0.1.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "0fae87c125b03c1d2c0150c90365d7d6bcc53fb73a9acaef207d2d065860f062"
+dependencies = [
+ "imgref",
+]
+
 [[package]]
 name = "lsp"
 version = "0.1.0"
@@ -5661,12 +5810,6 @@ dependencies = [
  "regex-automata 0.1.10",
 ]
 
-[[package]]
-name = "matches"
-version = "0.1.10"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2532096657941c2fea9c289d370a250971c689d4f143798ff67113ec042024a5"
-
 [[package]]
 name = "matchit"
 version = "0.7.3"
@@ -5679,6 +5822,16 @@ version = "0.3.4"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "4facc753ae494aeb6e3c22f839b158aebd4f9270f55cd3c79906c45476c47ab4"
 
+[[package]]
+name = "maybe-rayon"
+version = "0.1.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "8ea1f30cedd69f0a2954655f7188c6a834246d2bcf1e315e2ac40c4b24dc9519"
+dependencies = [
+ "cfg-if",
+ "rayon",
+]
+
 [[package]]
 name = "md-5"
 version = "0.10.5"
@@ -5715,15 +5868,6 @@ dependencies = [
  "rustix 0.38.32",
 ]
 
-[[package]]
-name = "memmap2"
-version = "0.2.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "723e3ebdcdc5c023db1df315364573789f8857c11b631a2fdfad7c00f5c046b4"
-dependencies = [
- "libc",
-]
-
 [[package]]
 name = "memmap2"
 version = "0.8.0"
@@ -5742,15 +5886,6 @@ dependencies = [
  "libc",
 ]
 
-[[package]]
-name = "memoffset"
-version = "0.7.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5de893c32cde5f383baa4c04c5d6dbdd735cfd4a794b0debdb2bb1b421da5ff4"
-dependencies = [
- "autocfg",
-]
-
 [[package]]
 name = "memoffset"
 version = "0.9.0"
@@ -5804,25 +5939,6 @@ version = "0.2.1"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a"
 
-[[package]]
-name = "miniz_oxide"
-version = "0.3.7"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "791daaae1ed6889560f8c4359194f56648355540573244a5448a83ba1ecc7435"
-dependencies = [
- "adler32",
-]
-
-[[package]]
-name = "miniz_oxide"
-version = "0.4.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a92518e98c078586bc6c934028adcca4c92a53d6a958196de835170a01d84e4b"
-dependencies = [
- "adler",
- "autocfg",
-]
-
 [[package]]
 name = "miniz_oxide"
 version = "0.7.1"
@@ -5830,6 +5946,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "e7810e0be55b428ada41041c41f32c9f1a42817901b4ccf45fa3d4b6561e74c7"
 dependencies = [
  "adler",
+ "simd-adler32",
 ]
 
 [[package]]
@@ -5988,18 +6105,6 @@ dependencies = [
  "libc",
 ]
 
-[[package]]
-name = "nix"
-version = "0.26.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "598beaf3cc6fdd9a5dfb1630c2800c7acd31df7aaf0f565796fba2b53ca1af1b"
-dependencies = [
- "bitflags 1.3.2",
- "cfg-if",
- "libc",
- "memoffset 0.7.1",
-]
-
 [[package]]
 name = "nix"
 version = "0.27.1"
@@ -6009,7 +6114,7 @@ dependencies = [
  "bitflags 2.4.2",
  "cfg-if",
  "libc",
- "memoffset 0.9.0",
+ "memoffset",
 ]
 
 [[package]]
@@ -6039,6 +6144,12 @@ dependencies = [
  "minimal-lexical",
 ]
 
+[[package]]
+name = "noop_proc_macro"
+version = "0.3.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "0676bb32a98c1a483ce53e500a81ad9c3d5b3f7c920c28c24e9cb0980d0b5bc8"
+
 [[package]]
 name = "notifications"
 version = "0.1.0"
@@ -6104,7 +6215,7 @@ dependencies = [
  "num-complex",
  "num-integer",
  "num-iter",
- "num-rational 0.4.1",
+ "num-rational",
  "num-traits",
 ]
 
@@ -6175,31 +6286,31 @@ dependencies = [
 ]
 
 [[package]]
-name = "num-integer"
-version = "0.1.45"
+name = "num-derive"
+version = "0.4.2"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "225d3389fb3509a24c93f5c29eb6bde2586b98d9f016636dff58d7c6f7569cd9"
+checksum = "ed3955f1a9c7c0c15e092f9c887db08b1fc683305fdf6eb6684f22555355e202"
 dependencies = [
- "autocfg",
- "num-traits",
+ "proc-macro2",
+ "quote",
+ "syn 2.0.48",
 ]
 
 [[package]]
-name = "num-iter"
-version = "0.1.43"
+name = "num-integer"
+version = "0.1.45"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7d03e6c028c5dc5cac6e2dec0efda81fc887605bb3d884578bb6d6bf7514e252"
+checksum = "225d3389fb3509a24c93f5c29eb6bde2586b98d9f016636dff58d7c6f7569cd9"
 dependencies = [
  "autocfg",
- "num-integer",
  "num-traits",
 ]
 
-[[package]]
-name = "num-rational"
-version = "0.3.2"
+[[package]]
+name = "num-iter"
+version = "0.1.43"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "12ac428b1cb17fce6f731001d307d351ec70a6d202fc2e60f7d4c5e42d8f4f07"
+checksum = "7d03e6c028c5dc5cac6e2dec0efda81fc887605bb3d884578bb6d6bf7514e252"
 dependencies = [
  "autocfg",
  "num-integer",
@@ -6334,7 +6445,7 @@ dependencies = [
  "jni 0.20.0",
  "ndk",
  "ndk-context",
- "num-derive",
+ "num-derive 0.3.3",
  "num-traits",
  "oboe-sys",
 ]
@@ -6378,9 +6489,9 @@ dependencies = [
  "rand 0.8.5",
  "serde",
  "sha2 0.10.7",
- "zbus 4.0.1",
+ "zbus",
  "zeroize",
- "zvariant 4.0.2",
+ "zvariant",
 ]
 
 [[package]]
@@ -6391,9 +6502,9 @@ checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5"
 
 [[package]]
 name = "open"
-version = "5.0.1"
+version = "5.1.2"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "90878fb664448b54c4e592455ad02831e23a3f7e157374a8b95654731aac7349"
+checksum = "449f0ff855d85ddbf1edd5b646d65249ead3f5e422aaa86b7d2d0b049b103e32"
 dependencies = [
  "is-wsl",
  "libc",
@@ -6715,9 +6826,9 @@ dependencies = [
 
 [[package]]
 name = "percent-encoding"
-version = "2.3.0"
+version = "2.3.1"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9b2a4787296e9989611394c33f193f676704af1686e70b8f8033ab5ba9a35a94"
+checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e"
 
 [[package]]
 name = "petgraph"
@@ -6744,7 +6855,7 @@ version = "0.11.2"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "90fcb95eef784c2ac79119d1dd819e162b5da872ce6f3c3abe1e8ca1c082f72b"
 dependencies = [
- "siphasher 0.3.11",
+ "siphasher",
 ]
 
 [[package]]
@@ -6764,9 +6875,9 @@ dependencies = [
 
 [[package]]
 name = "pico-args"
-version = "0.4.2"
+version = "0.5.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "db8bcd96cb740d03149cbad5518db9fd87126a10ab519c011893b1754134c468"
+checksum = "5be167a7af36ee22fe3115051bc51f6e6c7054c9348e28deb4f49bd6f705a315"
 
 [[package]]
 name = "pin-project"
@@ -6864,14 +6975,15 @@ dependencies = [
 
 [[package]]
 name = "png"
-version = "0.16.8"
+version = "0.17.13"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3c3287920cb847dee3de33d301c463fba14dda99db24214ddf93f83d3021f4c6"
+checksum = "06e4b0d3d1312775e782c86c91a111aa1f910cbb65e1337f9975b5f9a554b5e1"
 dependencies = [
  "bitflags 1.3.2",
  "crc32fast",
- "deflate",
- "miniz_oxide 0.3.7",
+ "fdeflate",
+ "flate2",
+ "miniz_oxide",
 ]
 
 [[package]]
@@ -7261,6 +7373,21 @@ dependencies = [
  "unicase",
 ]
 
+[[package]]
+name = "qoi"
+version = "0.4.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "7f6d64c71eb498fe9eae14ce4ec935c555749aef511cca85b5568910d6e48001"
+dependencies = [
+ "bytemuck",
+]
+
+[[package]]
+name = "quick-error"
+version = "2.0.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "a993555f31e5a609f617c12db6250dedcac1b0a85076912c436e6fc9b2c8e6a3"
+
 [[package]]
 name = "quick-xml"
 version = "0.30.0"
@@ -7384,6 +7511,56 @@ version = "1.4.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "977b1e897f9d764566891689e642653e5ed90c6895106acd005eb4c1d0203991"
 
+[[package]]
+name = "rav1e"
+version = "0.7.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "cd87ce80a7665b1cce111f8a16c1f3929f6547ce91ade6addf4ec86a8dda5ce9"
+dependencies = [
+ "arbitrary",
+ "arg_enum_proc_macro",
+ "arrayvec",
+ "av1-grain",
+ "bitstream-io",
+ "built",
+ "cfg-if",
+ "interpolate_name",
+ "itertools 0.12.1",
+ "libc",
+ "libfuzzer-sys",
+ "log",
+ "maybe-rayon",
+ "new_debug_unreachable",
+ "noop_proc_macro",
+ "num-derive 0.4.2",
+ "num-traits",
+ "once_cell",
+ "paste",
+ "profiling",
+ "rand 0.8.5",
+ "rand_chacha 0.3.1",
+ "simd_helpers",
+ "system-deps",
+ "thiserror",
+ "v_frame",
+ "wasm-bindgen",
+]
+
+[[package]]
+name = "ravif"
+version = "0.11.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "bc13288f5ab39e6d7c9d501759712e6969fcc9734220846fc9ed26cae2cc4234"
+dependencies = [
+ "avif-serialize",
+ "imgref",
+ "loop9",
+ "quick-error",
+ "rav1e",
+ "rayon",
+ "rgb",
+]
+
 [[package]]
 name = "raw-window-handle"
 version = "0.5.2"
@@ -7428,12 +7605,6 @@ dependencies = [
  "crossbeam-utils",
 ]
 
-[[package]]
-name = "rctree"
-version = "0.3.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "be9e29cb19c8fe84169fcb07f8f11e66bc9e6e0280efd4715c54818296f8a4a8"
-
 [[package]]
 name = "read-fonts"
 version = "0.15.3"
@@ -7635,16 +7806,17 @@ dependencies = [
 
 [[package]]
 name = "resvg"
-version = "0.14.1"
+version = "0.40.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "09697862c5c3f940cbaffef91969c62188b5c8ed385b0aef43a5ff01ddc8000f"
+checksum = "024e40e1ba7313fc315b1720298988c0cd6f8bfe3754b52838aafecebd11355a"
 dependencies = [
+ "gif 0.12.0",
  "jpeg-decoder",
  "log",
  "pico-args",
  "png",
  "rgb",
- "svgfilters",
+ "svgtypes",
  "tiny-skia",
  "usvg",
 ]

crates/gpui/Cargo.toml 🔗

@@ -40,7 +40,7 @@ etagere = "0.2"
 futures.workspace = true
 font-kit = { git = "https://github.com/zed-industries/font-kit", rev = "5a5c4d4" }
 gpui_macros.workspace = true
-image = "0.23"
+image = "0.25"
 itertools.workspace = true
 lazy_static.workspace = true
 linkme = "0.3"
@@ -54,7 +54,7 @@ profiling.workspace = true
 rand.workspace = true
 raw-window-handle = "0.6"
 refineable.workspace = true
-resvg = "0.14"
+resvg = "0.40"
 schemars.workspace = true
 seahash = "4.1"
 serde.workspace = true
@@ -67,8 +67,6 @@ sum_tree.workspace = true
 taffy = { git = "https://github.com/DioxusLabs/taffy", rev = "1876f72bee5e376023eaa518aa7b8a34c769bd1b" }
 thiserror.workspace = true
 time.workspace = true
-tiny-skia = "0.5"
-usvg = { version = "0.14", features = [] }
 util.workspace = true
 uuid = { version = "1.1.2", features = ["v4", "v5"] }
 waker-fn = "1.1.0"
@@ -78,7 +76,7 @@ backtrace = "0.3"
 collections = { workspace = true, features = ["test-support"] }
 util = { workspace = true, features = ["test-support"] }
 
-[build-dependencies]
+[target.'cfg(target_os = "macos")'.build-dependencies]
 bindgen = "0.65.1"
 cbindgen = "0.26.0"
 
@@ -101,13 +99,15 @@ blade-graphics.workspace = true
 blade-macros.workspace = true
 blade-rwh.workspace = true
 bytemuck = "1"
-cosmic-text = "0.10.0"
+cosmic-text = "0.11.2"
 copypasta = "0.10.1"
 
 [target.'cfg(target_os = "linux")'.dependencies]
-open = "5.0.1"
-ashpd = "0.7.0"
-x11rb = { version = "0.13.0", features = ["allow-unsafe-code", "xkb", "randr"] }
+as-raw-xcb-connection = "1"
+ashpd = "0.8.0"
+calloop = "0.12.4"
+calloop-wayland-source = "0.2.0"
+wayland-backend = { version = "0.3.3", features = ["client_system"] }
 wayland-client = { version = "0.31.2" }
 wayland-cursor = "0.31.1"
 wayland-protocols = { version = "0.31.2", features = [
@@ -115,12 +115,10 @@ wayland-protocols = { version = "0.31.2", features = [
     "staging",
     "unstable",
 ] }
-wayland-backend = { version = "0.3.3", features = ["client_system"] }
-xkbcommon = { version = "0.7", features = ["wayland", "x11"] }
-as-raw-xcb-connection = "1"
-calloop = "0.12.4"
-calloop-wayland-source = "0.2.0"
 oo7 = "0.3.0"
+open = "5.1.2"
+x11rb = { version = "0.13.0", features = ["allow-unsafe-code", "xkb", "randr"] }
+xkbcommon = { version = "0.7", features = ["wayland", "x11"] }
 
 [target.'cfg(windows)'.dependencies]
 windows.workspace = true

crates/gpui/build.rs 🔗

@@ -1,186 +1,197 @@
 #![cfg_attr(any(not(target_os = "macos"), feature = "macos-blade"), allow(unused))]
 
-use std::{
-    env,
-    path::{Path, PathBuf},
-};
-
-use cbindgen::Config;
-
 //TODO: consider generating shader code for WGSL
 //TODO: deprecate "runtime-shaders" and "macos-blade"
 
 fn main() {
     #[cfg(target_os = "macos")]
-    generate_dispatch_bindings();
-    #[cfg(all(target_os = "macos", not(feature = "macos-blade")))]
-    let header_path = generate_shader_bindings();
-    #[cfg(all(target_os = "macos", not(feature = "macos-blade")))]
-    #[cfg(feature = "runtime_shaders")]
-    emit_stitched_shaders(&header_path);
-    #[cfg(all(target_os = "macos", not(feature = "macos-blade")))]
-    #[cfg(not(feature = "runtime_shaders"))]
-    compile_metal_shaders(&header_path);
+    macos::build();
 }
 
-fn generate_dispatch_bindings() {
-    println!("cargo:rustc-link-lib=framework=System");
-    println!("cargo:rerun-if-changed=src/platform/mac/dispatch.h");
-
-    let bindings = bindgen::Builder::default()
-        .header("src/platform/mac/dispatch.h")
-        .allowlist_var("_dispatch_main_q")
-        .allowlist_var("_dispatch_source_type_data_add")
-        .allowlist_var("DISPATCH_QUEUE_PRIORITY_DEFAULT")
-        .allowlist_var("DISPATCH_QUEUE_PRIORITY_HIGH")
-        .allowlist_var("DISPATCH_TIME_NOW")
-        .allowlist_function("dispatch_get_global_queue")
-        .allowlist_function("dispatch_async_f")
-        .allowlist_function("dispatch_after_f")
-        .allowlist_function("dispatch_time")
-        .allowlist_function("dispatch_source_merge_data")
-        .allowlist_function("dispatch_source_create")
-        .allowlist_function("dispatch_source_set_event_handler_f")
-        .allowlist_function("dispatch_resume")
-        .allowlist_function("dispatch_suspend")
-        .allowlist_function("dispatch_source_cancel")
-        .allowlist_function("dispatch_set_context")
-        .parse_callbacks(Box::new(bindgen::CargoCallbacks))
-        .layout_tests(false)
-        .generate()
-        .expect("unable to generate bindings");
-
-    let out_path = PathBuf::from(env::var("OUT_DIR").unwrap());
-    bindings
-        .write_to_file(out_path.join("dispatch_sys.rs"))
-        .expect("couldn't write dispatch bindings");
-}
-
-fn generate_shader_bindings() -> PathBuf {
-    let output_path = PathBuf::from(env::var("OUT_DIR").unwrap()).join("scene.h");
-    let crate_dir = PathBuf::from(env::var("CARGO_MANIFEST_DIR").unwrap());
-    let mut config = Config::default();
-    config.include_guard = Some("SCENE_H".into());
-    config.language = cbindgen::Language::C;
-    config.export.include.extend([
-        "Bounds".into(),
-        "Corners".into(),
-        "Edges".into(),
-        "Size".into(),
-        "Pixels".into(),
-        "PointF".into(),
-        "Hsla".into(),
-        "ContentMask".into(),
-        "Uniforms".into(),
-        "AtlasTile".into(),
-        "PathRasterizationInputIndex".into(),
-        "PathVertex_ScaledPixels".into(),
-        "ShadowInputIndex".into(),
-        "Shadow".into(),
-        "QuadInputIndex".into(),
-        "Underline".into(),
-        "UnderlineInputIndex".into(),
-        "Quad".into(),
-        "SpriteInputIndex".into(),
-        "MonochromeSprite".into(),
-        "PolychromeSprite".into(),
-        "PathSprite".into(),
-        "SurfaceInputIndex".into(),
-        "SurfaceBounds".into(),
-        "TransformationMatrix".into(),
-    ]);
-    config.no_includes = true;
-    config.enumeration.prefix_with_name = true;
-
-    let mut builder = cbindgen::Builder::new();
-
-    let src_paths = [
-        crate_dir.join("src/scene.rs"),
-        crate_dir.join("src/geometry.rs"),
-        crate_dir.join("src/color.rs"),
-        crate_dir.join("src/window.rs"),
-        crate_dir.join("src/platform.rs"),
-        crate_dir.join("src/platform/mac/metal_renderer.rs"),
-    ];
-    for src_path in src_paths {
-        println!("cargo:rerun-if-changed={}", src_path.display());
-        builder = builder.with_src(src_path);
+#[cfg(target_os = "macos")]
+mod macos {
+    use std::{
+        env,
+        path::{Path, PathBuf},
+    };
+
+    use cbindgen::Config;
+
+    pub(super) fn build() {
+        generate_dispatch_bindings();
+        #[cfg(not(feature = "macos-blade"))]
+        {
+            let header_path = generate_shader_bindings();
+
+            #[cfg(feature = "runtime_shaders")]
+            emit_stitched_shaders(&header_path);
+            #[cfg(not(feature = "runtime_shaders"))]
+            compile_metal_shaders(&header_path);
+        }
     }
 
-    builder
-        .with_config(config)
-        .generate()
-        .expect("Unable to generate bindings")
-        .write_to_file(&output_path);
-
-    output_path
-}
+    fn generate_dispatch_bindings() {
+        println!("cargo:rustc-link-lib=framework=System");
+        println!("cargo:rerun-if-changed=src/platform/mac/dispatch.h");
+
+        let bindings = bindgen::Builder::default()
+            .header("src/platform/mac/dispatch.h")
+            .allowlist_var("_dispatch_main_q")
+            .allowlist_var("_dispatch_source_type_data_add")
+            .allowlist_var("DISPATCH_QUEUE_PRIORITY_DEFAULT")
+            .allowlist_var("DISPATCH_QUEUE_PRIORITY_HIGH")
+            .allowlist_var("DISPATCH_TIME_NOW")
+            .allowlist_function("dispatch_get_global_queue")
+            .allowlist_function("dispatch_async_f")
+            .allowlist_function("dispatch_after_f")
+            .allowlist_function("dispatch_time")
+            .allowlist_function("dispatch_source_merge_data")
+            .allowlist_function("dispatch_source_create")
+            .allowlist_function("dispatch_source_set_event_handler_f")
+            .allowlist_function("dispatch_resume")
+            .allowlist_function("dispatch_suspend")
+            .allowlist_function("dispatch_source_cancel")
+            .allowlist_function("dispatch_set_context")
+            .parse_callbacks(Box::new(bindgen::CargoCallbacks))
+            .layout_tests(false)
+            .generate()
+            .expect("unable to generate bindings");
+
+        let out_path = PathBuf::from(env::var("OUT_DIR").unwrap());
+        bindings
+            .write_to_file(out_path.join("dispatch_sys.rs"))
+            .expect("couldn't write dispatch bindings");
+    }
 
-/// To enable runtime compilation, we need to "stitch" the shaders file with the generated header
-/// so that it is self-contained.
-#[cfg(feature = "runtime_shaders")]
-fn emit_stitched_shaders(header_path: &Path) {
-    use std::str::FromStr;
-    fn stitch_header(header: &Path, shader_path: &Path) -> std::io::Result<PathBuf> {
-        let header_contents = std::fs::read_to_string(header)?;
-        let shader_contents = std::fs::read_to_string(shader_path)?;
-        let stitched_contents = format!("{header_contents}\n{shader_contents}");
-        let out_path = PathBuf::from(env::var("OUT_DIR").unwrap()).join("stitched_shaders.metal");
-        std::fs::write(&out_path, stitched_contents)?;
-        Ok(out_path)
+    fn generate_shader_bindings() -> PathBuf {
+        let output_path = PathBuf::from(env::var("OUT_DIR").unwrap()).join("scene.h");
+        let crate_dir = PathBuf::from(env::var("CARGO_MANIFEST_DIR").unwrap());
+        let mut config = Config::default();
+        config.include_guard = Some("SCENE_H".into());
+        config.language = cbindgen::Language::C;
+        config.export.include.extend([
+            "Bounds".into(),
+            "Corners".into(),
+            "Edges".into(),
+            "Size".into(),
+            "Pixels".into(),
+            "PointF".into(),
+            "Hsla".into(),
+            "ContentMask".into(),
+            "Uniforms".into(),
+            "AtlasTile".into(),
+            "PathRasterizationInputIndex".into(),
+            "PathVertex_ScaledPixels".into(),
+            "ShadowInputIndex".into(),
+            "Shadow".into(),
+            "QuadInputIndex".into(),
+            "Underline".into(),
+            "UnderlineInputIndex".into(),
+            "Quad".into(),
+            "SpriteInputIndex".into(),
+            "MonochromeSprite".into(),
+            "PolychromeSprite".into(),
+            "PathSprite".into(),
+            "SurfaceInputIndex".into(),
+            "SurfaceBounds".into(),
+            "TransformationMatrix".into(),
+        ]);
+        config.no_includes = true;
+        config.enumeration.prefix_with_name = true;
+
+        let mut builder = cbindgen::Builder::new();
+
+        let src_paths = [
+            crate_dir.join("src/scene.rs"),
+            crate_dir.join("src/geometry.rs"),
+            crate_dir.join("src/color.rs"),
+            crate_dir.join("src/window.rs"),
+            crate_dir.join("src/platform.rs"),
+            crate_dir.join("src/platform/mac/metal_renderer.rs"),
+        ];
+        for src_path in src_paths {
+            println!("cargo:rerun-if-changed={}", src_path.display());
+            builder = builder.with_src(src_path);
+        }
+
+        builder
+            .with_config(config)
+            .generate()
+            .expect("Unable to generate bindings")
+            .write_to_file(&output_path);
+
+        output_path
     }
-    let shader_source_path = "./src/platform/mac/shaders.metal";
-    let shader_path = PathBuf::from_str(shader_source_path).unwrap();
-    stitch_header(header_path, &shader_path).unwrap();
-    println!("cargo:rerun-if-changed={}", &shader_source_path);
-}
-#[cfg(not(feature = "runtime_shaders"))]
-fn compile_metal_shaders(header_path: &Path) {
-    use std::process::{self, Command};
-    let shader_path = "./src/platform/mac/shaders.metal";
-    let air_output_path = PathBuf::from(env::var("OUT_DIR").unwrap()).join("shaders.air");
-    let metallib_output_path = PathBuf::from(env::var("OUT_DIR").unwrap()).join("shaders.metallib");
-    println!("cargo:rerun-if-changed={}", shader_path);
-
-    let output = Command::new("xcrun")
-        .args([
-            "-sdk",
-            "macosx",
-            "metal",
-            "-gline-tables-only",
-            "-mmacosx-version-min=10.15.7",
-            "-MO",
-            "-c",
-            shader_path,
-            "-include",
-            &header_path.to_str().unwrap(),
-            "-o",
-        ])
-        .arg(&air_output_path)
-        .output()
-        .unwrap();
-
-    if !output.status.success() {
-        eprintln!(
-            "metal shader compilation failed:\n{}",
-            String::from_utf8_lossy(&output.stderr)
-        );
-        process::exit(1);
+
+    /// To enable runtime compilation, we need to "stitch" the shaders file with the generated header
+    /// so that it is self-contained.
+    #[cfg(feature = "runtime_shaders")]
+    fn emit_stitched_shaders(header_path: &Path) {
+        use std::str::FromStr;
+        fn stitch_header(header: &Path, shader_path: &Path) -> std::io::Result<PathBuf> {
+            let header_contents = std::fs::read_to_string(header)?;
+            let shader_contents = std::fs::read_to_string(shader_path)?;
+            let stitched_contents = format!("{header_contents}\n{shader_contents}");
+            let out_path =
+                PathBuf::from(env::var("OUT_DIR").unwrap()).join("stitched_shaders.metal");
+            std::fs::write(&out_path, stitched_contents)?;
+            Ok(out_path)
+        }
+        let shader_source_path = "./src/platform/mac/shaders.metal";
+        let shader_path = PathBuf::from_str(shader_source_path).unwrap();
+        stitch_header(header_path, &shader_path).unwrap();
+        println!("cargo:rerun-if-changed={}", &shader_source_path);
     }
 
-    let output = Command::new("xcrun")
-        .args(["-sdk", "macosx", "metallib"])
-        .arg(air_output_path)
-        .arg("-o")
-        .arg(metallib_output_path)
-        .output()
-        .unwrap();
-
-    if !output.status.success() {
-        eprintln!(
-            "metallib compilation failed:\n{}",
-            String::from_utf8_lossy(&output.stderr)
-        );
-        process::exit(1);
+    #[cfg(not(feature = "runtime_shaders"))]
+    fn compile_metal_shaders(header_path: &Path) {
+        use std::process::{self, Command};
+        let shader_path = "./src/platform/mac/shaders.metal";
+        let air_output_path = PathBuf::from(env::var("OUT_DIR").unwrap()).join("shaders.air");
+        let metallib_output_path =
+            PathBuf::from(env::var("OUT_DIR").unwrap()).join("shaders.metallib");
+        println!("cargo:rerun-if-changed={}", shader_path);
+
+        let output = Command::new("xcrun")
+            .args([
+                "-sdk",
+                "macosx",
+                "metal",
+                "-gline-tables-only",
+                "-mmacosx-version-min=10.15.7",
+                "-MO",
+                "-c",
+                shader_path,
+                "-include",
+                &header_path.to_str().unwrap(),
+                "-o",
+            ])
+            .arg(&air_output_path)
+            .output()
+            .unwrap();
+
+        if !output.status.success() {
+            eprintln!(
+                "metal shader compilation failed:\n{}",
+                String::from_utf8_lossy(&output.stderr)
+            );
+            process::exit(1);
+        }
+
+        let output = Command::new("xcrun")
+            .args(["-sdk", "macosx", "metallib"])
+            .arg(air_output_path)
+            .arg("-o")
+            .arg(metallib_output_path)
+            .output()
+            .unwrap();
+
+        if !output.status.success() {
+            eprintln!(
+                "metallib compilation failed:\n{}",
+                String::from_utf8_lossy(&output.stderr)
+            );
+            process::exit(1);
+        }
     }
 }

crates/gpui/src/assets.rs 🔗

@@ -1,6 +1,6 @@
 use crate::{size, DevicePixels, Result, SharedString, Size};
 use anyhow::anyhow;
-use image::{Bgra, ImageBuffer};
+use image::RgbaImage;
 use std::{
     borrow::Cow,
     fmt,
@@ -38,12 +38,12 @@ pub struct ImageId(usize);
 pub struct ImageData {
     /// The ID associated with this image
     pub id: ImageId,
-    data: ImageBuffer<Bgra<u8>, Vec<u8>>,
+    data: RgbaImage,
 }
 
 impl ImageData {
     /// Create a new image from the given data.
-    pub fn new(data: ImageBuffer<Bgra<u8>, Vec<u8>>) -> Self {
+    pub fn new(data: RgbaImage) -> Self {
         static NEXT_ID: AtomicUsize = AtomicUsize::new(0);
 
         Self {

crates/gpui/src/image_cache.rs 🔗

@@ -91,7 +91,7 @@ impl ImageCache {
                             async move {
                                 match uri_or_path {
                                     UriOrPath::Path(uri) => {
-                                        let image = image::open(uri.as_ref())?.into_bgra8();
+                                        let image = image::open(uri.as_ref())?.into_rgba8();
                                         Ok(Arc::new(ImageData::new(image)))
                                     }
                                     UriOrPath::Uri(uri) => {
@@ -110,7 +110,7 @@ impl ImageCache {
                                         let format = image::guess_format(&body)?;
                                         let image =
                                             image::load_from_memory_with_format(&body, format)?
-                                                .into_bgra8();
+                                                .into_rgba8();
                                         Ok(Arc::new(ImageData::new(image)))
                                     }
                                 }

crates/gpui/src/platform/blade/blade_atlas.rs 🔗

@@ -159,7 +159,7 @@ impl BladeAtlasState {
                 usage = gpu::TextureUsage::COPY | gpu::TextureUsage::RESOURCE;
             }
             AtlasTextureKind::Polychrome => {
-                format = gpu::TextureFormat::Bgra8Unorm;
+                format = gpu::TextureFormat::Rgba8Unorm;
                 usage = gpu::TextureUsage::COPY | gpu::TextureUsage::RESOURCE;
             }
             AtlasTextureKind::Path => {

crates/gpui/src/platform/linux/text_system.rs 🔗

@@ -286,6 +286,7 @@ impl LinuxTextSystemState {
                     params.glyph_id.0 as u16,
                     (params.font_size * params.scale_factor).into(),
                     (0.0, 0.0),
+                    cosmic_text::CacheKeyFlags::empty(),
                 )
                 .0,
             )
@@ -319,6 +320,7 @@ impl LinuxTextSystemState {
                         params.glyph_id.0 as u16,
                         (params.font_size * params.scale_factor).into(),
                         (0.0, 0.0),
+                        cosmic_text::CacheKeyFlags::empty(),
                     )
                     .0,
                 )
@@ -381,6 +383,7 @@ impl LinuxTextSystemState {
             font_size.0,
             f32::MAX, // We do our own wrapping
             cosmic_text::Wrap::None,
+            None,
         );
         let mut runs = Vec::new();
 

crates/gpui/src/platform/mac/metal_atlas.rs 🔗

@@ -115,7 +115,7 @@ impl MetalAtlasState {
                 usage = metal::MTLTextureUsage::ShaderRead;
             }
             AtlasTextureKind::Polychrome => {
-                pixel_format = metal::MTLPixelFormat::BGRA8Unorm;
+                pixel_format = metal::MTLPixelFormat::RGBA8Unorm;
                 usage = metal::MTLTextureUsage::ShaderRead;
             }
             AtlasTextureKind::Path => {

crates/gpui/src/platform/mac/metal_renderer.rs 🔗

@@ -72,7 +72,7 @@ impl MetalRenderer {
 
         let layer = metal::MetalLayer::new();
         layer.set_device(&device);
-        layer.set_pixel_format(MTLPixelFormat::BGRA8Unorm);
+        layer.set_pixel_format(MTLPixelFormat::RGBA8Unorm);
         layer.set_opaque(true);
         layer.set_maximum_drawable_count(3);
         unsafe {
@@ -128,7 +128,7 @@ impl MetalRenderer {
             "path_sprites",
             "path_sprite_vertex",
             "path_sprite_fragment",
-            MTLPixelFormat::BGRA8Unorm,
+            MTLPixelFormat::RGBA8Unorm,
         );
         let shadows_pipeline_state = build_pipeline_state(
             &device,
@@ -136,7 +136,7 @@ impl MetalRenderer {
             "shadows",
             "shadow_vertex",
             "shadow_fragment",
-            MTLPixelFormat::BGRA8Unorm,
+            MTLPixelFormat::RGBA8Unorm,
         );
         let quads_pipeline_state = build_pipeline_state(
             &device,
@@ -144,7 +144,7 @@ impl MetalRenderer {
             "quads",
             "quad_vertex",
             "quad_fragment",
-            MTLPixelFormat::BGRA8Unorm,
+            MTLPixelFormat::RGBA8Unorm,
         );
         let underlines_pipeline_state = build_pipeline_state(
             &device,
@@ -152,7 +152,7 @@ impl MetalRenderer {
             "underlines",
             "underline_vertex",
             "underline_fragment",
-            MTLPixelFormat::BGRA8Unorm,
+            MTLPixelFormat::RGBA8Unorm,
         );
         let monochrome_sprites_pipeline_state = build_pipeline_state(
             &device,
@@ -160,7 +160,7 @@ impl MetalRenderer {
             "monochrome_sprites",
             "monochrome_sprite_vertex",
             "monochrome_sprite_fragment",
-            MTLPixelFormat::BGRA8Unorm,
+            MTLPixelFormat::RGBA8Unorm,
         );
         let polychrome_sprites_pipeline_state = build_pipeline_state(
             &device,
@@ -168,7 +168,7 @@ impl MetalRenderer {
             "polychrome_sprites",
             "polychrome_sprite_vertex",
             "polychrome_sprite_fragment",
-            MTLPixelFormat::BGRA8Unorm,
+            MTLPixelFormat::RGBA8Unorm,
         );
         let surfaces_pipeline_state = build_pipeline_state(
             &device,
@@ -176,7 +176,7 @@ impl MetalRenderer {
             "surfaces",
             "surface_vertex",
             "surface_fragment",
-            MTLPixelFormat::BGRA8Unorm,
+            MTLPixelFormat::RGBA8Unorm,
         );
 
         let command_queue = device.new_command_queue();

crates/gpui/src/platform/mac/text_system.rs 🔗

@@ -425,9 +425,8 @@ impl MacTextSystemState {
                 );
 
             if params.is_emoji {
-                // Convert from RGBA with premultiplied alpha to BGRA with straight alpha.
+                // Convert from RGBA with premultiplied alpha to RGBA with straight alpha.
                 for pixel in bytes.chunks_exact_mut(4) {
-                    pixel.swap(0, 2);
                     let a = pixel[3] as f32 / 255.;
                     pixel[0] = (pixel[0] as f32 / a) as u8;
                     pixel[1] = (pixel[1] as f32 / a) as u8;

crates/gpui/src/platform/windows/text_system.rs 🔗

@@ -213,11 +213,19 @@ impl WindowsTextSystemState {
         _features: FontFeatures,
     ) -> Result<SmallVec<[FontId; 4]>> {
         let mut font_ids = SmallVec::new();
-        let family = self
+        let families = self
             .font_system
-            .get_font_matches(Attrs::new().family(cosmic_text::Family::Name(name)));
-        for font in family.as_ref() {
-            let font = self.font_system.get_font(*font).unwrap();
+            .db()
+            .faces()
+            .filter(|face| face.families.iter().any(|family| *name == family.0))
+            .map(|face| (face.id, face.post_script_name.clone()))
+            .collect::<SmallVec<[_; 4]>>();
+
+        for (font_id, postscript_name) in families {
+            let font = self
+                .font_system
+                .get_font(font_id)
+                .ok_or_else(|| anyhow!("Could not load font"))?;
             // TODO: figure out why this is causing fluent icons from loading
             // if font.as_swash().charmap().map('m') == 0 {
             //     self.font_system.db_mut().remove_face(font.id());
@@ -227,6 +235,8 @@ impl WindowsTextSystemState {
             let font_id = FontId(self.fonts.len());
             font_ids.push(font_id);
             self.fonts.push(font);
+            self.postscript_names_by_font_id
+                .insert(font_id, postscript_name);
         }
         Ok(font_ids)
     }
@@ -274,6 +284,7 @@ impl WindowsTextSystemState {
                     params.glyph_id.0 as u16,
                     (params.font_size * params.scale_factor).into(),
                     (0.0, 0.0),
+                    cosmic_text::CacheKeyFlags::empty(),
                 )
                 .0,
             )
@@ -307,6 +318,7 @@ impl WindowsTextSystemState {
                         params.glyph_id.0 as u16,
                         (params.font_size * params.scale_factor).into(),
                         (0.0, 0.0),
+                        cosmic_text::CacheKeyFlags::empty(),
                     )
                     .0,
                 )
@@ -342,6 +354,7 @@ impl WindowsTextSystemState {
             font_size.0,
             f32::MAX, // todo(windows) we don't have a width cause this should technically not be wrapped I believe
             cosmic_text::Wrap::None,
+            None,
         );
         let mut runs = Vec::new();
         // todo(windows) what I think can happen is layout returns possibly multiple lines which means we should be probably working with it higher up in the text rendering

crates/gpui/src/svg_renderer.rs 🔗

@@ -1,6 +1,9 @@
 use crate::{AssetSource, DevicePixels, IsZero, Result, SharedString, Size};
 use anyhow::anyhow;
-use std::{hash::Hash, sync::Arc};
+use std::{
+    hash::Hash,
+    sync::{Arc, OnceLock},
+};
 
 #[derive(Clone, PartialEq, Hash, Eq)]
 pub(crate) struct RenderSvgParams {
@@ -24,15 +27,19 @@ impl SvgRenderer {
 
         // Load the tree.
         let bytes = self.asset_source.load(&params.path)?;
-        let tree = usvg::Tree::from_data(&bytes, &usvg::Options::default())?;
+        let tree =
+            resvg::usvg::Tree::from_data(&bytes, &resvg::usvg::Options::default(), svg_fontdb())?;
 
         // Render the SVG to a pixmap with the specified width and height.
         let mut pixmap =
-            tiny_skia::Pixmap::new(params.size.width.into(), params.size.height.into()).unwrap();
+            resvg::tiny_skia::Pixmap::new(params.size.width.into(), params.size.height.into())
+                .unwrap();
+
+        let ratio = params.size.width.0 as f32 / tree.size().width();
         resvg::render(
             &tree,
-            usvg::FitTo::Width(params.size.width.into()),
-            pixmap.as_mut(),
+            resvg::tiny_skia::Transform::from_scale(ratio, ratio),
+            &mut pixmap.as_mut(),
         );
 
         // Convert the pixmap's pixels into an alpha mask.
@@ -44,3 +51,13 @@ impl SvgRenderer {
         Ok(alpha_mask)
     }
 }
+
+/// Returns the global font database used for SVG rendering.
+fn svg_fontdb() -> &'static resvg::usvg::fontdb::Database {
+    static FONTDB: OnceLock<resvg::usvg::fontdb::Database> = OnceLock::new();
+    FONTDB.get_or_init(|| {
+        let mut fontdb = resvg::usvg::fontdb::Database::new();
+        fontdb.load_system_fonts();
+        fontdb
+    })
+}

crates/media/src/media.rs 🔗

@@ -36,7 +36,7 @@ pub mod core_video {
 
     use super::*;
     pub use crate::bindings::{
-        kCVPixelFormatType_32BGRA, kCVPixelFormatType_420YpCbCr8BiPlanarFullRange,
+        kCVPixelFormatType_420YpCbCr8BiPlanarFullRange,
         kCVPixelFormatType_420YpCbCr8BiPlanarVideoRange, kCVPixelFormatType_420YpCbCr8Planar,
     };
     use crate::bindings::{kCVReturnSuccess, CVReturn, OSType};