Improve macOS/iOS/Web thread safety
Co-authored-by: daxpedda <daxpedda@gmail.com>
This commit is contained in:
parent
119462795a
commit
af6c343d0e
20 changed files with 552 additions and 724 deletions
|
|
@ -31,7 +31,7 @@ use crate::event::Event;
|
|||
use crate::event_loop::ControlFlow;
|
||||
use crate::event_loop::EventLoop;
|
||||
use crate::event_loop::EventLoopWindowTarget;
|
||||
use crate::window::WindowBuilder;
|
||||
use crate::window::{Window, WindowBuilder};
|
||||
|
||||
use web_sys::HtmlCanvasElement;
|
||||
|
||||
|
|
@ -40,6 +40,13 @@ pub trait WindowExtWebSys {
|
|||
fn canvas(&self) -> Option<HtmlCanvasElement>;
|
||||
}
|
||||
|
||||
impl WindowExtWebSys for Window {
|
||||
#[inline]
|
||||
fn canvas(&self) -> Option<HtmlCanvasElement> {
|
||||
self.window.canvas()
|
||||
}
|
||||
}
|
||||
|
||||
pub trait WindowBuilderExtWebSys {
|
||||
/// Pass an [`HtmlCanvasElement`] to be used for this [`Window`](crate::window::Window). If
|
||||
/// [`None`], [`WindowBuilder::build()`] will create one.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue