mirror of
https://github.com/servo/servo.git
synced 2025-08-04 21:20:23 +01:00
pixels: Move Snapshot
and related data structures to pixels
(#37590)
1. The `shared` directory is for the "_traits" crates, which will likely be moved out of this directly at some point and renamed "_api". These crates expose the API of crates to avoid circular dependencies. `Snapshot` isn't really this. 2. `Snapshot` is essentially a specialied kind of `Image` so it makes sense that it is grouped with other image-related things in `pixels`. Testing: This should not change any behavior so is covered by existing tests. Signed-off-by: Martin Robinson <mrobinson@igalia.com>
This commit is contained in:
parent
80a7de8c9c
commit
309485d2db
32 changed files with 123 additions and 154 deletions
|
@ -19,10 +19,10 @@ use net_traits::{
|
|||
FetchMetadata, FetchResponseListener, FetchResponseMsg, NetworkError, ResourceFetchTiming,
|
||||
ResourceTimingType,
|
||||
};
|
||||
use pixels::{Snapshot, SnapshotAlphaMode, SnapshotPixelFormat};
|
||||
use script_layout_interface::{HTMLMediaData, MediaMetadata};
|
||||
use servo_media::player::video::VideoFrame;
|
||||
use servo_url::ServoUrl;
|
||||
use snapshot::Snapshot;
|
||||
use style::attr::{AttrValue, LengthOrPercentageOrAuto};
|
||||
|
||||
use crate::document_loader::{LoadBlocker, LoadType};
|
||||
|
@ -146,13 +146,13 @@ impl HTMLVideoElement {
|
|||
Some(frame) => {
|
||||
let size = Size2D::new(frame.get_width() as u32, frame.get_height() as u32);
|
||||
if !frame.is_gl_texture() {
|
||||
let alpha_mode = snapshot::AlphaMode::Transparent {
|
||||
let alpha_mode = SnapshotAlphaMode::Transparent {
|
||||
premultiplied: false,
|
||||
};
|
||||
|
||||
Some(Snapshot::from_vec(
|
||||
size.cast(),
|
||||
snapshot::PixelFormat::BGRA,
|
||||
SnapshotPixelFormat::BGRA,
|
||||
alpha_mode,
|
||||
frame.get_data().to_vec(),
|
||||
))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue