wl-shm: add support for more formats
This commit is contained in:
parent
09a56edd47
commit
0570669af2
20 changed files with 114 additions and 81 deletions
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue