From e23e4b8db20f3910bb6617a6931c9a8906791f8e Mon Sep 17 00:00:00 2001 From: Richard Date: Thu, 17 Mar 2022 00:25:00 -0300 Subject: Introduce `GraphicsInformation` to `iced_graphics` --- graphics/src/window/compositor.rs | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'graphics/src/window/compositor.rs') diff --git a/graphics/src/window/compositor.rs b/graphics/src/window/compositor.rs index 9ea040cd..5987b118 100644 --- a/graphics/src/window/compositor.rs +++ b/graphics/src/window/compositor.rs @@ -71,3 +71,12 @@ pub enum SurfaceError { #[error("There is no more memory left to allocate a new frame")] OutOfMemory, } + +/// Contains informations about the graphics (e.g. graphics adapter, graphics backend). +#[derive(Debug)] +pub struct GraphicsInformation { + /// Contains the graphics adapter. + pub adapter: String, + /// Contains the graphics backend. + pub backend: String, +} -- cgit From 83fec2f5f6231f3871ecfccf594a555253f8286c Mon Sep 17 00:00:00 2001 From: Richard Date: Thu, 17 Mar 2022 00:34:42 -0300 Subject: Implement `GraphicsInformation` for `iced_wgpu` --- graphics/src/window/compositor.rs | 3 +++ 1 file changed, 3 insertions(+) (limited to 'graphics/src/window/compositor.rs') diff --git a/graphics/src/window/compositor.rs b/graphics/src/window/compositor.rs index 5987b118..035101c9 100644 --- a/graphics/src/window/compositor.rs +++ b/graphics/src/window/compositor.rs @@ -38,6 +38,9 @@ pub trait Compositor: Sized { height: u32, ); + /// Returns [`GraphicsInformation`] used by this [`Compositor`]. + fn get_information(&self) -> GraphicsInformation; + /// Presents the [`Renderer`] primitives to the next frame of the given [`Surface`]. /// /// [`SwapChain`]: Self::SwapChain -- cgit From 5be1ac18fe1757d31386f98774d823bd1137eea4 Mon Sep 17 00:00:00 2001 From: Richard Date: Tue, 26 Apr 2022 19:09:09 -0300 Subject: Rename `GraphicsInformation` to `Information` --- graphics/src/window/compositor.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'graphics/src/window/compositor.rs') diff --git a/graphics/src/window/compositor.rs b/graphics/src/window/compositor.rs index 035101c9..8a851773 100644 --- a/graphics/src/window/compositor.rs +++ b/graphics/src/window/compositor.rs @@ -39,7 +39,7 @@ pub trait Compositor: Sized { ); /// Returns [`GraphicsInformation`] used by this [`Compositor`]. - fn get_information(&self) -> GraphicsInformation; + fn get_information(&self) -> Information; /// Presents the [`Renderer`] primitives to the next frame of the given [`Surface`]. /// @@ -77,7 +77,7 @@ pub enum SurfaceError { /// Contains informations about the graphics (e.g. graphics adapter, graphics backend). #[derive(Debug)] -pub struct GraphicsInformation { +pub struct Information { /// Contains the graphics adapter. pub adapter: String, /// Contains the graphics backend. -- cgit From 984d1f375ecec301dd42b049eecd1b88e3bca32a Mon Sep 17 00:00:00 2001 From: Richard Date: Tue, 26 Apr 2022 19:18:18 -0300 Subject: Move `compositor` module access from `window` to `crate` --- graphics/src/window/compositor.rs | 2 ++ 1 file changed, 2 insertions(+) (limited to 'graphics/src/window/compositor.rs') diff --git a/graphics/src/window/compositor.rs b/graphics/src/window/compositor.rs index 8a851773..3f1165d4 100644 --- a/graphics/src/window/compositor.rs +++ b/graphics/src/window/compositor.rs @@ -1,3 +1,5 @@ +//! A compositor is responsible for initializing a renderer and managing window +//! surfaces. use crate::{Color, Error, Viewport}; use raw_window_handle::HasRawWindowHandle; -- cgit From 005e516b5e1e8bb22f2da8524ffe4529f3b60ba1 Mon Sep 17 00:00:00 2001 From: Richard Date: Tue, 26 Apr 2022 19:20:38 -0300 Subject: Rename `get_information` to `fetch_information` --- graphics/src/window/compositor.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'graphics/src/window/compositor.rs') diff --git a/graphics/src/window/compositor.rs b/graphics/src/window/compositor.rs index 3f1165d4..7525de1d 100644 --- a/graphics/src/window/compositor.rs +++ b/graphics/src/window/compositor.rs @@ -41,7 +41,7 @@ pub trait Compositor: Sized { ); /// Returns [`GraphicsInformation`] used by this [`Compositor`]. - fn get_information(&self) -> Information; + fn fetch_information(&self) -> Information; /// Presents the [`Renderer`] primitives to the next frame of the given [`Surface`]. /// -- cgit