Skip to main content

Surface

Struct Surface 

Source
pub struct Surface {
    pub surface_per_backend: HashMap<Backend, Box<dyn DynSurface>>,
    /* private fields */
}

Fields§

§surface_per_backend: HashMap<Backend, Box<dyn DynSurface>>

Implementations§

Source§

impl Surface

Source

pub unsafe fn as_hal<A: Api>( self: Arc<Self>, ) -> Option<impl Deref<Target = A::Surface>>

§Safety
  • The raw surface handle must not be manually destroyed
Source§

impl Surface

Source

pub fn get_capabilities( &self, adapter: &Adapter, ) -> Result<SurfaceCapabilities, GetSurfaceSupportError>

Source

pub fn get_hal_capabilities( &self, adapter: &Adapter, ) -> Result<SurfaceCapabilities, GetSurfaceSupportError>

Source

pub fn get_capabilities_with_raw( &self, adapter: &DynExposedAdapter, ) -> Result<SurfaceCapabilities, GetSurfaceSupportError>

Source

pub fn display_hdr_info(&self, adapter: &Adapter) -> DisplayHdrInfo

Returns the HDR / luminance characteristics of the display backing this surface on adapter.

Falls back to wgt::DisplayHdrInfo::default (all fields None) when the surface is not on adapter’s backend or the backend reports nothing.

Source

pub fn display_hdr_info_with_raw( &self, adapter: &DynExposedAdapter, ) -> DisplayHdrInfo

Source

pub fn raw(&self, backend: Backend) -> Option<&dyn DynSurface>

Source

pub fn unconfigure(self: &Arc<Self>)

Source

pub fn configure( self: &Arc<Self>, device: &Arc<Device>, config: &SurfaceConfiguration<Vec<TextureFormat>>, ) -> Result<(), ConfigureSurfaceError>

Source§

impl Surface

Source

pub fn get_current_texture( self: &Arc<Self>, ) -> Result<SurfaceOutput, SurfaceError>

Source

pub fn present(self: &Arc<Self>) -> Result<Status, SurfaceError>

Source

pub fn present_with_damage( self: &Arc<Self>, damage_rects: &[Rect<u32>], ) -> Result<Status, SurfaceError>

Source§

impl Surface

Source

pub fn discard(self: &Arc<Self>) -> Result<(), SurfaceError>

Source

pub fn release(self: &Arc<Self>) -> Result<(), SurfaceError>

Trait Implementations§

Source§

impl Drop for Surface

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

fn pin_drop(self: Pin<&mut Self>)

🔬This is a nightly-only experimental API. (pin_ergonomics)
Execute the destructor for this type, but different to Drop::drop, it requires self to be pinned. Read more
Source§

impl ResourceType for Surface

Source§

const TYPE: &'static str = "Surface"

Auto Trait Implementations§

§

impl !Freeze for Surface

§

impl !RefUnwindSafe for Surface

§

impl !UnwindSafe for Surface

§

impl Forget for Surface

§

impl Move for Surface

§

impl Send for Surface
where Mutex<RawMutex, Option<Presentation>>: Send, InternalBitFlags: Send, RawTable<(Backend, Box<dyn DynSurface>)>: Send,

§

impl Sync for Surface
where Mutex<RawMutex, Option<Presentation>>: Sync, InternalBitFlags: Sync, RawTable<(Backend, Box<dyn DynSurface>)>: Sync,

§

impl Unpin for Surface
where Align1<u8>: Unpin, Arc<Device>: Unpin, InternalBitFlags: Unpin, *const u8 is !null: Unpin, Arc<Texture>: Unpin, InternalBitFlags: Unpin, Box<dyn DynSurface>: Unpin,

§

impl UnsafeUnpin for Surface
where Align1<u8>: UnsafeUnpin, *const ArcInner<Device> is !null: UnsafeUnpin, PhantomData<ArcInner<Device>>: UnsafeUnpin, InternalBitFlags: UnsafeUnpin, *const u8 is !null: UnsafeUnpin, PhantomData<TextureFormat>: UnsafeUnpin, *const ArcInner<Texture> is !null: UnsafeUnpin, PhantomData<ArcInner<Texture>>: UnsafeUnpin, InternalBitFlags: UnsafeUnpin, PhantomData<(Backend, Box<dyn DynSurface>)>: UnsafeUnpin,

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> Downcast<T> for T

Source§

fn downcast(&self) -> &T

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> Upcast<T> for T

Source§

fn upcast(&self) -> Option<&T>

Source§

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

Source§

impl<T> WasmNotSendSync for T

Source§

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