Add a no-subsurfaces feature for debugging

This commit is contained in:
Ian Douglas Scott 2024-04-01 15:13:51 -07:00
parent 1fc416bb2e
commit bf2cd273f9
5 changed files with 24 additions and 3 deletions

View file

@ -284,7 +284,14 @@ fn toplevel_previews<'a>(
fn capture_image(image: Option<&CaptureImage>) -> cosmic::Element<'_, Msg> {
if let Some(image) = image {
Subsurface::new(image.width, image.height, &image.wl_buffer).into()
#[cfg(feature = "no-subsurfaces")]
{
widget::Image::new(image.image.clone()).into()
}
#[cfg(not(feature = "no-subsurfaces"))]
{
Subsurface::new(image.width, image.height, &image.wl_buffer).into()
}
} else {
widget::Image::new(widget::image::Handle::from_pixels(1, 1, vec![0, 0, 0, 255])).into()
}