pub struct Compositor { /* private fields */ }
Expand description
A window graphics backend for iced powered by wgpu
.
Implementations§
Trait Implementations§
Source§impl Compositor for Compositor
impl Compositor for Compositor
Source§async fn with_backend<W: Window>(
settings: Settings,
compatible_window: W,
backend: Option<&str>,
) -> Result<Self, Error>
async fn with_backend<W: Window>( settings: Settings, compatible_window: W, backend: Option<&str>, ) -> Result<Self, Error>
Creates a new [
Compositor
] with a backend preference. Read moreSource§fn create_renderer(&self) -> Self::Renderer
fn create_renderer(&self) -> Self::Renderer
Creates a [
Self::Renderer
] for the [Compositor
].Source§fn create_surface<W: Window>(
&mut self,
window: W,
width: u32,
height: u32,
) -> Self::Surface
fn create_surface<W: Window>( &mut self, window: W, width: u32, height: u32, ) -> Self::Surface
Crates a new
Surface
for the given window.Source§fn configure_surface(
&mut self,
surface: &mut Self::Surface,
width: u32,
height: u32,
)
fn configure_surface( &mut self, surface: &mut Self::Surface, width: u32, height: u32, )
Configures a new
Surface
with the given dimensions.Source§fn fetch_information(&self) -> Information
fn fetch_information(&self) -> Information
Returns [
Information
] used by this [Compositor
].Source§fn present(
&mut self,
renderer: &mut Self::Renderer,
surface: &mut Self::Surface,
viewport: &Viewport,
background_color: Color,
on_pre_present: impl FnOnce(),
) -> Result<(), SurfaceError>
fn present( &mut self, renderer: &mut Self::Renderer, surface: &mut Self::Surface, viewport: &Viewport, background_color: Color, on_pre_present: impl FnOnce(), ) -> Result<(), SurfaceError>
Source§fn screenshot(
&mut self,
renderer: &mut Self::Renderer,
viewport: &Viewport,
background_color: Color,
) -> Vec<u8> ⓘ
fn screenshot( &mut self, renderer: &mut Self::Renderer, viewport: &Viewport, background_color: Color, ) -> Vec<u8> ⓘ
Screenshots the current
Renderer
primitives to an offscreen texture, and returns the bytes of
the texture ordered as RGBA
in the sRGB
color space.Auto Trait Implementations§
impl Freeze for Compositor
impl !RefUnwindSafe for Compositor
impl Send for Compositor
impl Sync for Compositor
impl Unpin for Compositor
impl !UnwindSafe for Compositor
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more