egl: expose supported dmabuf formats
This commit is contained in:
parent
7cdafcca34
commit
b6822becf6
|
@ -1,8 +1,10 @@
|
|||
//! EGL context related structs
|
||||
use std::collections::HashSet;
|
||||
use std::os::raw::c_int;
|
||||
use std::sync::atomic::Ordering;
|
||||
|
||||
use super::{ffi, wrap_egl_call, Error, MakeCurrentError};
|
||||
use crate::backend::allocator::Format as DrmFormat;
|
||||
use crate::backend::egl::display::{EGLDisplay, PixelFormat};
|
||||
use crate::backend::egl::EGLSurface;
|
||||
|
||||
|
@ -227,6 +229,16 @@ impl EGLContext {
|
|||
}
|
||||
Ok(())
|
||||
}
|
||||
|
||||
/// Returns a list of formats for dmabufs that can be rendered to
|
||||
pub fn dmabuf_render_formats(&self) -> &HashSet<DrmFormat> {
|
||||
&self.display.dmabuf_render_formats
|
||||
}
|
||||
|
||||
/// Returns a list of formats for dmabufs that can be used as textures
|
||||
pub fn dmabuf_texture_formats(&self) -> &HashSet<DrmFormat> {
|
||||
&self.display.dmabuf_import_formats
|
||||
}
|
||||
}
|
||||
|
||||
impl Drop for EGLContext {
|
||||
|
|
Loading…
Reference in New Issue