mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-09-17 07:18:04 +08:00
Add missing send / sync impls and make rasterize node async
This commit is contained in:
@@ -180,6 +180,14 @@ impl std::fmt::Debug for EdgeHandle {
|
||||
}
|
||||
}
|
||||
|
||||
// SAFETY: wasm is single threaded, so the marker-free payload never actually crosses a thread;
|
||||
// mirrors the old NodeContainer assertion that let the executor live in a sync static.
|
||||
#[cfg(target_family = "wasm")]
|
||||
unsafe impl Send for EdgeHandle {}
|
||||
// SAFETY: as in Send.
|
||||
#[cfg(target_family = "wasm")]
|
||||
unsafe impl Sync for EdgeHandle {}
|
||||
|
||||
impl EdgeHandle {
|
||||
pub fn new<T: 'static>(node: std::sync::Arc<ErasedGNode<T>>) -> Self {
|
||||
Self::new_erased(node, edge_type::<T>())
|
||||
|
||||
@@ -194,7 +194,7 @@ fn create_canvas(_: impl Ctx) -> CanvasHandle {
|
||||
/// Renders a view of the input graphic within an area defined by the *Footprint*.
|
||||
#[cfg(target_family = "wasm")]
|
||||
#[node_macro::node(category(""))]
|
||||
fn rasterize<T: WasmNotSend + Clone>(
|
||||
async fn rasterize<T: WasmNotSend + Clone>(
|
||||
_: impl Ctx,
|
||||
#[implementations(
|
||||
List<Vector>,
|
||||
|
||||
Reference in New Issue
Block a user