mirror of
https://github.com/slint-ui/slint.git
synced 2025-08-04 02:39:28 +00:00
bump soft-buffer to 0.2 (#2038)
This commit is contained in:
parent
d7e903214c
commit
ed67f3aabb
3 changed files with 5 additions and 8 deletions
|
@ -90,7 +90,3 @@ panic = "abort"
|
|||
|
||||
[profile.dev]
|
||||
panic = "abort"
|
||||
|
||||
[patch.crates-io]
|
||||
# Pull in fix for https://github.com/john01dav/softbuffer/issues/22
|
||||
softbuffer = { git = "https://github.com/slint-ui/softbuffer", branch = "simon/macos-scale-fix" }
|
||||
|
|
|
@ -61,7 +61,7 @@ rgb = { version = "0.8.27", optional = true }
|
|||
i-slint-renderer-skia = { version = "=0.3.4", path = "../../renderers/skia", optional = true }
|
||||
|
||||
# For the software renderer
|
||||
softbuffer = { version = "0.1.1", optional = true }
|
||||
softbuffer = { version = "0.2.0", optional = true }
|
||||
|
||||
[target.'cfg(target_arch = "wasm32")'.dependencies]
|
||||
web-sys = { version = "0.3", features=["console", "WebGlContextAttributes", "CanvasRenderingContext2d", "HtmlInputElement", "HtmlCanvasElement", "Window", "Document", "CssStyleDeclaration", "Event", "KeyboardEvent", "InputEvent", "CompositionEvent"] }
|
||||
|
|
|
@ -12,7 +12,7 @@ use std::rc::{Rc, Weak};
|
|||
|
||||
pub struct WinitSoftwareRenderer<const MAX_BUFFER_AGE: usize> {
|
||||
renderer: SoftwareRenderer<MAX_BUFFER_AGE>,
|
||||
canvas: RefCell<Option<softbuffer::GraphicsContext<Rc<winit::window::Window>>>>,
|
||||
canvas: RefCell<Option<softbuffer::GraphicsContext>>,
|
||||
}
|
||||
|
||||
impl<const MAX_BUFFER_AGE: usize> super::WinitCompatibleRenderer
|
||||
|
@ -28,8 +28,9 @@ impl<const MAX_BUFFER_AGE: usize> super::WinitCompatibleRenderer
|
|||
}
|
||||
|
||||
fn show(&self, window: &Rc<winit::window::Window>) {
|
||||
*self.canvas.borrow_mut() =
|
||||
Some(unsafe { softbuffer::GraphicsContext::new(window.clone()).unwrap() });
|
||||
*self.canvas.borrow_mut() = Some(unsafe {
|
||||
softbuffer::GraphicsContext::new(window.as_ref(), window.as_ref()).unwrap()
|
||||
});
|
||||
}
|
||||
|
||||
fn hide(&self) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue