pub struct GlPlatformSurface { /* private fields */ }Expand description
The OpenGL render surface of a top-level.
The surface is shared with the thread that renders, like the Metal
surface (metal.rs): what it holds of the native side is the native
top-level, which only the UI thread may use, so the render target is
created on the UI thread, as in the original, and the surface is not
ready on any other thread.
Trait Implementations§
Source§impl IGlPlatformSurface for GlPlatformSurface
impl IGlPlatformSurface for GlPlatformSurface
Source§fn create_gl_render_target(
&self,
context: &Rc<dyn IGlContext>,
) -> Rc<dyn IGlPlatformSurfaceRenderTarget>
fn create_gl_render_target( &self, context: &Rc<dyn IGlContext>, ) -> Rc<dyn IGlPlatformSurfaceRenderTarget>
§Panics
Panics when called off the UI thread or when the top-level is
disposed (the render target is not ready), when context is not a
context of this backend and when the native top-level cannot create
the render target.
Source§impl IPlatformRenderSurface for GlPlatformSurface
impl IPlatformRenderSurface for GlPlatformSurface
Source§fn is_ready(&self) -> bool
fn is_ready(&self) -> bool
Deviation (DEVIATIONS.md, Native backend), as for the Metal surface:
the original throws RenderTargetNotReadyException from
CreateGlRenderTarget off the UI thread and the composition target
catches it; here the surface answers that it is not ready there.
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 GlPlatformSurface
impl !RefUnwindSafe for GlPlatformSurface
impl !UnwindSafe for GlPlatformSurface
impl Send for GlPlatformSurface
impl Sync for GlPlatformSurface
impl Unpin for GlPlatformSurface
impl UnsafeUnpin for GlPlatformSurface
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