Skip to main content

ConfiguredSurface

Struct ConfiguredSurface 

Source
pub struct ConfiguredSurface { /* private fields */ }
Expand description

A configured swapchain surface: the surface itself, the configuration it was brought up with, and whether it actually came up translucent.

Implementations§

Source§

impl ConfiguredSurface

Source

pub fn configure( surface: Surface<'static>, device: &Device, format: TextureFormat, alpha_mode: CompositeAlphaMode, size: (u32, u32), present_mode: PresentMode, ) -> Self

Configures surface against device and returns the wrapper.

format is the format the caller resolved from what the surface reports (select_surface_format) rather than one this layer imposes, and alpha_mode the one resolve_alpha_mode resolved from the surface’s reported modes. size is (width, height) in physical pixels and must be non-zero on both axes.

Source

pub fn reconfigure(&self, device: &Device)

Re-applies the current configuration to the swapchain — the recovery step an Outdated (or retried Invalid) acquire asks for, where the surface is stale but its geometry has not changed.

Source

pub fn resize(&mut self, device: &Device, width: u32, height: u32)

Resizes the swapchain in place. width/height are physical pixels and must both be non-zero; the shell’s resize path filters a minimized or zero-extent window out before reaching here.

Source

pub fn surface(&self) -> &Surface<'static>

The live surface, for acquiring a swapchain texture.

Source

pub fn config(&self) -> &SurfaceConfiguration

The configuration this surface is currently up with.

Source

pub fn size(&self) -> (u32, u32)

The swapchain’s (width, height) in physical pixels.

Source

pub fn resolved_translucent(&self) -> bool

Whether this surface really came up translucent — the answer a shell’s paint contract keys off, never the original SurfaceAlphaRequest.

Source

pub fn straight_alpha_translucent(&self) -> bool

Whether this surface really came up translucent with a swapchain that stores STRAIGHT alpha — iOS’s PostMultiplied translucent mode, the one configuration whose present needs the engine’s premultiplied output converted back.

Reads Self::resolved_translucent rather than the raw alpha mode, so a surface that never got the translucency it asked for answers false.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WasmNotSend for T
where T: Send,

Source§

impl<T> WasmNotSendSync for T

Source§

impl<T> WasmNotSync for T
where T: Sync,