mirror of
https://github.com/servo/servo.git
synced 2025-07-22 23:03:42 +01:00
Make HTMLCanvasElement::fetch_all_data return a shared memory blob
This commit is contained in:
parent
804d964b7d
commit
9a8d03a0f3
5 changed files with 21 additions and 23 deletions
|
@ -569,12 +569,10 @@ impl WebGLRenderingContext {
|
|||
return Err(Error::Security);
|
||||
}
|
||||
if let Some((data, size)) = canvas.fetch_all_data() {
|
||||
TexPixels::new(
|
||||
IpcSharedMemory::from_bytes(&data),
|
||||
size,
|
||||
PixelFormat::BGRA8,
|
||||
true,
|
||||
)
|
||||
let data = data.unwrap_or_else(|| {
|
||||
IpcSharedMemory::from_bytes(&vec![0; size.area() as usize * 4])
|
||||
});
|
||||
TexPixels::new(data, size, PixelFormat::BGRA8, true)
|
||||
} else {
|
||||
return Ok(None);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue