cosmic::iced_renderer

Type Alias Compositor

source
pub type Compositor = Compositor;
Expand description

The default graphics compositor for iced.

Aliased Type§

struct Compositor { /* private fields */ }

Trait Implementations

source§

impl Compositor for Compositor

source§

type Renderer = Renderer

The iced renderer of the backend.
source§

type Surface = Surface

The surface of the backend.
source§

async fn with_backend<W>( settings: Settings, compatible_window: W, backend: Option<&str>, ) -> Result<Compositor, Error>
where W: Window,

Creates a new Compositor with a backend preference. Read more
source§

fn create_renderer(&self) -> <Compositor as Compositor>::Renderer

Creates a Self::Renderer for the Compositor.
source§

fn create_surface<W>( &mut self, window: W, width: u32, height: u32, ) -> <Compositor as Compositor>::Surface
where W: Window + Clone,

Crates a new Surface for the given window.
source§

fn configure_surface( &mut self, surface: &mut <Compositor as Compositor>::Surface, width: u32, height: u32, )

Configures a new Surface with the given dimensions.
source§

fn fetch_information(&self) -> Information

Returns Information used by this Compositor.
source§

fn present<T>( &mut self, renderer: &mut <Compositor as Compositor>::Renderer, surface: &mut <Compositor as Compositor>::Surface, viewport: &Viewport, background_color: Color, overlay: &[T], ) -> Result<(), SurfaceError>
where T: AsRef<str>,

Presents the Renderer primitives to the next frame of the given Surface.
source§

fn screenshot<T>( &mut self, renderer: &mut <Compositor as Compositor>::Renderer, viewport: &Viewport, background_color: Color, overlay: &[T], ) -> Vec<u8>
where T: AsRef<str>,

Screenshots the current Renderer primitives to an offscreen texture, and returns the bytes of the texture ordered as RGBA in the sRGB color space.
source§

fn new<W>( settings: Settings, compatible_window: W, ) -> impl Future<Output = Result<Self, Error>>
where W: Window + Clone,

Creates a new Compositor.
source§

fn load_font(&mut self, font: Cow<'static, [u8]>)

Loads a font from its bytes.