mirror of
https://github.com/emilk/egui.git
synced 2026-09-01 06:10:06 -04:00
egui_kittest: PNG-encode inspector screenshots via shared egui_inspection::encode_png
- Encode harness frames with egui_inspection::encode_png instead of sending raw RGBA, so the inspector socket carries compressed bytes. - Features: pull egui_inspection/png + image/png for the encoder; drop the now-removed egui_inspection `protocol` feature.
This commit is contained in:
@@ -396,14 +396,28 @@ impl Connection {
|
||||
return;
|
||||
}
|
||||
self.step = self.step.saturating_add(1);
|
||||
let screenshot = image.and_then(|img| match egui_inspection::encode_png(
|
||||
img.width(),
|
||||
img.height(),
|
||||
img.as_raw(),
|
||||
) {
|
||||
Ok(png) => Some(FrameScreenshot {
|
||||
width: img.width(),
|
||||
height: img.height(),
|
||||
png,
|
||||
}),
|
||||
Err(err) => {
|
||||
#[expect(clippy::print_stderr)]
|
||||
{
|
||||
eprintln!("[kittest] PNG encode failed: {err}");
|
||||
}
|
||||
None
|
||||
}
|
||||
});
|
||||
let frame = Frame {
|
||||
step: self.step,
|
||||
pixels_per_point,
|
||||
screenshot: image.map(|img| FrameScreenshot {
|
||||
width: img.width(),
|
||||
height: img.height(),
|
||||
rgba: img.as_raw().clone(),
|
||||
}),
|
||||
screenshot,
|
||||
accesskit,
|
||||
source,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user