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
impl ConfiguredSurface
Sourcepub fn configure(
surface: Surface<'static>,
device: &Device,
format: TextureFormat,
alpha_mode: CompositeAlphaMode,
size: (u32, u32),
present_mode: PresentMode,
) -> Self
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.
Sourcepub fn reconfigure(&self, device: &Device)
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.
Sourcepub fn resize(&mut self, device: &Device, width: u32, height: u32)
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.
Sourcepub fn surface(&self) -> &Surface<'static>
pub fn surface(&self) -> &Surface<'static>
The live surface, for acquiring a swapchain texture.
Sourcepub fn config(&self) -> &SurfaceConfiguration
pub fn config(&self) -> &SurfaceConfiguration
The configuration this surface is currently up with.
Sourcepub fn resolved_translucent(&self) -> bool
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.
Sourcepub fn straight_alpha_translucent(&self) -> bool
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.