2024-04-07 12:42:12 +02:00
|
|
|
//! The official renderer for iced.
|
2023-09-09 20:58:45 +02:00
|
|
|
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
|
2023-11-14 12:49:49 +01:00
|
|
|
#[cfg(feature = "wgpu")]
|
|
|
|
|
pub use iced_wgpu as wgpu;
|
|
|
|
|
|
2024-03-21 22:27:17 +01:00
|
|
|
pub mod fallback;
|
2023-03-03 04:57:55 +01:00
|
|
|
|
2023-03-04 05:37:11 +01:00
|
|
|
pub use iced_graphics as graphics;
|
|
|
|
|
pub use iced_graphics::core;
|
2023-03-01 21:34:26 +01:00
|
|
|
|
2023-06-22 00:38:36 +02:00
|
|
|
#[cfg(feature = "geometry")]
|
2024-03-21 22:27:17 +01:00
|
|
|
pub use iced_graphics::geometry;
|
2023-06-22 00:38:36 +02:00
|
|
|
|
2023-02-24 23:24:48 +01:00
|
|
|
/// The default graphics renderer for [`iced`].
|
|
|
|
|
///
|
|
|
|
|
/// [`iced`]: https://github.com/iced-rs/iced
|
2024-03-22 05:27:31 +01:00
|
|
|
pub type Renderer = renderer::Renderer;
|
2023-06-22 00:38:36 +02:00
|
|
|
|
2024-03-21 22:27:17 +01:00
|
|
|
/// The default graphics compositor for [`iced`].
|
|
|
|
|
///
|
|
|
|
|
/// [`iced`]: https://github.com/iced-rs/iced
|
2024-03-22 05:27:31 +01:00
|
|
|
pub type Compositor = renderer::Compositor;
|
|
|
|
|
|
|
|
|
|
#[cfg(all(feature = "wgpu", feature = "tiny-skia"))]
|
|
|
|
|
mod renderer {
|
|
|
|
|
pub type Renderer = crate::fallback::Renderer<
|
|
|
|
|
iced_wgpu::Renderer,
|
|
|
|
|
iced_tiny_skia::Renderer,
|
|
|
|
|
>;
|
|
|
|
|
|
|
|
|
|
pub type Compositor = crate::fallback::Compositor<
|
|
|
|
|
iced_wgpu::window::Compositor,
|
|
|
|
|
iced_tiny_skia::window::Compositor,
|
|
|
|
|
>;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#[cfg(all(feature = "wgpu", not(feature = "tiny-skia")))]
|
|
|
|
|
mod renderer {
|
|
|
|
|
pub type Renderer = iced_wgpu::Renderer;
|
|
|
|
|
pub type Compositor = iced_wgpu::window::Compositor;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#[cfg(all(not(feature = "wgpu"), feature = "tiny-skia"))]
|
|
|
|
|
mod renderer {
|
|
|
|
|
pub type Renderer = iced_tiny_skia::Renderer;
|
|
|
|
|
pub type Compositor = iced_tiny_skia::window::Compositor;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#[cfg(not(any(feature = "wgpu", feature = "tiny-skia")))]
|
|
|
|
|
mod renderer {
|
2024-05-22 12:36:04 +02:00
|
|
|
#[cfg(not(debug_assertions))]
|
|
|
|
|
compile_error!(
|
|
|
|
|
"Cannot compile `iced_renderer` in release mode \
|
|
|
|
|
without a renderer feature enabled. \
|
|
|
|
|
Enable either the `wgpu` or `tiny-skia` feature, or both."
|
|
|
|
|
);
|
|
|
|
|
|
2024-03-22 05:27:31 +01:00
|
|
|
pub type Renderer = ();
|
|
|
|
|
pub type Compositor = ();
|
|
|
|
|
}
|