render: force surfaces to implement default+clone, for now
This commit is contained in:
@@ -35,7 +35,7 @@ impl<T: RgbColor> AsMilliwatts for T {
|
||||
pub struct EmbeddedDisplay<T, S>
|
||||
where
|
||||
T: DrawTarget,
|
||||
S: Surface + Default + Clone {
|
||||
S: Surface {
|
||||
surfaces : SurfacePool<S>,
|
||||
target: T,
|
||||
total_mw: u32,
|
||||
@@ -45,7 +45,7 @@ S: Surface + Default + Clone {
|
||||
fps_display: Periodically
|
||||
}
|
||||
|
||||
impl<T: LedPixelShape, S: Surface + Default + Clone> Task for EmbeddedDisplay<Ws2812DrawTarget<'_, T>, S> {
|
||||
impl<T: LedPixelShape, S: Surface> Task for EmbeddedDisplay<Ws2812DrawTarget<'_, T>, S> {
|
||||
fn start(&mut self) {
|
||||
self.target.set_brightness(0);
|
||||
}
|
||||
@@ -62,7 +62,7 @@ impl<T: LedPixelShape, S: Surface + Default + Clone> Task for EmbeddedDisplay<Ws
|
||||
impl<T, S> EmbeddedDisplay<T, S>
|
||||
where
|
||||
T: DrawTarget,
|
||||
S: Surface + Default + Clone {
|
||||
S: Surface {
|
||||
pub fn new(target: T, max_mw: u32) -> Self {
|
||||
EmbeddedDisplay {
|
||||
surfaces: SurfacePool::new(),
|
||||
@@ -79,13 +79,13 @@ S: Surface + Default + Clone {
|
||||
impl<T, S> Surfaces<S> for EmbeddedDisplay<T, S>
|
||||
where
|
||||
T: DrawTarget,
|
||||
S: Surface + Default + Clone {
|
||||
S: Surface {
|
||||
fn new_surface(&mut self) -> Result<S, io::Error> {
|
||||
self.surfaces.new_surface()
|
||||
}
|
||||
}
|
||||
|
||||
impl<T: LedPixelShape, S: Surface + Default + Clone> Display<S> for EmbeddedDisplay<Ws2812DrawTarget<'_, T>, S> {
|
||||
impl<T: LedPixelShape, S: Surface> Display<S> for EmbeddedDisplay<Ws2812DrawTarget<'_, T>, S> {
|
||||
|
||||
fn start_frame(&mut self) {
|
||||
self.total_mw = 0;
|
||||
|
Reference in New Issue
Block a user