mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
refactor: propagate CanGc arguments through callers (#35591)
Signed-off-by: Auguste Baum <auguste.apple@gmail.com>
This commit is contained in:
parent
02199520f2
commit
b0b0289014
74 changed files with 403 additions and 275 deletions
|
@ -139,11 +139,14 @@ impl WebGLFramebuffer {
|
|||
}
|
||||
}
|
||||
|
||||
pub(crate) fn maybe_new(context: &WebGLRenderingContext) -> Option<DomRoot<Self>> {
|
||||
pub(crate) fn maybe_new(
|
||||
context: &WebGLRenderingContext,
|
||||
can_gc: CanGc,
|
||||
) -> Option<DomRoot<Self>> {
|
||||
let (sender, receiver) = webgl_channel().unwrap();
|
||||
context.send_command(WebGLCommand::CreateFramebuffer(sender));
|
||||
let id = receiver.recv().unwrap()?;
|
||||
let framebuffer = WebGLFramebuffer::new(context, id, CanGc::note());
|
||||
let framebuffer = WebGLFramebuffer::new(context, id, can_gc);
|
||||
Some(framebuffer)
|
||||
}
|
||||
|
||||
|
@ -154,8 +157,9 @@ impl WebGLFramebuffer {
|
|||
session: &XRSession,
|
||||
context: &WebGLRenderingContext,
|
||||
size: Size2D<i32, Viewport>,
|
||||
can_gc: CanGc,
|
||||
) -> Option<DomRoot<Self>> {
|
||||
let framebuffer = Self::maybe_new(context)?;
|
||||
let framebuffer = Self::maybe_new(context, can_gc)?;
|
||||
framebuffer.size.set(Some((size.width, size.height)));
|
||||
framebuffer.status.set(constants::FRAMEBUFFER_COMPLETE);
|
||||
framebuffer.xr_session.set(Some(session));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue