diff --git a/src/platform/smart_leds_lib.rs b/src/platform/smart_leds_lib.rs index dac190f..e2c8bde 100644 --- a/src/platform/smart_leds_lib.rs +++ b/src/platform/smart_leds_lib.rs @@ -73,7 +73,7 @@ impl, T: FastWrite> Output for StrideOutput { } } -pub trait FastWrite { +pub trait FastWrite: Send { type Target: SmartLedsWrite; type Color: HardwarePixel; type Error; diff --git a/src/render.rs b/src/render.rs index 4faa060..9d9b0d3 100644 --- a/src/render.rs +++ b/src/render.rs @@ -23,18 +23,17 @@ pub trait Sample { fn sample(&mut self, rect: &Rectangle) -> impl PixelView; } - -pub trait Shader: Send + Debug { +pub trait Shader: Send + Sync { fn draw(&self, surface_coords: &VirtualCoordinates, frame: usize) -> Rgb; } -pub trait Surfaces: Debug { +pub trait Surfaces: Send + Sync { type Surface: Surface; fn new_surface(&mut self, area: &Rectangle) -> Result; fn render_to(&self, output: &mut S, frame: usize); } -pub trait Surface: Default + Clone + Debug { +pub trait Surface: Send + Sync { fn with_shader(&self, f: F); fn set_shader(&mut self, shader: Box); fn clear_shader(&mut self); @@ -45,7 +44,7 @@ pub trait Surface: Default + Clone + Debug { fn set_opacity(&mut self, opacity: u8); } -pub trait Output: Sample { +pub trait Output: Sample + Send { fn blank(&mut self); fn commit(&mut self); } @@ -71,7 +70,7 @@ impl Renderer { } } -impl Task for Renderer { +impl Task for Renderer { fn name(&self) -> &'static str { "Renderer" } fn tick(&mut self) {