mirror of
https://github.com/servo/servo.git
synced 2025-06-06 16:45:39 +00:00
Signed-off-by: Lucas Fabián Montenegro <40044087+lucasMontenegro@users.noreply.github.com>
This commit is contained in:
parent
8bbcf0abaf
commit
256ab5353b
3 changed files with 39 additions and 40 deletions
|
@ -269,11 +269,15 @@ impl HTMLCanvasElement {
|
|||
.global()
|
||||
.script_to_constellation_chan()
|
||||
.send(ScriptMsg::GetWebGPUChan(sender));
|
||||
let window = window_from_node(self);
|
||||
let channel = receiver.recv().expect("Failed to get WebGPU channel");
|
||||
let context = GPUCanvasContext::new(window.upcast::<GlobalScope>(), self, channel);
|
||||
*self.context.borrow_mut() = Some(CanvasContext::WebGPU(Dom::from_ref(&*context)));
|
||||
Some(context)
|
||||
receiver
|
||||
.recv()
|
||||
.expect("Failed to get WebGPU channel")
|
||||
.map(|channel| {
|
||||
let window = window_from_node(self);
|
||||
let context = GPUCanvasContext::new(window.upcast::<GlobalScope>(), self, channel);
|
||||
*self.context.borrow_mut() = Some(CanvasContext::WebGPU(Dom::from_ref(&*context)));
|
||||
context
|
||||
})
|
||||
}
|
||||
|
||||
/// Gets the base WebGLRenderingContext for WebGL or WebGL 2, if exists.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue