egl: expose supported dmabuf formats
//! 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 {
