wayland: add support for NV12 format
This commit is contained in:
parent
95327685c1
commit
97e8d487a0
15 changed files with 182 additions and 119 deletions
|
|
@ -44,10 +44,12 @@ impl WlShmGlobal {
|
|||
track!(client, obj);
|
||||
client.add_client_obj(&obj)?;
|
||||
for format in FORMATS {
|
||||
client.event(Format {
|
||||
self_id: id,
|
||||
format: format.wl_id.unwrap_or(format.drm),
|
||||
});
|
||||
if format.shm_supported {
|
||||
client.event(Format {
|
||||
self_id: id,
|
||||
format: format.wl_id.unwrap_or(format.drm),
|
||||
});
|
||||
}
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
|
|
|
|||
|
|
@ -45,7 +45,7 @@ impl WlShmPool {
|
|||
let req: CreateBuffer = self.client.parse(self, parser)?;
|
||||
let drm_format = map_wayland_format_id(req.format);
|
||||
let format = match formats().get(&drm_format) {
|
||||
Some(f) => *f,
|
||||
Some(f) if f.shm_supported => *f,
|
||||
_ => return Err(WlShmPoolError::InvalidFormat(req.format)),
|
||||
};
|
||||
if req.height < 0 || req.width < 0 || req.stride < 0 || req.offset < 0 {
|
||||
|
|
|
|||
|
|
@ -38,9 +38,15 @@ impl ZwpLinuxDmabufV1Global {
|
|||
if let Some(ctx) = client.state.render_ctx.get() {
|
||||
let formats = ctx.formats();
|
||||
for format in formats.values() {
|
||||
if format.implicit_external_only && !ctx.supports_external_texture() {
|
||||
continue;
|
||||
}
|
||||
obj.send_format(format.format.drm);
|
||||
if version >= MODIFIERS_SINCE_VERSION {
|
||||
for modifier in format.modifiers.values() {
|
||||
if modifier.external_only && !ctx.supports_external_texture() {
|
||||
continue;
|
||||
}
|
||||
obj.send_modifier(format.format.drm, modifier.modifier);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue