pub enum Surface {
Vulkan(VulkanTexture),
Gles(GlesTexture),
}Variants§
Vulkan(VulkanTexture)
vulkan only.Gles(GlesTexture)
gles only.Implementations§
Source§impl Surface
impl Surface
pub fn extent(&self) -> Extent2D
pub fn format(&self) -> PixelFormat
Sourcepub fn into_image(self) -> Image
pub fn into_image(self) -> Image
This surface, drawn, as an image a later draw samples: the same texture, not a copy.
What a snapshot is. A picture drawn once into a surface the size of the snapshot and then drawn many times as an image costs one pass, where reading it back and writing it into an image would cost a wait for the device and the pixels across the bus twice. Every surface is made to be sampled as well as drawn into, so nothing can refuse this.
The image has one level and no chain: a snapshot is drawn at or near
its own size, and a paint asking for mipmapped sampling reads that
level, as it does from an image made without one. The device keeps
what it draws in order, so a draw sampling the image sees everything
drawn into the surface before this was called, on either backend.
Released with Context::destroy_image.
Auto Trait Implementations§
impl !Freeze for Surface
impl !RefUnwindSafe for Surface
impl !Sync for Surface
impl Forget for Surface
impl Move for Surface
impl Send for Surfacewhere
NonZero<u64>: Send,
SendSyncPtr: Send,
BoxRaw<str>: Send,
Cell<ImageLayout>: Send,
NativeTexture: Send,
NativeFramebuffer: Send,
impl Unpin for Surface
impl UnsafeUnpin for Surfacewhere
NonZeroU64Inner: UnsafeUnpin,
*const c_void is !null: UnsafeUnpin,
*const str is !null: UnsafeUnpin,
PhantomData<str>: UnsafeUnpin,
NativeTexture: UnsafeUnpin,
NativeFramebuffer: UnsafeUnpin,
impl UnwindSafe for Surfacewhere
NonZero<u64>: UnwindSafe,
NonNull<c_void>: UnwindSafe,
BoxRaw<str>: UnwindSafe,
NativeTexture: UnwindSafe,
NativeFramebuffer: UnwindSafe,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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> ⓘ
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> ⓘ
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