1
0
mirror of https://github.com/emilk/egui.git synced 2026-09-03 07:10:04 -04:00

egui_inspection: PNG-encode screenshots on the wire; collapse protocol feature

- FrameScreenshot now carries PNG bytes instead of raw RGBA (PROTOCOL_VERSION 1→2);
  add a shared `encode_png` helper behind a new `png` feature so the live plugin and the
  kittest harness encode frames identically.
- Make the protocol module unconditional: drop the `protocol` feature flag and the
  optional serde/serde_bytes/rmp-serde deps it gated.
- plugin.rs: re-stamp screenshot-bearing frames with the current step (so inspectors
  waiting for step > prev don't reject them) and pump a tail-side repaint while awaiting
  the GPU readback.
This commit is contained in:
lucasmerlin
2026-05-26 16:20:07 +02:00
parent d67862ace6
commit 72389ed5a8
5 changed files with 75 additions and 22 deletions

View File

@@ -21,27 +21,27 @@ all-features = true
rustdoc-args = ["--generate-link-to-definition"]
[features]
default = ["protocol"]
## Wire-protocol types (`HarnessMessage`, `InspectorCommand`, …) plus length-prefixed
## MessagePack framing helpers. No `egui` dependency beyond `egui::accesskit`.
protocol = ["dep:rmp-serde", "dep:serde", "dep:serde_bytes", "egui/serde"]
default = []
## Cross-platform local-socket name helpers ([`transport::socket_name`],
## [`transport::generate_socket_target`]) built on `interprocess`: unix domain sockets on
## unix, named pipes on Windows. Shared by both ends of the connection.
transport = ["dep:interprocess", "dep:tempfile"]
## [`encode_png`] — shared screenshot PNG encoder so every peer (live plugin + kittest
## harness) produces identically-encoded frames.
png = ["dep:image", "image/png"]
## `InspectionPlugin` — an `egui::Plugin` impl that streams frames + accesskit tree to
## an inspector over a local socket and applies received commands. Auto-attaches when
## the [`INSPECTION_SOCKET_ENV_VAR`] env var is set.
plugin = ["protocol", "transport", "dep:image"]
plugin = ["transport", "png"]
[dependencies]
egui.workspace = true
serde = { workspace = true, optional = true }
serde_bytes = { version = "0.11.17", optional = true }
rmp-serde = { workspace = true, optional = true }
egui = { workspace = true, features = ["serde"] }
serde.workspace = true
serde_bytes = "0.11.17"
rmp-serde.workspace = true
image = { workspace = true, optional = true }
interprocess = { version = "2.4", optional = true }
tempfile = { workspace = true, optional = true }