summaryrefslogtreecommitdiffstats
path: root/graphics/src/backend.rs
diff options
context:
space:
mode:
authorLibravatar Gigas002 <24297712+Gigas002@users.noreply.github.com>2024-03-27 19:47:48 +0900
committerLibravatar GitHub <noreply@github.com>2024-03-27 19:47:48 +0900
commit19afc66cadfc7ea230d4d749b0d7b0197e29cf93 (patch)
treed012dff84003f2d7d18a1e6bc4bdac62df73b322 /graphics/src/backend.rs
parent4334e63ba1dd88b367f3b7f2790b7869d11d12c0 (diff)
parent1df1cf82f4c9485533f2566c8490cfe188b4ae6a (diff)
downloadiced-19afc66cadfc7ea230d4d749b0d7b0197e29cf93.tar.gz
iced-19afc66cadfc7ea230d4d749b0d7b0197e29cf93.tar.bz2
iced-19afc66cadfc7ea230d4d749b0d7b0197e29cf93.zip
Merge branch 'master' into viewer_content_fit
Diffstat (limited to 'graphics/src/backend.rs')
-rw-r--r--graphics/src/backend.rs8
1 files changed, 6 insertions, 2 deletions
diff --git a/graphics/src/backend.rs b/graphics/src/backend.rs
index 10eb337f..7abc42c5 100644
--- a/graphics/src/backend.rs
+++ b/graphics/src/backend.rs
@@ -2,15 +2,19 @@
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 {
+pub trait Backend: Sized {
/// The custom kind of primitives this [`Backend`] supports.
- type Primitive;
+ 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.