pub struct MetalPlatformSurface { /* private fields */ }Expand description
The Metal render surface of a top-level.
The surface is shared with the thread that renders
(IPlatformRenderSurface: Send + Sync). What it holds of the native side
is the native top-level, which only the UI thread may use (see
SurfaceTopLevel): the render target is created on the UI thread, as in
the reference, and the native side refuses anything else
(TopLevelImpl::CreateMetalRenderTarget in
native/FerroUI.Native/src/OSX/TopLevelImpl.mm returns
COR_E_INVALIDOPERATION off the main thread).
Trait Implementations§
Source§impl IMetalPlatformSurface for MetalPlatformSurface
impl IMetalPlatformSurface for MetalPlatformSurface
Source§fn create_metal_render_target(
&self,
device: Rc<dyn IMetalDevice>,
) -> Rc<dyn IMetalPlatformSurfaceRenderTarget>
fn create_metal_render_target( &self, device: Rc<dyn IMetalDevice>, ) -> Rc<dyn IMetalPlatformSurfaceRenderTarget>
§Panics
Panics when called off the UI thread or when the top-level is
disposed (the render target is not ready) and when device is not a
device of this backend.
Source§impl IPlatformRenderSurface for MetalPlatformSurface
impl IPlatformRenderSurface for MetalPlatformSurface
Source§fn is_ready(&self) -> bool
fn is_ready(&self) -> bool
Deviation (DEVIATIONS.md, Native backend): the reference throws
RenderTargetNotReadyException from CreateMetalRenderTarget off the
UI thread and the composition target catches it; here the surface
answers that it is not ready, which the composition target treats the
same way, without a panic to catch.
Source§fn try_get_surface_kind(&self, kind: TypeId) -> Option<Rc<dyn Any>>
fn try_get_surface_kind(&self, kind: TypeId) -> Option<Rc<dyn Any>>
TypeId::of::<dyn IFoo>() the result holds an Rc<dyn IFoo>.Source§fn as_framebuffer_surface(&self) -> Option<&dyn IFramebufferPlatformSurface>
fn as_framebuffer_surface(&self) -> Option<&dyn IFramebufferPlatformSurface>
Source§fn text_rendering_parameters(&self) -> Option<PlatformTextRenderingParameters>
fn text_rendering_parameters(&self) -> Option<PlatformTextRenderingParameters>
None from all of them gives the defaults
of the backend (docs/porting/text-rendering.md).Auto Trait Implementations§
impl !Freeze for MetalPlatformSurface
impl !RefUnwindSafe for MetalPlatformSurface
impl !UnwindSafe for MetalPlatformSurface
impl Send for MetalPlatformSurface
impl Sync for MetalPlatformSurface
impl Unpin for MetalPlatformSurface
impl UnsafeUnpin for MetalPlatformSurface
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
Source§impl<T> ClassDefaults for Twhere
T: ?Sized,
impl<T> ClassDefaults for Twhere
T: ?Sized,
Source§fn static_constructor()
fn static_constructor()
affects_render, metadata
overrides). Read more