Skip to content

Commit

Permalink
Bump Skia Rust bindings to 0.75
Browse files Browse the repository at this point in the history
This updates Skia to milestone 126 and (among other things) fixes
SKIA_DEBUG=1 builds.

See https://github.com/rust-skia/rust-skia/releases/tag/0.75.0 for more
details.
  • Loading branch information
tronical committed Jun 3, 2024
1 parent b4c89bb commit ef8299a
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
10 changes: 5 additions & 5 deletions internal/renderers/skia/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ pin-weak = "1"
scoped-tls-hkt = "0.1"
raw-window-handle = { version = "0.5", features = ["std"] }

skia-safe = { version = "0.72.0", features = ["textlayout", "gl"] }
skia-safe = { version = "0.75.0", features = ["textlayout", "gl"] }
glow = { version = "0.13" }
unicode-segmentation = { version = "1.8.0" }

Expand All @@ -57,8 +57,8 @@ softbuffer = { workspace = true, default-features = false }
bytemuck = { workspace = true }

[target.'cfg(target_family = "windows")'.dependencies]
windows = { version = "0.54.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"] }
skia-safe = { version = "0.72.0", features = ["d3d"] }
windows = { version = "0.56.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"] }
skia-safe = { version = "0.75.0", features = ["d3d"] }

[target.'cfg(target_os = "macos")'.dependencies]
cocoa = { version = "0.25.0" }
Expand All @@ -68,10 +68,10 @@ metal = { version = "0.27.0" }
foreign-types = { version = "0.5.0" }
objc = { version = "0.2.7" }
core-graphics-types = { version = "0.1.1" }
skia-safe = { version = "0.72.0", features = ["metal"] }
skia-safe = { version = "0.75.0", features = ["metal"] }

[target.'cfg(not(any(target_os = "macos", target_family = "windows")))'.dependencies]
skia-safe = { version = "0.72.0", features = ["gl"] }
skia-safe = { version = "0.75.0", features = ["gl"] }

[build-dependencies]
cfg_aliases = { workspace = true }
6 changes: 3 additions & 3 deletions internal/renderers/skia/metal_surface.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,11 @@ impl super::Surface for MetalSurface {
mtl::BackendContext::new(
device.as_ptr() as mtl::Handle,
command_queue.as_ptr() as mtl::Handle,
std::ptr::null(),
)
};

let gr_context = skia_safe::gpu::DirectContext::new_metal(&backend, None).unwrap().into();
let gr_context =
skia_safe::gpu::direct_contexts::make_metal(&backend, None).unwrap().into();

Ok(Self { command_queue, layer, gr_context })
}
Expand Down Expand Up @@ -103,7 +103,7 @@ impl super::Surface for MetalSurface {
let texture_info =
mtl::TextureInfo::new(drawable.texture().as_ptr() as mtl::Handle);

let backend_render_target = skia_safe::gpu::BackendRenderTarget::new_metal(
let backend_render_target = skia_safe::gpu::backend_render_targets::make_mtl(
(size.width as i32, size.height as i32),
&texture_info,
);
Expand Down
2 changes: 1 addition & 1 deletion internal/renderers/skia/opengl_surface.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ impl super::Surface for OpenGLSurface {
})?;

let mut gr_context =
skia_safe::gpu::DirectContext::new_gl(gl_interface, None).ok_or_else(|| {
skia_safe::gpu::direct_contexts::make_gl(gl_interface, None).ok_or_else(|| {
format!("Skia Renderer: Internal Error: Could not create Skia Direct Context from GL interface")
})?;

Expand Down
2 changes: 1 addition & 1 deletion internal/renderers/skia/vulkan_surface.rs
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ impl VulkanSurface {
)
};

let gr_context = skia_safe::gpu::DirectContext::new_vulkan(&backend_context, None)
let gr_context = skia_safe::gpu::direct_contexts::make_vulkan(&backend_context, None)
.ok_or_else(|| format!("Error creating Skia Vulkan context"))?;

let previous_frame_end = RefCell::new(Some(sync::now(device.clone()).boxed()));
Expand Down

0 comments on commit ef8299a

Please sign in to comment.