use super::*;
use crate::dpi::{PhysicalPosition, PhysicalSize};
use std::fmt::{Debug, Formatter};
#[non_exhaustive]
#[derive(Debug, Copy, Clone)]
pub enum DamageArea<'a> {
FullWindow,
Rect(DamageRect),
Rects(&'a [DamageRect]),
}
#[derive(Copy, Clone, PartialEq, Eq)]
#[repr(transparent)]
pub struct DamageRect {
inner: platform::DamageRect,
}
impl DamageRect {
#[inline]
pub fn position(&self) -> PhysicalPosition<u32> {
self.inner.position()
}
#[inline]
pub fn size(&self) -> PhysicalSize<u32> {
self.inner.size()
}
}
impl From<platform::DamageRect> for DamageRect {
#[inline]
fn from(value: platform::DamageRect) -> Self {
DamageRect { inner: value }
}
}
impl Debug for DamageRect {
#[inline]
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
self.inner.fmt(f)
}
}