summaryrefslogtreecommitdiffstats
path: root/graphics
diff options
context:
space:
mode:
authorLibravatar Ian Douglas Scott <idscott@system76.com>2024-01-09 07:19:15 -0800
committerLibravatar Ian Douglas Scott <idscott@system76.com>2024-01-16 21:34:38 -0800
commit7289b6091b61b0aa448a756cfe32211c78a4cce0 (patch)
tree480de1e0b9b0694e221ef7fb82f018e2e97eb4af /graphics
parentff268c8c4268d930fc337636302175d44e201448 (diff)
downloadiced-7289b6091b61b0aa448a756cfe32211c78a4cce0.tar.gz
iced-7289b6091b61b0aa448a756cfe32211c78a4cce0.tar.bz2
iced-7289b6091b61b0aa448a756cfe32211c78a4cce0.zip
WIP raw-window-handle 0.6
Diffstat (limited to 'graphics')
-rw-r--r--graphics/src/compositor.rs12
1 files changed, 6 insertions, 6 deletions
diff --git a/graphics/src/compositor.rs b/graphics/src/compositor.rs
index b8b575b4..6a4c7909 100644
--- a/graphics/src/compositor.rs
+++ b/graphics/src/compositor.rs
@@ -4,11 +4,11 @@ use crate::{Error, Viewport};
use iced_core::Color;
-use raw_window_handle::{HasRawDisplayHandle, HasRawWindowHandle};
+use raw_window_handle::{HasDisplayHandle, HasWindowHandle};
use thiserror::Error;
/// A graphics compositor that can draw to windows.
-pub trait Compositor: Sized {
+pub trait Compositor<W: HasWindowHandle + HasDisplayHandle>: Sized {
/// The settings of the backend.
type Settings: Default;
@@ -19,9 +19,9 @@ pub trait Compositor: Sized {
type Surface;
/// Creates a new [`Compositor`].
- fn new<W: HasRawWindowHandle + HasRawDisplayHandle>(
+ fn new(
settings: Self::Settings,
- compatible_window: Option<&W>,
+ compatible_window: Option<W>,
) -> Result<Self, Error>;
/// Creates a [`Self::Renderer`] for the [`Compositor`].
@@ -30,9 +30,9 @@ pub trait Compositor: Sized {
/// Crates a new [`Surface`] for the given window.
///
/// [`Surface`]: Self::Surface
- fn create_surface<W: HasRawWindowHandle + HasRawDisplayHandle>(
+ fn create_surface(
&mut self,
- window: &W,
+ window: W,
width: u32,
height: u32,
) -> Self::Surface;