1
0
Fork 0
forked from wry/wry

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:
mahkoh 2025-04-05 17:59:26 +02:00 committed by GitHub
commit fbefc45253
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 16 additions and 0 deletions

View file

@ -795,6 +795,10 @@ pub trait GfxContext: Debug {
fn supports_color_management(&self) -> bool { fn supports_color_management(&self) -> bool {
false false
} }
fn supports_invalid_modifier(&self) -> bool {
false
}
} }
#[derive(Clone, Debug)] #[derive(Clone, Debug)]

View file

@ -347,4 +347,8 @@ impl GfxContext for GlRenderContext {
) -> Result<Rc<dyn GfxBlendBuffer>, GfxError> { ) -> Result<Rc<dyn GfxBlendBuffer>, GfxError> {
Err(GfxError(Box::new(RenderError::NoBlendBuffer))) Err(GfxError(Box::new(RenderError::NoBlendBuffer)))
} }
fn supports_invalid_modifier(&self) -> bool {
true
}
} }

View file

@ -6,6 +6,7 @@ use {
ifs::wl_buffer::WlBuffer, ifs::wl_buffer::WlBuffer,
leaks::Tracker, leaks::Tracker,
object::{Object, Version}, object::{Object, Version},
state::State,
video::{ video::{
INVALID_MODIFIER, INVALID_MODIFIER,
dmabuf::{DmaBuf, DmaBufPlane, PlaneVec}, dmabuf::{DmaBuf, DmaBufPlane, PlaneVec},
@ -62,6 +63,13 @@ impl Global for WlDrmGlobal {
fn version(&self) -> u32 { fn version(&self) -> u32 {
2 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); simple_add_global!(WlDrmGlobal);