pub enum BrowserRenderTarget {
WebGl(Rc<BrowserWebGlRenderTarget>),
Software(Rc<BrowserSoftwareRenderTarget>),
}Expand description
The render target of a canvas, as the thread that draws to it holds it.
Upstream has an abstract class with the two kinds as subclasses; the two
kinds are closed here, so they are the variants of an enum. A value
belongs to its thread (it holds an object of the script side of that
thread) and is handed out by get_render_target.
Variants§
WebGl(Rc<BrowserWebGlRenderTarget>)
A canvas that is rendered to with WebGL.
Software(Rc<BrowserSoftwareRenderTarget>)
A canvas that is rendered to in memory.
Implementations§
Source§impl BrowserRenderTarget
impl BrowserRenderTarget
Sourcepub fn platform_graphics_context(
&self,
) -> Option<Rc<dyn IPlatformGraphicsContext>>
pub fn platform_graphics_context( &self, ) -> Option<Rc<dyn IPlatformGraphicsContext>>
The graphics context the target renders with; None for a target
that is rendered to in software.
Sourcepub fn kind(&self) -> i32
pub fn kind(&self) -> i32
The kind of the target as a worker reports it and as
BrowserSurfaceShared publishes it:
RENDER_TARGET_KIND_WEB_GL or RENDER_TARGET_KIND_SOFTWARE.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for BrowserRenderTarget
impl !Send for BrowserRenderTarget
impl !Sync for BrowserRenderTarget
impl !UnwindSafe for BrowserRenderTarget
impl Freeze for BrowserRenderTarget
impl Unpin for BrowserRenderTarget
impl UnsafeUnpin for BrowserRenderTarget
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