diff --git a/src/backend/egl/context.rs b/src/backend/egl/context.rs index 085af1a..f9883ea 100644 --- a/src/backend/egl/context.rs +++ b/src/backend/egl/context.rs @@ -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 { + &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 { + &self.display.dmabuf_import_formats + } } impl Drop for EGLContext {