mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Move Image and PixelFormat to net_traits.
This commit is contained in:
parent
e3ebbd0fcd
commit
dce2872f45
14 changed files with 40 additions and 32 deletions
|
@ -5,7 +5,6 @@
|
|||
//! The high-level interface from script to constellation. Using this abstract interface helps
|
||||
//! reduce coupling between these two components.
|
||||
|
||||
use ipc_channel::ipc::IpcSharedMemory;
|
||||
use std::cell::Cell;
|
||||
use std::fmt;
|
||||
use webrender_traits;
|
||||
|
@ -163,25 +162,6 @@ bitflags! {
|
|||
}
|
||||
}
|
||||
|
||||
#[derive(Clone, Copy, Deserialize, Eq, PartialEq, Serialize, HeapSizeOf)]
|
||||
pub enum PixelFormat {
|
||||
K8, // Luminance channel only
|
||||
KA8, // Luminance + alpha
|
||||
RGB8, // RGB, 8 bits per channel
|
||||
RGBA8, // RGB + alpha, 8 bits per channel
|
||||
}
|
||||
|
||||
#[derive(Clone, Deserialize, Serialize, HeapSizeOf)]
|
||||
pub struct Image {
|
||||
pub width: u32,
|
||||
pub height: u32,
|
||||
pub format: PixelFormat,
|
||||
#[ignore_heap_size_of = "Defined in ipc-channel"]
|
||||
pub bytes: IpcSharedMemory,
|
||||
#[ignore_heap_size_of = "Defined in webrender_traits"]
|
||||
pub id: Option<webrender_traits::ImageKey>,
|
||||
}
|
||||
|
||||
#[derive(Clone, PartialEq, Eq, Copy, Hash, Debug, Deserialize, Serialize)]
|
||||
pub enum TraversalDirection {
|
||||
Forward(usize),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue