Use Wayland subsurfaces, dmabuf screencopy
More efficient than shm screencopy, and rendering an iced image into the window. Done right, should espeically help with multiple GPUs, but more testing and work is needed there. Removes mmapping of dmabuf, which errored... I guess not allocated with right options for that. Relevant only if we want a fallback/test that involves reading dmabufs. Using `OnDamage` doesn't seem to work correctly currently. Likely a compositor issue.
This commit is contained in:
parent
1bfcd50383
commit
78b7bfe957
4 changed files with 79 additions and 50 deletions
|
|
@ -14,6 +14,7 @@ use cosmic::{
|
|||
Border,
|
||||
},
|
||||
iced_core::Shadow,
|
||||
iced_sctk::subsurface_widget::Subsurface,
|
||||
widget,
|
||||
};
|
||||
use cosmic_comp_config::workspace::WorkspaceLayout;
|
||||
|
|
@ -284,7 +285,7 @@ fn toplevel_previews<'a>(
|
|||
|
||||
fn capture_image(image: Option<&CaptureImage>) -> cosmic::Element<'_, Msg> {
|
||||
if let Some(image) = image {
|
||||
widget::Image::new(image.img.clone()).into()
|
||||
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