From 98755c16957dde3247f7bdd2d7908b2632a2a3f8 Mon Sep 17 00:00:00 2001 From: Ian Douglas Scott Date: Tue, 3 Oct 2023 18:48:31 -0700 Subject: [PATCH] Update `smithay-egui`, `egui`, `puffin` --- Cargo.lock | 162 +++++++++++++++++++++++++++++---------- Cargo.toml | 11 +-- src/debug.rs | 6 +- src/shell/element/mod.rs | 2 +- 4 files changed, 130 insertions(+), 51 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 6b68af60..11a80e70 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -18,6 +18,16 @@ version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c71b1793ee61086797f5c80b6efa2b8ffa6d5dd703f118545808a7f2e27f7046" +[[package]] +name = "accesskit" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "76eb1adf08c5bcaa8490b9851fd53cca27fa9880076f178ea9d29f05196728a8" +dependencies = [ + "enumn", + "serde", +] + [[package]] name = "addr2line" version = "0.21.0" @@ -52,6 +62,7 @@ checksum = "2c99f64d1e06488f620f932677e24bc6e2897582980441ae90a671415bd7ec2f" dependencies = [ "cfg-if", "once_cell", + "serde", "version_check", ] @@ -187,12 +198,6 @@ version = "4.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b9441c6b2fe128a7c2bf680a44c34d0df31ce09e5b7e401fcca3faa483dbc921" -[[package]] -name = "atomic_refcell" -version = "0.1.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76f2bfe491d41d45507b8431da8274f7feeca64a49e86d980eed2937ec2ff020" - [[package]] name = "atomicwrites" version = "0.4.1" @@ -523,6 +528,7 @@ dependencies = [ "cosmic-protocols", "edid-rs", "egui", + "egui_plot", "glow", "i18n-embed", "i18n-embed-fl", @@ -537,7 +543,7 @@ dependencies = [ "once_cell", "ordered-float", "png", - "puffin 0.14.3", + "puffin", "puffin_egui", "regex", "renderdoc", @@ -941,11 +947,12 @@ checksum = "3a4f1c0468062a56cd5705f1e3b5409eb286d5596a2028ec8e947595d7e715ae" [[package]] name = "ecolor" -version = "0.22.0" +version = "0.23.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e479a7fa3f23d4e794f8b2f8b3568dd4e47886ad1b12c9c095e141cb591eb63" +checksum = "cfdf4e52dbbb615cfd30cf5a5265335c217b5fd8d669593cea74a517d9c605af" dependencies = [ "bytemuck", + "serde", ] [[package]] @@ -956,22 +963,27 @@ checksum = "2ab5fa33485cd85ac354df485819a63360fefa312fe04cffe65e6f175be1522c" [[package]] name = "egui" -version = "0.22.0" +version = "0.23.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3aef8ec3ae1b772f340170c65bf27d5b8c28f543a0116c844d2ac08d01123e7" +checksum = "8bd69fed5fcf4fbb8225b24e80ea6193b61e17a625db105ef0c4d71dde6eb8b7" dependencies = [ + "accesskit", "ahash 0.8.3", "epaint", "nohash-hasher", + "serde", ] [[package]] name = "egui_extras" -version = "0.22.0" +version = "0.23.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9278f4337b526f0d57e5375e5a7340a311fa6ee8f9fcc75721ac50af13face02" +checksum = "68ffe3fe5c00295f91c2a61a74ee271c32f74049c94ba0b1cea8f26eb478bc07" dependencies = [ "egui", + "enum-map", + "log", + "mime_guess", "resvg 0.28.0", "serde", "tiny-skia 0.8.4", @@ -980,9 +992,9 @@ dependencies = [ [[package]] name = "egui_glow" -version = "0.22.0" +version = "0.23.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f8c2752cdf1b0ef5fcda59a898cacabad974d4f5880e92a420b2c917022da64" +checksum = "ce6726c08798822280038bbad2e32f4fc3cbed800cd51c6e34e99cd2d60cc1bc" dependencies = [ "bytemuck", "egui", @@ -993,6 +1005,15 @@ dependencies = [ "web-sys", ] +[[package]] +name = "egui_plot" +version = "0.23.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c7f33a00fe8eb1ba56535b3dbacdecc7a1365a328908a97c5f3c81bb466be72b" +dependencies = [ + "egui", +] + [[package]] name = "either" version = "1.9.0" @@ -1001,11 +1022,12 @@ checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" [[package]] name = "emath" -version = "0.22.0" +version = "0.23.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3857d743a6e0741cdd60b622a74c7a36ea75f5f8f11b793b41d905d2c9721a4b" +checksum = "1ef2b29de53074e575c18b694167ccbe6e5191f7b25fe65175a0d905a32eeec0" dependencies = [ "bytemuck", + "serde", ] [[package]] @@ -1072,20 +1094,52 @@ version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a246d82be1c9d791c5dfde9a2bd045fc3cbba3fa2b11ad558f27d01712f00569" +[[package]] +name = "enum-map" +version = "2.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c188012f8542dee7b3996e44dd89461d64aa471b0a7c71a1ae2f595d259e96e5" +dependencies = [ + "enum-map-derive", + "serde", +] + +[[package]] +name = "enum-map-derive" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "04d0b288e3bb1d861c4403c1774a6f7a798781dfc519b3647df2a3dd4ae95f25" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.37", +] + +[[package]] +name = "enumn" +version = "0.1.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c2ad8cef1d801a4686bfd8919f0b30eac4c8e48968c437a6405ded4fb5272d2b" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.37", +] + [[package]] name = "epaint" -version = "0.22.0" +version = "0.23.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09333964d4d57f40a85338ba3ca5ed4716070ab184dcfed966b35491c5c64f3b" +checksum = "58067b840d009143934d91d8dcb8ded054d8301d7c11a517ace0a99bb1e1595e" dependencies = [ "ab_glyph", "ahash 0.8.3", - "atomic_refcell", "bytemuck", "ecolor", "emath", "nohash-hasher", "parking_lot 0.12.1", + "serde", ] [[package]] @@ -2453,9 +2507,9 @@ dependencies = [ [[package]] name = "lz4_flex" -version = "0.10.0" +version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b8c72594ac26bfd34f2d99dfced2edfaddfe8a476e3ff2ca0eb293d925c4f83" +checksum = "3ea9b256699eda7b0387ffbc776dd625e28bde3918446381781245b7a50349d8" [[package]] name = "malloc_buf" @@ -2558,6 +2612,22 @@ dependencies = [ "objc", ] +[[package]] +name = "mime" +version = "0.3.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" + +[[package]] +name = "mime_guess" +version = "2.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4192263c238a5f0d0c6bfd21f336a313a4ce1c450542449ca191bb657b4642ef" +dependencies = [ + "mime", + "unicase", +] + [[package]] name = "minimal-lexical" version = "0.2.1" @@ -3300,26 +3370,14 @@ dependencies = [ [[package]] name = "puffin" -version = "0.14.3" +version = "0.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7b2c7a01f569fb03e2ff1f5376537f294001447bd23ce75ca51054fcd223fe4" -dependencies = [ - "byteorder", - "instant", - "once_cell", -] - -[[package]] -name = "puffin" -version = "0.16.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76425abd4e1a0ad4bd6995dd974b52f414fca9974171df8e3708b3e660d05a21" +checksum = "39009d69b9d547c3ffa974a20648fa02f447c05bd0a664012b1ba5a5b06fb14e" dependencies = [ "anyhow", "bincode", "byteorder", "cfg-if", - "instant", "lz4_flex", "once_cell", "parking_lot 0.12.1", @@ -3328,18 +3386,18 @@ dependencies = [ [[package]] name = "puffin_egui" -version = "0.22.0" +version = "0.23.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00f0ef87ac588ec9a979ea4952042134ff047407436aa6859ba9e061f55ca55d" +checksum = "c5af236782d21bdd5a6eb2f8cc9a91f8d601c073b7f7d568c95c26604cc12b87" dependencies = [ "egui", "indexmap 1.9.3", - "instant", "natord", "once_cell", - "puffin 0.16.0", + "puffin", "time", "vec1", + "web-time", ] [[package]] @@ -3956,7 +4014,7 @@ dependencies = [ [[package]] name = "smithay-egui" version = "0.1.0" -source = "git+https://github.com/Smithay/smithay-egui.git?rev=114d8db6#114d8db655094f89a3e9821dcc74bd8eb2e26406" +source = "git+https://github.com/Smithay/smithay-egui.git?rev=cdc652e0#cdc652e0d4823b16a5bd9badd288e38512789dc5" dependencies = [ "cgmath", "egui", @@ -3966,7 +4024,7 @@ dependencies = [ "log", "memoffset 0.9.0", "smithay", - "xkbcommon 0.6.0", + "xkbcommon 0.7.0", ] [[package]] @@ -4498,6 +4556,15 @@ dependencies = [ "tinystr", ] +[[package]] +name = "unicase" +version = "2.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f7d2d4dafb69621809a81864c9c1b864479e1235c0dd4e199924b9742439ed89" +dependencies = [ + "version_check", +] + [[package]] name = "unicode-bidi" version = "0.3.13" @@ -5028,6 +5095,17 @@ dependencies = [ "wasm-bindgen", ] +[[package]] +name = "web-time" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19353897b48e2c4d849a2d73cb0aeb16dc2be4e00c565abfc11eb65a806e47de" +dependencies = [ + "js-sys", + "once_cell", + "wasm-bindgen", +] + [[package]] name = "weezl" version = "0.1.7" diff --git a/Cargo.toml b/Cargo.toml index 75570489..33ba6330 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -18,7 +18,8 @@ calloop = { version = "0.12.2", features = ["executor"] } serde = { version = "1", features = ["derive"] } serde_json = "1" sendfd = "0.4.1" -egui = { version = "0.22.0", optional = true } +egui = { version = "0.23.0", optional = true } +egui_plot = { version = "0.23.0", optional = true } renderdoc = { version = "0.11.0", optional = true } edid-rs = { version = "0.1" } png = "0.17.5" @@ -45,8 +46,8 @@ glow = "0.12.0" tracing-subscriber = { version = "0.3.16", features = ["env-filter", "tracing-log"] } tracing-journald = "0.3.0" tracing = { version = "0.1.37", features = ["max_level_debug", "release_max_level_info"] } -puffin = { version = "0.14.3", optional = true } -puffin_egui = { version = "0.22.0", optional = true } +puffin = { version = "0.17.0", optional = true } +puffin_egui = { version = "0.23.0", optional = true } keyframe = "1.1.1" once_cell = "1.18.0" i18n-embed = { version = "0.14", features = ["fluent-system", "desktop-requester"] } @@ -66,14 +67,14 @@ features = ["backend_drm", "backend_gbm", "backend_egl", "backend_libinput", "ba [dependencies.smithay-egui] git = "https://github.com/Smithay/smithay-egui.git" -rev = "114d8db6" +rev = "cdc652e0" features = ["svg"] optional = true [features] default = ["systemd"] systemd = ["libsystemd"] -debug = ["egui", "smithay-egui", "renderdoc", "puffin", "puffin_egui", "anyhow/backtrace"] +debug = ["egui", "egui_plot", "smithay-egui", "renderdoc", "puffin", "puffin_egui", "anyhow/backtrace"] [profile.dev] lto = "thin" diff --git a/src/debug.rs b/src/debug.rs index 8f222689..2ff571d0 100644 --- a/src/debug.rs +++ b/src/debug.rs @@ -9,7 +9,7 @@ use crate::{ }, state::{Common, Fps}, }; -use egui::{Color32, Vec2}; +use egui::{load::SizedTexture, Color32, Vec2}; use smithay::{ backend::{ drm::DrmNode, @@ -62,7 +62,7 @@ pub fn fps_ui( area: Rectangle, scale: f64, ) -> Result, GlesError> { - use egui::widgets::plot::{Bar, BarChart, Legend, Plot}; + use egui_plot::{Bar, BarChart, Legend, Plot}; let (max, min, avg, avg_fps) = ( fps.max_frametime().as_secs_f64(), @@ -176,7 +176,7 @@ pub fn fps_ui( { let factor = resp.rect.height() / size.y; size = Vec2::from([size.x * factor, resp.rect.height()]); - ui.image(*texture_id, size); + ui.image(SizedTexture::new(*texture_id, size)); } } }); diff --git a/src/shell/element/mod.rs b/src/shell/element/mod.rs index 95eea64d..12157b2a 100644 --- a/src/shell/element/mod.rs +++ b/src/shell/element/mod.rs @@ -65,7 +65,7 @@ pub mod stack_hover; pub mod swap_indicator; #[cfg(feature = "debug")] -use egui::plot::{Corner, Legend, Plot, PlotPoints, Polygon}; +use egui_plot::{Corner, Legend, Plot, PlotPoints, Polygon}; #[cfg(feature = "debug")] use smithay::backend::renderer::{element::texture::TextureRenderElement, gles::GlesTexture}; #[cfg(feature = "debug")]