pub struct Swapchain { /* private fields */ }Expand description
images shown on a canvas
Implementations§
Source§impl Swapchain
impl Swapchain
Sourcepub fn try_acquire(&mut self) -> Result<TryAcquire>
pub fn try_acquire(&mut self) -> Result<TryAcquire>
the image to draw into (the same one until the worker returns to its event loop)
Sourcepub fn acquire(&mut self) -> Result<Option<Frame>>
pub fn acquire(&mut self) -> Result<Option<Frame>>
the image to draw into; None while the window has no area
Sourcepub fn view(&self, _frame: &Frame) -> &TextureView
pub fn view(&self, _frame: &Frame) -> &TextureView
the frame’s image as a render target
Sourcepub fn texture(&self, _frame: &Frame) -> &Texture
pub fn texture(&self, _frame: &Frame) -> &Texture
the frame’s image (copies: SwapchainDesc::copy_src)
Sourcepub fn present<'a, I: IntoIterator<Item = CommandBuffer<'a>>>(
&self,
_frame: Frame,
cmds: I,
) -> Result<SubmitId>
pub fn present<'a, I: IntoIterator<Item = CommandBuffer<'a>>>( &self, _frame: Frame, cmds: I, ) -> Result<SubmitId>
submit the frame’s commands; the browser shows the image when the worker’s turn ends
Sourcepub fn prepare(&mut self) -> Result<bool>
pub fn prepare(&mut self) -> Result<bool>
(Linux: the display has answered for the images; here nothing to wait for)
Sourcepub fn flush(&self) -> Result<bool>
pub fn flush(&self) -> Result<bool>
(Linux: a frame reaches the window after the GPU finished it; here the browser does that)
Sourcepub fn next_look(&self, retry: u64) -> u64
pub fn next_look(&self, retry: u64) -> u64
when a frame that found NotReady should try again: retry (the caller’s time)
Sourcepub fn damage(&self, _rects: Option<&[[i32; 4]]>)
pub fn damage(&self, _rects: Option<&[[i32; 4]]>)
(Linux: what the next image changes, for the compositor; here the whole image counts)
Sourcepub fn set_present_mode(&mut self, _m: PresentMode)
pub fn set_present_mode(&mut self, _m: PresentMode)
(the browser’s: no present modes)
pub fn present_mode(&self) -> PresentMode
pub fn format(&self) -> Format
pub fn image_count(&self) -> usize
Auto Trait Implementations§
impl !Freeze for Swapchain
impl !RefUnwindSafe for Swapchain
impl !Send for Swapchain
impl !Sync for Swapchain
impl !UnwindSafe for Swapchain
impl Forget for Swapchain
impl Unpin for Swapchain
impl UnsafeUnpin for Swapchain
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