gfx: Make display lists serializable using serde.

This commit introduces the `serde` dependency, which we will use to
serialize messages going between processes in multiprocess Servo.

This also adds a new debugging flag, `-Z print-display-list-json`,
allowing the output of display list serialization to be visualized.
This will be useful for our experiments with alternate rasterizers.
This commit is contained in:
Patrick Walton 2015-07-08 16:15:23 -07:00
parent b6b95085fb
commit 6eacb0c995
30 changed files with 320 additions and 124 deletions

View file

@ -34,3 +34,6 @@ smallvec = "0.1"
string_cache = "0.1"
string_cache_plugin = "0.1"
euclid = "0.1"
serde = "*"
serde_macros = "*"

View file

@ -10,9 +10,9 @@
#![feature(hasher_write)]
#![feature(plugin)]
#![feature(vec_push_all)]
#![feature(vec_push_all)]
#![plugin(string_cache_plugin)]
#![plugin(serde_macros)]
#![plugin(plugins)]
#[macro_use] extern crate log;
@ -20,6 +20,7 @@
extern crate fnv;
extern crate euclid;
extern crate serde;
extern crate smallvec;
extern crate url;

View file

@ -3050,7 +3050,7 @@ pub mod longhands {
use values::CSSFloat;
use values::specified::{Angle};
#[derive(Clone, PartialEq, Debug, HeapSizeOf)]
#[derive(Clone, PartialEq, Debug, HeapSizeOf, Deserialize, Serialize)]
pub enum Filter {
Blur(Au),
Brightness(CSSFloat),
@ -3063,7 +3063,7 @@ pub mod longhands {
Sepia(CSSFloat),
}
#[derive(Clone, PartialEq, Debug, HeapSizeOf)]
#[derive(Clone, PartialEq, Debug, HeapSizeOf, Deserialize, Serialize)]
pub struct T { pub filters: Vec<Filter> }
impl T {
@ -3857,7 +3857,7 @@ pub mod longhands {
use cssparser::ToCss;
use std::fmt;
#[derive(Copy, Clone, Debug, PartialEq, HeapSizeOf)]
#[derive(Copy, Clone, Debug, PartialEq, HeapSizeOf, Deserialize, Serialize)]
pub enum T {
Auto,
CrispEdges,

View file

@ -13,6 +13,7 @@ macro_rules! define_css_keyword_enum {
($name: ident: $( $css: expr => $variant: ident ),+) => {
#[allow(non_camel_case_types)]
#[derive(Clone, Eq, PartialEq, Copy, Hash, RustcEncodable, Debug, HeapSizeOf)]
#[derive(Deserialize, Serialize)]
pub enum $name {
$( $variant ),+
}
@ -44,6 +45,7 @@ macro_rules! define_numbered_css_keyword_enum {
($name: ident: $( $css: expr => $variant: ident = $value: expr ),+) => {
#[allow(non_camel_case_types)]
#[derive(Clone, Eq, PartialEq, PartialOrd, Ord, Copy, RustcEncodable, Debug, HeapSizeOf)]
#[derive(Deserialize, Serialize)]
pub enum $name {
$( $variant = $value ),+
}
@ -645,7 +647,7 @@ pub mod specified {
}
}
#[derive(Clone, PartialEq, PartialOrd, Copy, Debug, HeapSizeOf)]
#[derive(Clone, PartialEq, PartialOrd, Copy, Debug, HeapSizeOf, Deserialize, Serialize)]
pub struct Angle(pub CSSFloat);
impl ToCss for Angle {