mirror of
https://github.com/servo/servo.git
synced 2025-08-05 21:50:18 +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
|
@ -18,10 +18,10 @@ compositing_traits = { workspace = true }
|
|||
euclid = { workspace = true }
|
||||
ipc-channel = { workspace = true }
|
||||
log = { workspace = true }
|
||||
pixels = { path = "../pixels" }
|
||||
serde = { workspace = true, features = ["serde_derive"] }
|
||||
servo_config = { path = "../config" }
|
||||
webgpu_traits = { workspace = true }
|
||||
snapshot = { workspace = true }
|
||||
webrender = { workspace = true }
|
||||
webrender_api = { workspace = true }
|
||||
wgpu-core = { workspace = true, features = ["serde", "wgsl"] }
|
||||
|
|
|
@ -12,8 +12,8 @@ use compositing_traits::{WebrenderExternalImageApi, WebrenderImageSource};
|
|||
use euclid::default::Size2D;
|
||||
use ipc_channel::ipc::IpcSender;
|
||||
use log::{error, warn};
|
||||
use pixels::{IpcSnapshot, Snapshot, SnapshotAlphaMode, SnapshotPixelFormat};
|
||||
use serde::{Deserialize, Serialize};
|
||||
use snapshot::{IpcSnapshot, Snapshot};
|
||||
use webgpu_traits::{
|
||||
ContextConfiguration, Error, PRESENTATION_BUFFER_COUNT, WebGPUContextId, WebGPUMsg,
|
||||
};
|
||||
|
@ -375,16 +375,16 @@ impl crate::WGPU {
|
|||
.and_then(|swap_chain| swap_chain.data.as_ref())
|
||||
{
|
||||
let format = match context_data.image_desc.0.format {
|
||||
ImageFormat::RGBA8 => snapshot::PixelFormat::RGBA,
|
||||
ImageFormat::BGRA8 => snapshot::PixelFormat::BGRA,
|
||||
ImageFormat::RGBA8 => SnapshotPixelFormat::RGBA,
|
||||
ImageFormat::BGRA8 => SnapshotPixelFormat::BGRA,
|
||||
_ => unimplemented!(),
|
||||
};
|
||||
let alpha_mode = if context_data.image_desc.0.is_opaque() {
|
||||
snapshot::AlphaMode::AsOpaque {
|
||||
SnapshotAlphaMode::AsOpaque {
|
||||
premultiplied: false,
|
||||
}
|
||||
} else {
|
||||
snapshot::AlphaMode::Transparent {
|
||||
SnapshotAlphaMode::Transparent {
|
||||
premultiplied: true,
|
||||
}
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue