pub mod color;
#[allow(clippy::module_inception)] mod draw;
mod draw_rounded;
mod draw_shared;
use crate::cast::Cast;
#[allow(unused)] use crate::theme::DrawMgr;
pub use draw::{Draw, DrawIface, DrawImpl};
pub use draw_rounded::{DrawRounded, DrawRoundedImpl};
pub use draw_shared::{AllocError, ImageFormat, ImageHandle, ImageId};
pub use draw_shared::{DrawShared, DrawSharedImpl, SharedState};
use std::time::Instant;
#[cfg_attr(not(feature = "internal_doc"), doc(hidden))]
#[cfg_attr(doc_cfg, doc(cfg(internal_doc)))]
#[derive(Copy, Clone, Debug, Hash, PartialEq, Eq, PartialOrd, Ord)]
pub enum AnimationState {
None,
Animate,
Timed(Instant),
}
impl AnimationState {
pub fn merge_in(&mut self, rhs: AnimationState) {
use AnimationState::*;
*self = match (*self, rhs) {
(Animate, _) | (_, Animate) => Animate,
(Timed(t1), Timed(t2)) => Timed(t1.min(t2)),
(Timed(t), _) | (_, Timed(t)) => Timed(t),
(None, None) => None,
}
}
}
#[derive(Copy, Clone)]
pub struct PassId(u32);
impl PassId {
#[cfg_attr(not(feature = "internal_doc"), doc(hidden))]
#[cfg_attr(doc_cfg, doc(cfg(internal_doc)))]
#[inline]
pub const fn new(n: u32) -> Self {
PassId(n)
}
#[inline]
pub fn pass(self) -> usize {
self.0.cast()
}
#[inline]
pub fn depth(self) -> f32 {
0.0
}
}
#[derive(Copy, Clone, Debug, PartialEq, Eq, Ord, PartialOrd, Hash)]
pub enum PassType {
Clip,
Overlay,
}