screencopy: Fix copying to opaque shm formats
This commit is contained in:
parent
cf9ae91e96
commit
35766a372b
1 changed files with 2 additions and 1 deletions
|
|
@ -12,7 +12,7 @@ use cosmic_protocols::screencopy::v1::server::zcosmic_screencopy_session_v1::{
|
||||||
};
|
};
|
||||||
use smithay::{
|
use smithay::{
|
||||||
backend::{
|
backend::{
|
||||||
allocator::dmabuf::Dmabuf,
|
allocator::{dmabuf::Dmabuf, format::get_transparent},
|
||||||
drm::DrmNode,
|
drm::DrmNode,
|
||||||
egl::EGLDevice,
|
egl::EGLDevice,
|
||||||
renderer::{
|
renderer::{
|
||||||
|
|
@ -565,6 +565,7 @@ where
|
||||||
// ensure consistency, the SHM handler of smithay should ensure this
|
// ensure consistency, the SHM handler of smithay should ensure this
|
||||||
assert!((offset + (height - 1) * stride + width * pixelsize) as usize <= len);
|
assert!((offset + (height - 1) * stride + width * pixelsize) as usize <= len);
|
||||||
|
|
||||||
|
let format = get_transparent(format).unwrap_or(format);
|
||||||
let mapping = renderer
|
let mapping = renderer
|
||||||
.copy_framebuffer(Rectangle::from_loc_and_size((0, 0), buffer_size), format)?;
|
.copy_framebuffer(Rectangle::from_loc_and_size((0, 0), buffer_size), format)?;
|
||||||
let gl_data = renderer.map_texture(&mapping)?;
|
let gl_data = renderer.map_texture(&mapping)?;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue