Make dioxus-native work on iOS simulator (#4876)

* Make dioxus-native work on iOS simulator

Signed-off-by: Nico Burns <nico@nicoburns.com>

* Bump dioxus-native to v0.7.1

Signed-off-by: Nico Burns <nico@nicoburns.com>

* Update package version to use workspace versioning

---------

Signed-off-by: Nico Burns <nico@nicoburns.com>
Co-authored-by: Jonathan Kelley <jkelleyrtp@gmail.com>
This commit is contained in:
Nico BurnsandJonathan Kelley authored and GitHub committed 2025-11-05 15:22:02 -03:00
1 parent 41f68582e9
commit d61848609f
5 files changed
+513 -66

No files matched your search

+10 -1
View File
@@ -6,9 +6,16 @@ use anyrender::WindowRenderer;
pub use anyrender_vello::{
wgpu::{Features, Limits},
CustomPaintSource, VelloRendererOptions, VelloWindowRenderer as InnerRenderer,
CustomPaintSource, VelloRendererOptions,
};
#[cfg(not(all(target_os = "ios", target_abi = "sim")))]
pub use anyrender_vello::VelloWindowRenderer as InnerRenderer;
#[cfg(all(target_os = "ios", target_abi = "sim"))]
pub use anyrender_vello_cpu::VelloCpuWindowRenderer as InnerRenderer;
#[cfg(not(all(target_os = "ios", target_abi = "sim")))]
pub fn use_wgpu<T: CustomPaintSource>(create_source: impl FnOnce() -> T) -> u64 {
use dioxus_core::{consume_context, use_hook_with_cleanup};
@@ -44,6 +51,7 @@ impl DioxusNativeWindowRenderer {
Self::with_inner_renderer(vello_renderer)
}
#[cfg(not(all(target_os = "ios", target_abi = "sim")))]
pub fn with_features_and_limits(features: Option<Features>, limits: Option<Limits>) -> Self {
let vello_renderer = InnerRenderer::with_options(VelloRendererOptions {
features,
@@ -60,6 +68,7 @@ impl DioxusNativeWindowRenderer {
}
}
#[cfg(not(all(target_os = "ios", target_abi = "sim")))]
impl DioxusNativeWindowRenderer {
pub fn register_custom_paint_source(&self, source: Box<dyn CustomPaintSource>) -> u64 {
self.inner.borrow_mut().register_custom_paint_source(source)