#![cfg(target_os = "linux")]
#![cfg(feature = "opengl")]
macro_rules! function {
() => {{
fn f() {}
fn type_name_of<T>(_: T) -> &'static str {
std::any::type_name::<T>()
}
let name = type_name_of(f);
match &name[..name.len() - 3].rfind(':') {
Some(pos) => &name[pos + 1..name.len() - 3],
None => &name[..name.len() - 3],
}
}};
}
mod cache;
mod context;
mod dma_import;
mod processor;
mod resources;
mod shaders;
mod tests;
mod threaded;
pub use context::probe_egl_displays;
pub use threaded::GLProcessorThreaded;
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
pub enum EglDisplayKind {
Gbm,
PlatformDevice,
Default,
}
impl std::fmt::Display for EglDisplayKind {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match self {
EglDisplayKind::Gbm => write!(f, "GBM"),
EglDisplayKind::PlatformDevice => write!(f, "PlatformDevice"),
EglDisplayKind::Default => write!(f, "Default"),
}
}
}
#[derive(Debug, Clone)]
pub struct EglDisplayInfo {
pub kind: EglDisplayKind,
pub description: String,
}
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub(crate) enum TransferBackend {
DmaBuf,
Pbo,
Sync,
}
impl TransferBackend {
pub(crate) fn is_dma(self) -> bool {
self == TransferBackend::DmaBuf
}
}
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum Int8InterpolationMode {
Nearest,
Bilinear,
TwoPass,
}
#[derive(Debug, Clone, Copy)]
pub(super) struct RegionOfInterest {
pub(super) left: f32,
pub(super) top: f32,
pub(super) right: f32,
pub(super) bottom: f32,
}