pub struct BorrowedTarget { /* private fields */ }Expand description
Frames drawn into the host’s textures, each given back to the host.
Implementations§
Source§impl BorrowedTarget
impl BorrowedTarget
Sourcepub fn new(
backend: Rc<RendererBackend>,
textures: BorrowedTextures,
producer: SyncKind,
) -> Result<Self, Error>
pub fn new( backend: Rc<RendererBackend>, textures: BorrowedTextures, producer: SyncKind, ) -> Result<Self, Error>
A target on backend that draws into textures, which are of its
device, and hands each frame to the host with sync of the kind
producer, one of BorrowedTextures::sync_kinds’s.
Fails as BorrowedTextures::check does, and with
ErrorKind::Unsupported for a producer kind
the target can’t hand over.
Sourcepub fn release(&self, _slot: usize, consumer: ConsumerSync) -> Result<(), Error>
pub fn release(&self, _slot: usize, consumer: ConsumerSync) -> Result<(), Error>
The host gave the texture at slot back. The host’s reads went to
the queue before the next frame does, or have finished.
Sourcepub fn discard(&self, _slot: usize)
pub fn discard(&self, _slot: usize)
The host gave up the texture at slot, which is never drawn into
again.
Sourcepub fn replace(&self, textures: BorrowedTextures) -> Result<(), Error>
pub fn replace(&self, textures: BorrowedTextures) -> Result<(), Error>
Draws into textures from now on, which must be as many, of the
ring’s format.
Fails with ErrorKind::InvalidArgument for
another number of textures, with
ErrorKind::Unsupported for another format,
and as BorrowedTextures::check does.
Trait Implementations§
Source§impl Drop for BorrowedTarget
impl Drop for BorrowedTarget
Source§impl FrameTarget for BorrowedTarget
impl FrameTarget for BorrowedTarget
Source§fn begin_frame(&self) -> Option<FrameImage>
fn begin_frame(&self) -> Option<FrameImage>
Gpu that
the renderer draws it into, or None when the target has nothing to
draw into now: it has no surface, or the surface is hidden or out of
date. The caller then skips the frame. Until
end_frame, each call returns the same image.