Add a no-subsurfaces feature for debugging
This commit is contained in:
parent
1fc416bb2e
commit
bf2cd273f9
5 changed files with 24 additions and 3 deletions
|
|
@ -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()
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue