From 00e5f59d9cb15a921e15c450b4ee9fa7718e9d2a Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Thu, 9 Oct 2025 09:36:43 +0200 Subject: [PATCH] Skia: Update to latest release of Rust Skia bindings (#9663) For details, see https://github.com/rust-skia/rust-skia/releases/tag/0.89.0 --- Cargo.toml | 2 ++ internal/backends/winit/Cargo.toml | 2 +- internal/renderers/skia/Cargo.toml | 26 ++++++++++++++++--------- internal/renderers/skia/itemrenderer.rs | 2 +- 4 files changed, 21 insertions(+), 11 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 2ead2bc0c..bc8ddd1cb 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -174,6 +174,8 @@ wgpu-27 = { package = "wgpu", version = "27", default-features = false } input = { version = "0.9.0", default-features = false } tr = { version = "0.1", default-features = false } fontique = { version = "0.6.0" } +windows = { version = "0.62" } +windows-core = { version = "0.62.0" } [profile.release] lto = true diff --git a/internal/backends/winit/Cargo.toml b/internal/backends/winit/Cargo.toml index 817ba0672..5e9599c62 100644 --- a/internal/backends/winit/Cargo.toml +++ b/internal/backends/winit/Cargo.toml @@ -125,7 +125,7 @@ objc2-app-kit = { version = "0.3.2" } i-slint-renderer-skia = { workspace = true, features = ["default"] } [target.'cfg(target_os = "windows")'.dependencies] -windows = { version = "0.61.1", features = ["Win32_UI_WindowsAndMessaging"] } +windows = { workspace = true, features = ["Win32_UI_WindowsAndMessaging"] } [build-dependencies] cfg_aliases = { workspace = true } diff --git a/internal/renderers/skia/Cargo.toml b/internal/renderers/skia/Cargo.toml index 9f32a6b1a..15fdee3c6 100644 --- a/internal/renderers/skia/Cargo.toml +++ b/internal/renderers/skia/Cargo.toml @@ -31,6 +31,9 @@ unstable-wgpu-26 = [ "dep:metal", "dep:foreign-types", "dep:ash", + "dep:windows_58", + "dep:windows-core", + "dep:windows-core_58", ] unstable-wgpu-27 = [ "i-slint-core/unstable-wgpu-27", @@ -39,6 +42,9 @@ unstable-wgpu-27 = [ "dep:metal", "dep:foreign-types", "dep:ash", + "dep:windows_58", + "dep:windows-core", + "dep:windows-core_58", ] default = [] @@ -57,7 +63,7 @@ pin-weak = "1" scoped-tls-hkt = "0.1" raw-window-handle = { version = "0.6", features = ["std"] } -skia-safe = { version = "0.88", features = ["gl"] } +skia-safe = { version = "0.89", features = ["gl"] } glow = { workspace = true } unicode-segmentation = { workspace = true } @@ -77,11 +83,13 @@ softbuffer = { workspace = true, default-features = false } bytemuck = { workspace = true } [target.'cfg(target_family = "windows")'.dependencies] -windows = { version = "0.61.1", features = ["Win32", "Win32_System_Com", "Win32_Graphics", "Win32_Graphics_Dxgi", "Win32_Graphics_Direct3D12", "Win32_Graphics_Direct3D", "Win32_Foundation", "Win32_Graphics_Dxgi_Common", "Win32_System_Threading", "Win32_Security"] } -windows_58 = { package = "windows", version = "0.58.0", features = ["Win32", "Win32_System_Com", "Win32_Graphics", "Win32_Graphics_Dxgi", "Win32_Graphics_Direct3D12", "Win32_Graphics_Direct3D", "Win32_Foundation", "Win32_Graphics_Dxgi_Common", "Win32_System_Threading", "Win32_Security"] } -windows-core = { package = "windows-core", version = "0.61.0" } -windows-core_58 = { package = "windows-core", version = "0.58.0" } -skia-safe = { version = "0.88", features = ["d3d"] } +windows = { workspace = true, features = ["Win32", "Win32_System_Com", "Win32_Graphics", "Win32_Graphics_Dxgi", "Win32_Graphics_Direct3D12", "Win32_Graphics_Direct3D", "Win32_Foundation", "Win32_Graphics_Dxgi_Common", "Win32_System_Threading", "Win32_Security"] } +# Separate builds of the windows crate are needed until https://github.com/gfx-rs/wgpu/pull/6876 is +# merged and released. +windows_58 = { package = "windows", version = "0.58.0", optional = true, features = ["Win32", "Win32_System_Com", "Win32_Graphics", "Win32_Graphics_Dxgi", "Win32_Graphics_Direct3D12", "Win32_Graphics_Direct3D", "Win32_Foundation", "Win32_Graphics_Dxgi_Common", "Win32_System_Threading", "Win32_Security"] } +windows-core = { workspace = true, optional = true } +windows-core_58 = { package = "windows-core", version = "0.58.0", optional = true } +skia-safe = { version = "0.89", features = ["d3d"] } wgpu-26 = { workspace = true, optional = true, features = ["dx12"] } wgpu-27 = { workspace = true, optional = true, features = ["dx12"] } @@ -92,7 +100,7 @@ objc2-foundation = { version = "0.3.2", default-features = false, features = ["s objc2-quartz-core = { version = "0.3.2", default-features = false, features = ["std", "objc2-metal", "CALayer", "CAMetalLayer", "objc2-core-foundation"] } objc2-app-kit = { version = "0.3.2", default-features = false, features = ["std", "NSResponder", "NSView"] } objc2-core-foundation = { version = "0.3.2", default-features = false, features = ["CFCGTypes"] } -skia-safe = { version = "0.88", features = ["metal"] } +skia-safe = { version = "0.89", features = ["metal"] } raw-window-metal = "1.0" metal = { version = "0.31", optional = true } @@ -104,13 +112,13 @@ read-fonts = { version = "0.35" } write-fonts = { version = "0.43" } [target.'cfg(not(any(target_vendor = "apple", target_family = "windows")))'.dependencies] -skia-safe = { version = "0.88", features = ["gl", "vulkan"] } +skia-safe = { version = "0.89", features = ["gl", "vulkan"] } wgpu-26 = { workspace = true, optional = true, features = ["vulkan"] } wgpu-27 = { workspace = true, optional = true, features = ["vulkan"] } [target.'cfg(any(target_os = "ios", target_os="windows", target_os="android", target_os="linux"))'.dependencies] # Text layout is enabled here just so that we can make use of the pre-built Skia libraries. -skia-safe = { version = "0.88", features = ["textlayout"] } +skia-safe = { version = "0.89", features = ["textlayout"] } [build-dependencies] cfg_aliases = { workspace = true } diff --git a/internal/renderers/skia/itemrenderer.rs b/internal/renderers/skia/itemrenderer.rs index 099355bbc..401213e48 100644 --- a/internal/renderers/skia/itemrenderer.rs +++ b/internal/renderers/skia/itemrenderer.rs @@ -297,7 +297,7 @@ impl<'a> SkiaItemRenderer<'a> { } } else { let transform = - skia_safe::Matrix::rect_to_rect(skia_safe::Rect::from(src), dst, None) + skia_safe::Matrix::rect_2_rect(skia_safe::Rect::from(src), dst, None) .unwrap_or_default(); self.canvas.concat(&transform); self.canvas.draw_image_with_sampling_options(