1
0
Fork 0
forked from wry/wry

metal: use IN_FORMATS plane property

This commit is contained in:
Julian Orth 2023-10-29 16:58:16 +01:00
parent d022d96fbf
commit e0ed29038e
9 changed files with 183 additions and 87 deletions

View file

@ -7,7 +7,6 @@ use {
video::{
drm::DrmError,
gbm::{GbmBo, GbmError, GBM_BO_USE_LINEAR, GBM_BO_USE_RENDERING},
ModifiedFormat, INVALID_MODIFIER,
},
},
std::{ops::Deref, rc::Rc},
@ -43,15 +42,12 @@ pub fn take_screenshot(state: &State) -> Result<Screenshot, ScreenshooterError>
if extents.is_empty() {
return Err(ScreenshooterError::EmptyDisplay);
}
let format = ModifiedFormat {
format: XRGB8888,
modifier: INVALID_MODIFIER,
};
let gbm = ctx.gbm();
let bo = gbm.create_bo(
extents.width(),
extents.height(),
&format,
XRGB8888,
&[],
GBM_BO_USE_RENDERING | GBM_BO_USE_LINEAR,
)?;
let fb = ctx.clone().dmabuf_fb(bo.dmabuf())?;