mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
Added Debug implementations.
This commit is contained in:
parent
07f6e11485
commit
a47e94c8f6
7 changed files with 53 additions and 6 deletions
|
@ -4,9 +4,10 @@
|
|||
|
||||
use ipc_channel::ipc::IpcSharedMemory;
|
||||
use piston_image::{self, DynamicImage, ImageFormat};
|
||||
use std::fmt;
|
||||
use webrender_traits;
|
||||
|
||||
#[derive(Clone, Copy, Deserialize, Eq, PartialEq, Serialize, HeapSizeOf)]
|
||||
#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize, HeapSizeOf)]
|
||||
pub enum PixelFormat {
|
||||
/// Luminance channel only
|
||||
K8,
|
||||
|
@ -29,7 +30,14 @@ pub struct Image {
|
|||
pub id: Option<webrender_traits::ImageKey>,
|
||||
}
|
||||
|
||||
#[derive(Clone, Deserialize, Eq, PartialEq, Serialize, HeapSizeOf)]
|
||||
impl fmt::Debug for Image {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
write!(f, "Image {{ width: {}, height: {}, format: {:?}, ..., id: {:?} }}",
|
||||
self.width, self.height, self.format, self.id)
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Deserialize, Eq, PartialEq, Serialize, HeapSizeOf)]
|
||||
pub struct ImageMetadata {
|
||||
pub width: u32,
|
||||
pub height: u32,
|
||||
|
|
|
@ -60,7 +60,7 @@ impl ImageResponder {
|
|||
}
|
||||
|
||||
/// The returned image.
|
||||
#[derive(Clone, Deserialize, Serialize, HeapSizeOf)]
|
||||
#[derive(Clone, Debug, Deserialize, Serialize, HeapSizeOf)]
|
||||
pub enum ImageResponse {
|
||||
/// The requested image was loaded.
|
||||
Loaded(Arc<Image>, ServoUrl),
|
||||
|
@ -84,7 +84,7 @@ pub enum ImageState {
|
|||
#[derive(Copy, Clone, PartialEq, Eq, Deserialize, Serialize, HeapSizeOf, Hash, Debug)]
|
||||
pub struct PendingImageId(pub u64);
|
||||
|
||||
#[derive(Deserialize, Serialize)]
|
||||
#[derive(Debug, Deserialize, Serialize)]
|
||||
pub struct PendingImageResponse {
|
||||
pub response: ImageResponse,
|
||||
pub id: PendingImageId,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue