From d97ed07b40ac05080f5db3d6c94c6f3a14f124ee Mon Sep 17 00:00:00 2001 From: Patrick Walton Date: Mon, 13 Jul 2015 14:08:08 -0700 Subject: [PATCH] Allow serialization of WebGL context attributes via `serde`. This will allow us to perform the multiprocess split. --- Cargo.toml | 2 ++ src/gl_context_attributes.rs | 2 +- src/lib.rs | 5 +++++ 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 6b380d9..f0abdf5 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -19,6 +19,8 @@ libc = "*" log = "*" gleam = "0.1" euclid = "0.1" +serde = "*" +serde_macros = "*" [dependencies.layers] git = "https://github.com/servo/rust-layers" diff --git a/src/gl_context_attributes.rs b/src/gl_context_attributes.rs index 04ef7c1..8bc58c9 100644 --- a/src/gl_context_attributes.rs +++ b/src/gl_context_attributes.rs @@ -1,7 +1,7 @@ /// This structure represents the attributes the context must support /// It's almost (if not) identical to WebGLGLContextAttributes -#[derive(Clone, Debug, Copy)] +#[derive(Clone, Debug, Copy, Deserialize, Serialize)] pub struct GLContextAttributes { pub alpha: bool, pub depth: bool, diff --git a/src/lib.rs b/src/lib.rs index e15c4e5..b676742 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,6 +1,11 @@ +#![feature(custom_derive)] +#![feature(plugin)] +#![plugin(serde_macros)] + extern crate gleam; extern crate libc; extern crate euclid; +extern crate serde; #[cfg(target_os="linux")] extern crate x11;