Merge pull request #419 from mahkoh/jorth/wl-drm-only-opengl
wl_drm: hide global if invalid modifier is not supported
This commit is contained in:
commit
fbefc45253
3 changed files with 16 additions and 0 deletions
|
|
@ -795,6 +795,10 @@ pub trait GfxContext: Debug {
|
|||
fn supports_color_management(&self) -> bool {
|
||||
false
|
||||
}
|
||||
|
||||
fn supports_invalid_modifier(&self) -> bool {
|
||||
false
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug)]
|
||||
|
|
|
|||
|
|
@ -347,4 +347,8 @@ impl GfxContext for GlRenderContext {
|
|||
) -> Result<Rc<dyn GfxBlendBuffer>, GfxError> {
|
||||
Err(GfxError(Box::new(RenderError::NoBlendBuffer)))
|
||||
}
|
||||
|
||||
fn supports_invalid_modifier(&self) -> bool {
|
||||
true
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ use {
|
|||
ifs::wl_buffer::WlBuffer,
|
||||
leaks::Tracker,
|
||||
object::{Object, Version},
|
||||
state::State,
|
||||
video::{
|
||||
INVALID_MODIFIER,
|
||||
dmabuf::{DmaBuf, DmaBufPlane, PlaneVec},
|
||||
|
|
@ -62,6 +63,13 @@ impl Global for WlDrmGlobal {
|
|||
fn version(&self) -> u32 {
|
||||
2
|
||||
}
|
||||
|
||||
fn exposed(&self, state: &State) -> bool {
|
||||
let Some(ctx) = state.render_ctx.get() else {
|
||||
return false;
|
||||
};
|
||||
ctx.supports_invalid_modifier()
|
||||
}
|
||||
}
|
||||
|
||||
simple_add_global!(WlDrmGlobal);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue