mirror of
https://github.com/servo/servo.git
synced 2025-07-24 15:50:21 +01:00
pixels: Extend Image to allow for multiple frames (#36058)
Signed-off-by: rayguo17 <rayguo17@gmail.com>
This commit is contained in:
parent
584b37a1f3
commit
ec20d9a3d7
6 changed files with 119 additions and 28 deletions
|
@ -292,7 +292,7 @@ impl CanvasState {
|
|||
|
||||
let image_size = Size2D::new(img.width, img.height);
|
||||
let image_data = match img.format {
|
||||
PixelFormat::BGRA8 => img.bytes.clone(),
|
||||
PixelFormat::BGRA8 => img.bytes(),
|
||||
pixel_format => unimplemented!("unsupported pixel format ({:?})", pixel_format),
|
||||
};
|
||||
|
||||
|
|
|
@ -619,7 +619,7 @@ impl WebGLRenderingContext {
|
|||
|
||||
let size = Size2D::new(img.width, img.height);
|
||||
|
||||
TexPixels::new(img.bytes.clone(), size, img.format, false)
|
||||
TexPixels::new(img.bytes(), size, img.format, false)
|
||||
},
|
||||
// TODO(emilio): Getting canvas data is implemented in CanvasRenderingContext2D,
|
||||
// but we need to refactor it moving it to `HTMLCanvasElement` and support
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue