Gate Custom variants in iced_renderer behind custom feature

This commit is contained in:
Héctor Ramón Jiménez 2024-03-21 06:00:55 +01:00
parent 188db4da48
commit 9171df1e35
No known key found for this signature in database
GPG key ID: 7CC46565708259A7
5 changed files with 34 additions and 9 deletions

View file

@ -1,5 +1,4 @@
use crate::core::Size;
use crate::custom;
use crate::geometry::{Frame, Geometry};
use crate::Renderer;
@ -30,7 +29,8 @@ enum Internal {
TinySkia(Arc<iced_tiny_skia::Primitive>),
#[cfg(feature = "wgpu")]
Wgpu(Arc<iced_wgpu::Primitive>),
Custom(Arc<dyn custom::Geometry>),
#[cfg(feature = "custom")]
Custom(Arc<dyn crate::custom::Geometry>),
}
impl Cache {
@ -84,6 +84,7 @@ impl Cache {
content: primitive.clone(),
});
}
#[cfg(feature = "custom")]
Internal::Custom(geometry) => {
return Geometry::Custom(geometry.clone().load())
}
@ -105,6 +106,7 @@ impl Cache {
Geometry::Wgpu(primitive) => {
Internal::Wgpu(Arc::new(primitive))
}
#[cfg(feature = "custom")]
Geometry::Custom(geometry) => {
Internal::Custom(geometry.cache())
}
@ -128,6 +130,7 @@ impl Cache {
content: primitive,
})
}
#[cfg(feature = "custom")]
Internal::Custom(geometry) => Geometry::Custom(geometry.load()),
}
}