1
0
Fork 0
forked from wry/wry

wl-shm: add support for more formats

This commit is contained in:
Julian Orth 2025-10-01 20:31:00 +02:00
parent 09a56edd47
commit 0570669af2
20 changed files with 114 additions and 81 deletions

View file

@ -53,10 +53,9 @@ impl WlShmPoolRequestHandler for WlShmPool {
fn create_buffer(&self, req: CreateBuffer, _slf: &Rc<Self>) -> Result<(), Self::Error> {
let drm_format = map_wayland_format_id(req.format);
let format = match formats().get(&drm_format) {
Some(f) if f.shm_info.is_some() => *f,
_ => return Err(WlShmPoolError::InvalidFormat(req.format)),
};
let format = formats()
.get(&drm_format)
.ok_or(WlShmPoolError::InvalidFormat(req.format))?;
if req.height < 0 || req.width < 0 || req.stride < 0 || req.offset < 0 {
return Err(WlShmPoolError::NegativeParameters);
}