pub struct BrowserRenderSurface { /* private fields */ }Expand description
The render surface of a canvas, as it is handed to the compositor.
Upstream hands out the render target itself (BrowserWebGlRenderTarget
or BrowserSoftwareRenderTarget), an object of the thread that draws.
A render surface of this port is shared between the thread of the user
interface and the thread that renders, so this object holds only what
the two share (BrowserSurfaceShared) and resolves the render target
on the thread that asks, in the table of that thread
(get_render_target):
- whether the surface is ready is read from the shared state, by either thread;
- what kind of surface it is (an OpenGL surface, a framebuffer surface) is the kind of the target of the calling thread. A thread that has no target of the canvas (the thread of the page, when the canvas was transferred to a worker) is told that the surface is of neither kind;
- the render targets it creates belong to the thread that asks for them.
Without a render thread the one thread of the page has the target, and the surface answers as upstream’s render target does.
Implementations§
Trait Implementations§
Source§impl IFramebufferPlatformSurface for BrowserRenderSurface
impl IFramebufferPlatformSurface for BrowserRenderSurface
Source§fn create_framebuffer_render_target(&self) -> Rc<dyn IFramebufferRenderTarget>
fn create_framebuffer_render_target(&self) -> Rc<dyn IFramebufferRenderTarget>
§Panics
Panics on a thread that has no software render target of the canvas.
Source§impl IGlPlatformSurface for BrowserRenderSurface
impl IGlPlatformSurface for BrowserRenderSurface
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 on a thread that has no WebGL render target of the canvas.
Source§impl IPlatformRenderSurface for BrowserRenderSurface
impl IPlatformRenderSurface for BrowserRenderSurface
Source§fn as_framebuffer_surface(&self) -> Option<&dyn IFramebufferPlatformSurface>
fn as_framebuffer_surface(&self) -> Option<&dyn IFramebufferPlatformSurface>
The surface as a framebuffer surface, if it is one.
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>>
The surface viewed as a surface kind defined outside this crate: for
TypeId::of::<dyn IFoo>() the result holds an Rc<dyn IFoo>.Source§fn text_rendering_parameters(&self) -> Option<PlatformTextRenderingParameters>
fn text_rendering_parameters(&self) -> Option<PlatformTextRenderingParameters>
The text rendering settings of the platform for this surface, when
the platform knows them: the render backend asks for them every
frame (they follow the settings of the system and the display the
surface is on). A backend asks every surface of a top-level and
takes the first answer;
None from all of them gives the defaults
of the backend (docs/porting/text-rendering.md).Auto Trait Implementations§
impl Freeze for BrowserRenderSurface
impl RefUnwindSafe for BrowserRenderSurface
impl Send for BrowserRenderSurface
impl Sync for BrowserRenderSurface
impl Unpin for BrowserRenderSurface
impl UnsafeUnpin for BrowserRenderSurface
impl UnwindSafe for BrowserRenderSurface
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
Mutably borrows from an owned value. Read more
Source§impl<T> ClassDefaults for Twhere
T: ?Sized,
impl<T> ClassDefaults for Twhere
T: ?Sized,
Source§fn static_constructor()
fn static_constructor()
The static constructor of a type: work done once per thread, after
the properties of the type are registered and before its first
instance exists (class handlers,
affects_render, metadata
overrides). Read more