Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clean up the Skia renderer API #2839

Merged
merged 1 commit into from Jun 7, 2023
Merged

Conversation

tronical
Copy link
Member

@tronical tronical commented Jun 7, 2023

Accept raw display and window handles, instead of &dyn HasRaw*Handle.

This is consistent with other crates in the Rust ecosystem. Consequently the accepting functions are marked unsafe, as the
API can't guarantee that the handles remain valid.

@ogoffart
Copy link
Member

ogoffart commented Jun 7, 2023

I disagree, I think it should take raw_window_handle::WindowHandle and raw_window_handle::DisplayHandle

The reason why other crate on the ecosystem are not using that yet is because it is fairly new. With that, it doesn't need to be unsafe.

@tronical
Copy link
Member Author

tronical commented Jun 7, 2023

Sounds good to me, thanks for the hint.

@tronical tronical force-pushed the simon/rwh-renderer-cleanup branch from e8405e5 to a2940d3 Compare June 7, 2023 08:35
@@ -38,7 +39,7 @@ impl super::Surface for MetalSurface {
layer.set_drawable_size(CGSize::new(size.width as f64, size.height as f64));

unsafe {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

detail: the unsafe could probably have a smaller scope (feel free to ignore)

internal/renderers/skia/vulkan_surface.rs Outdated Show resolved Hide resolved
@tronical tronical force-pushed the simon/rwh-renderer-cleanup branch from a2940d3 to f57f133 Compare June 7, 2023 09:06
Accept display and window handles with life time, instead of &dyn
HasRaw*Handle.
@tronical tronical force-pushed the simon/rwh-renderer-cleanup branch from f57f133 to ba15a4a Compare June 7, 2023 09:20
@tronical tronical merged commit fb1d372 into master Jun 7, 2023
26 checks passed
@tronical tronical deleted the simon/rwh-renderer-cleanup branch June 7, 2023 10:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants