egl: expose supported dmabuf formats

This commit is contained in:
Victor Brekenfeld 2021-05-13 23:35:14 +02:00 committed by Victor Berger
parent 7cdafcca34
commit b6822becf6
1 changed files with 12 additions and 0 deletions

View File

@ -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 {