pub struct BrowserWebGlRenderTarget { /* private fields */ }Expand description
A canvas that is rendered to with WebGL, as the thread that draws to it holds it: the object of the script side of that thread, what the script knows about the WebGL context, and the context itself.
Upstream’s class is also the render surface of the canvas. Here the
surface is BrowserRenderSurface, which
both threads hold and which holds nothing of a thread; this object stays
in the table of the thread that renders
(get_render_target) and is what the surface
resolves there.
Implementations§
Source§impl BrowserWebGlRenderTarget
impl BrowserWebGlRenderTarget
Sourcepub fn new(js: JsObject) -> Rc<Self>
pub fn new(js: JsObject) -> Rc<Self>
Wraps the WebGL render target of the script side.
The thread that calls this is the one the target belongs to.
Sourcepub fn gl_context(&self) -> Rc<WebGlContext>
pub fn gl_context(&self) -> Rc<WebGlContext>
The WebGL context of the canvas.
Sourcepub fn create_gl_render_target(
self: &Rc<Self>,
shared: Arc<BrowserSurfaceShared>,
) -> Rc<dyn IGlPlatformSurfaceRenderTarget>
pub fn create_gl_render_target( self: &Rc<Self>, shared: Arc<BrowserSurfaceShared>, ) -> Rc<dyn IGlPlatformSurfaceRenderTarget>
Creates the OpenGL render target of the canvas. shared is where
each frame reads the size the canvas has to have.
Auto Trait Implementations§
impl !RefUnwindSafe for BrowserWebGlRenderTarget
impl !Send for BrowserWebGlRenderTarget
impl !Sync for BrowserWebGlRenderTarget
impl !UnwindSafe for BrowserWebGlRenderTarget
impl Freeze for BrowserWebGlRenderTarget
impl Unpin for BrowserWebGlRenderTarget
impl UnsafeUnpin for BrowserWebGlRenderTarget
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