mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2025-09-02 11:17:20 +00:00
Upgrade several Rust dependencies (#1613)
`specta` from Hypercube's fork commit to latest upstream commit `wasm-bindgen` 0.2.87 -> 0.2.91 `spirv-std` from 0.9 to not-yet-merged commit in https://github.com/EmbarkStudios/rust-gpu/pull/1115 `wgpu` 0.17 -> 0.19 `winit` 0.28.6 -> 0.29 `vello` and `vello_svg` from latest upstream commit to not-yet-merged commit in https://github.com/linebender/vello/pull/427 `resvg` 0.36.0 -> 0.39 `glam` 0.24 -> 0.25 `rustybuzz` 0.8.0 -> 0.10.0 `js-sys` and `web-sys` 0.3.55 -> 0.3.67 `usvg` 0.36.0 -> 0.39 `spirv` 0.2.0 -> 0.3 * Update a couple of dependencies * More test fixing… * Use upstream Specta instead of fork * Update comments in Cargo.toml --------- Co-authored-by: Keavon Chambers <keavon@keavon.com>
This commit is contained in:
parent
80bffd39bf
commit
6f6fb3bcd4
20 changed files with 879 additions and 893 deletions
|
@ -141,9 +141,9 @@ impl ApplicationIo for WasmApplicationIo {
|
|||
use winit::platform::wayland::EventLoopBuilderExtWayland;
|
||||
|
||||
#[cfg(feature = "wayland")]
|
||||
let event_loop = winit::event_loop::EventLoopBuilder::new().with_any_thread(true).build();
|
||||
let event_loop = winit::event_loop::EventLoopBuilder::new().with_any_thread(true).build().unwrap();
|
||||
#[cfg(not(feature = "wayland"))]
|
||||
let event_loop = winit::event_loop::EventLoop::new();
|
||||
let event_loop = winit::event_loop::EventLoop::new().unwrap();
|
||||
let window = winit::window::WindowBuilder::new()
|
||||
.with_title("Graphite")
|
||||
.with_inner_size(winit::dpi::PhysicalSize::new(800, 600))
|
||||
|
@ -336,11 +336,9 @@ fn render_canvas(
|
|||
if let Some(exec) = editor.application_io.gpu_executor() {
|
||||
todo!()
|
||||
} else {
|
||||
let rtree = resvg::Tree::from_usvg(&usvg_tree);
|
||||
|
||||
let pixmap_size = rtree.size.to_int_size();
|
||||
let pixmap_size = usvg_tree.size.to_int_size();
|
||||
let mut pixmap = resvg::tiny_skia::Pixmap::new(pixmap_size.width(), pixmap_size.height()).unwrap();
|
||||
rtree.render(resvg::tiny_skia::Transform::default(), &mut pixmap.as_mut());
|
||||
resvg::render(&usvg_tree, resvg::tiny_skia::Transform::default(), &mut pixmap.as_mut());
|
||||
let array: Clamped<&[u8]> = Clamped(pixmap.data());
|
||||
let context = canvas.get_context("2d").unwrap().unwrap().dyn_into::<CanvasRenderingContext2d>().unwrap();
|
||||
let image_data = web_sys::ImageData::new_with_u8_clamped_array_and_sh(array, pixmap_size.width(), pixmap_size.height()).expect("Failed to construct ImageData");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue