diff options
| author | 2024-04-09 22:25:16 +0200 | |
|---|---|---|
| committer | 2024-04-09 22:25:16 +0200 | |
| commit | 6ad5bb3597f640ac329801adf735d633bf0a512f (patch) | |
| tree | f0928edacd09d6537878d22b00ad7ed7829c9ac0 /graphics/src/backend.rs | |
| parent | 2c6fd9ac14c5d270e05b97b7a7fab811d25834c4 (diff) | |
| download | iced-6ad5bb3597f640ac329801adf735d633bf0a512f.tar.gz iced-6ad5bb3597f640ac329801adf735d633bf0a512f.tar.bz2 iced-6ad5bb3597f640ac329801adf735d633bf0a512f.zip | |
Port `iced_tiny_skia` to new layering architecture
Diffstat (limited to '')
| -rw-r--r-- | graphics/src/backend.rs | 36 | 
1 files changed, 0 insertions, 36 deletions
| diff --git a/graphics/src/backend.rs b/graphics/src/backend.rs deleted file mode 100644 index 7abc42c5..00000000 --- a/graphics/src/backend.rs +++ /dev/null @@ -1,36 +0,0 @@ -//! Write a graphics backend. -use crate::core::image; -use crate::core::svg; -use crate::core::Size; -use crate::{Compositor, Mesh, Renderer}; - -use std::borrow::Cow; - -/// The graphics backend of a [`Renderer`]. -/// -/// [`Renderer`]: crate::Renderer -pub trait Backend: Sized { -    /// The custom kind of primitives this [`Backend`] supports. -    type Primitive: TryFrom<Mesh, Error = &'static str>; - -    /// The default compositor of this [`Backend`]. -    type Compositor: Compositor<Renderer = Renderer<Self>>; -} - -/// A graphics backend that supports text rendering. -pub trait Text { -    /// Loads a font from its bytes. -    fn load_font(&mut self, font: Cow<'static, [u8]>); -} - -/// A graphics backend that supports image rendering. -pub trait Image { -    /// Returns the dimensions of the provided image. -    fn dimensions(&self, handle: &image::Handle) -> Size<u32>; -} - -/// A graphics backend that supports SVG rendering. -pub trait Svg { -    /// Returns the viewport dimensions of the provided SVG. -    fn viewport_dimensions(&self, handle: &svg::Handle) -> Size<u32>; -} | 
