buffers: update threaded implementations
This commit is contained in:
parent
3783bc60b2
commit
30ed741349
@ -85,7 +85,8 @@ impl Default for BoundSurface<Arc<Mutex<ShaderBinding>>> {
|
|||||||
Self {
|
Self {
|
||||||
binding: Arc::new(Mutex::new(ShaderBinding {
|
binding: Arc::new(Mutex::new(ShaderBinding {
|
||||||
shader: None,
|
shader: None,
|
||||||
rect: Rectangle::everything()
|
rect: Rectangle::everything(),
|
||||||
|
opacity: 255
|
||||||
})),
|
})),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -96,7 +97,6 @@ impl Surface for BoundSurface<Arc<Mutex<ShaderBinding>>> {
|
|||||||
fn rect(&self) -> Rectangle<u8, Virtual> {
|
fn rect(&self) -> Rectangle<u8, Virtual> {
|
||||||
let r = self.binding.lock().unwrap();
|
let r = self.binding.lock().unwrap();
|
||||||
r.rect.clone()
|
r.rect.clone()
|
||||||
//self.binding.lock().unwrap().rect.clone()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fn with_shader<F: FnMut(&dyn Shader)>(&self, mut f: F) {
|
fn with_shader<F: FnMut(&dyn Shader)>(&self, mut f: F) {
|
||||||
@ -112,6 +112,18 @@ impl Surface for BoundSurface<Arc<Mutex<ShaderBinding>>> {
|
|||||||
fn clear_shader(&mut self) {
|
fn clear_shader(&mut self) {
|
||||||
self.binding.lock().unwrap().shader = None;
|
self.binding.lock().unwrap().shader = None;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn set_rect(&mut self, rect: &Rectangle<u8, Virtual>) {
|
||||||
|
self.binding.lock().unwrap().rect = rect.clone();
|
||||||
|
}
|
||||||
|
|
||||||
|
fn opacity(&self) -> u8 {
|
||||||
|
self.binding.lock().unwrap().opacity
|
||||||
|
}
|
||||||
|
|
||||||
|
fn set_opacity(&mut self, opacity: u8) {
|
||||||
|
self.binding.lock().unwrap().opacity = opacity
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(feature="threads")]
|
#[cfg(feature="threads")]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user