mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +01:00
imagebitmap: Use snapshot::Snapshot as bitmap data (#37131)
Replace the holder of actual pixel data of the ImageBitmap interface ([[BitmapData]] slot) from Vec<u8> to snapshot::Snapshot (image bitmap with metadata). https://html.spec.whatwg.org/multipage/#the-imagebitmap-interface It will allow to have all required information (e.g. size, pixel format, alpha mode) for further drawing processing to/from canvas2D output bitmap. Testing: No required tests Fixes: https://github.com/servo/servo/issues/34112 Signed-off-by: Andrei Volykhin <andrei.volykhin@gmail.com>
This commit is contained in:
parent
d76b4a14df
commit
86b3b16b4c
7 changed files with 50 additions and 47 deletions
|
@ -16,6 +16,7 @@ use malloc_size_of_derive::MallocSizeOf;
|
|||
use net_traits::filemanager_thread::RelativePos;
|
||||
use serde::{Deserialize, Serialize};
|
||||
use servo_url::ImmutableOrigin;
|
||||
use snapshot::Snapshot;
|
||||
use strum::EnumIter;
|
||||
use uuid::Uuid;
|
||||
|
||||
|
@ -321,9 +322,7 @@ impl BroadcastClone for DomException {
|
|||
#[derive(Clone, Debug, Deserialize, MallocSizeOf, Serialize)]
|
||||
/// A serializable version of the ImageBitmap interface.
|
||||
pub struct SerializableImageBitmap {
|
||||
pub width: u32,
|
||||
pub height: u32,
|
||||
pub bitmap_data: Vec<u8>,
|
||||
pub bitmap_data: Snapshot,
|
||||
}
|
||||
|
||||
impl BroadcastClone for SerializableImageBitmap {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue