Checkpoint

This commit is contained in:
Antonio Scandurra
2023-10-03 18:04:45 +02:00
parent dc40ac854a
commit bfa211fb02
8 changed files with 13 additions and 58 deletions
+1 -24
View File
@@ -1,4 +1,3 @@
use bytemuck::{Pod, Zeroable};
use core::fmt::Debug;
use derive_more::{Add, AddAssign, Div, Mul, Sub, SubAssign};
use refineable::Refineable;
@@ -102,9 +101,6 @@ impl<T: Clone + Debug> Clone for Point<T> {
}
}
unsafe impl<T: Clone + Debug + Zeroable + Pod> Zeroable for Point<T> {}
unsafe impl<T: Clone + Debug + Zeroable + Pod> Pod for Point<T> {}
#[derive(Refineable, Default, Clone, Copy, Debug, PartialEq, Div, Hash)]
#[refineable(debug)]
#[repr(C)]
@@ -113,9 +109,6 @@ pub struct Size<T: Clone + Debug> {
pub height: T,
}
unsafe impl<T: Clone + Debug + Zeroable + Pod> Zeroable for Size<T> {}
unsafe impl<T: Clone + Debug + Zeroable + Pod> Pod for Size<T> {}
pub fn size<T: Clone + Debug>(width: T, height: T) -> Size<T> {
Size { width, height }
}
@@ -214,9 +207,6 @@ pub struct Bounds<T: Clone + Debug> {
pub size: Size<T>,
}
unsafe impl<T: Clone + Debug + Zeroable + Pod> Zeroable for Bounds<T> {}
unsafe impl<T: Clone + Debug + Zeroable + Pod> Pod for Bounds<T> {}
// Bounds<f32> * Pixels = Bounds<Pixels>
impl<T, Rhs> Mul<Rhs> for Bounds<T>
where
@@ -323,10 +313,6 @@ impl<T: Clone + Debug + Mul<S, Output = T>, S: Clone> MulAssign<S> for Edges<T>
impl<T: Clone + Debug + Copy> Copy for Edges<T> {}
unsafe impl<T: Clone + Debug + Zeroable + Pod> Zeroable for Edges<T> {}
unsafe impl<T: Clone + Debug + Zeroable + Pod> Pod for Edges<T> {}
impl<T: Clone + Debug> Edges<T> {
pub fn map<U: Clone + Debug, F: Fn(&T) -> U>(&self, f: F) -> Edges<U> {
Edges {
@@ -441,13 +427,7 @@ impl<T: Clone + Debug + Mul<S, Output = T>, S: Clone> MulAssign<S> for Corners<T
impl<T: Clone + Debug + Copy> Copy for Corners<T> {}
unsafe impl<T: Clone + Debug + Zeroable + Pod> Zeroable for Corners<T> {}
unsafe impl<T: Clone + Debug + Zeroable + Pod> Pod for Corners<T> {}
#[derive(
Clone, Copy, Default, Add, AddAssign, Sub, SubAssign, Div, PartialEq, PartialOrd, Zeroable, Pod,
)]
#[derive(Clone, Copy, Default, Add, AddAssign, Sub, SubAssign, Div, PartialEq, PartialOrd)]
#[repr(transparent)]
pub struct Pixels(pub(crate) f32);
@@ -570,9 +550,6 @@ impl DevicePixels {
}
}
unsafe impl bytemuck::Pod for DevicePixels {}
unsafe impl bytemuck::Zeroable for DevicePixels {}
impl From<DevicePixels> for u32 {
fn from(device_pixels: DevicePixels) -> Self {
device_pixels.0