mirror of
https://github.com/servo/servo.git
synced 2025-08-03 12:40:06 +01:00
implement get_image_pixels() for video element
This commit is contained in:
parent
bc07154e05
commit
b75d454162
4 changed files with 48 additions and 3 deletions
|
@ -604,9 +604,14 @@ impl WebGLRenderingContext {
|
|||
return Ok(None);
|
||||
}
|
||||
},
|
||||
TexImageSource::HTMLVideoElement(_) => {
|
||||
// TODO: https://github.com/servo/servo/issues/6711
|
||||
return Ok(None);
|
||||
TexImageSource::HTMLVideoElement(video) => match video.get_current_frame_data() {
|
||||
Some((data, size)) => {
|
||||
let data = data.unwrap_or_else(|| {
|
||||
IpcSharedMemory::from_bytes(&vec![0; size.area() as usize * 4])
|
||||
});
|
||||
TexPixels::new(data, size, PixelFormat::BGRA8, false)
|
||||
},
|
||||
None => return Ok(None),
|
||||
},
|
||||
}))
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue