render: remove getters from Surface, reimplement buffer sharing with Send+Sync

This commit is contained in:
2024-12-02 19:36:17 +01:00
parent f789f6ded9
commit 6cafdcfa45
5 changed files with 247 additions and 114 deletions

View File

@@ -1,4 +1,3 @@
use std::io;
use rgb::Rgb;
use crate::geometry::*;
@@ -35,13 +34,10 @@ pub trait Surfaces: Send + Sync {
}
pub trait Surface: Send + Sync {
fn with_shader<F: FnMut(&dyn Shader)>(&self, f: F);
fn set_shader(&mut self, shader: Box<dyn Shader>);
fn clear_shader(&mut self);
fn rect(&self) -> Rectangle<Virtual>;
fn set_rect(&mut self, rect: &Rectangle<Virtual>);
fn opacity(&self) -> u8;
fn set_opacity(&mut self, opacity: u8);
}