diff options
author | bors-servo <lbergstrom+bors@mozilla.com> | 2015-12-20 01:34:26 +0530 |
---|---|---|
committer | bors-servo <lbergstrom+bors@mozilla.com> | 2015-12-20 01:34:26 +0530 |
commit | 95eabdb4dbdc00937eeea5b495002d5526217f93 (patch) | |
tree | 5f148681fbcc7482cfd09068726e7c21f671fdae | |
parent | 8c87477138e655810769607ce2c049d461c1c88a (diff) | |
parent | 3f7f323556edd0026ce03b7e15b44dea5cab5963 (diff) | |
download | servo-95eabdb4dbdc00937eeea5b495002d5526217f93.tar.gz servo-95eabdb4dbdc00937eeea5b495002d5526217f93.zip |
Auto merge of #9022 - mskrzypkows:PaintMsg_refactoring, r=jdm
Move PaintMsg enum to gfx_traits #8844
re-PR of https://github.com/servo/servo/pull/9007, because homu seems stuck
Fixes #8844.
<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/9022)
<!-- Reviewable:end -->
-rw-r--r-- | components/compositing/constellation.rs | 2 | ||||
-rw-r--r-- | components/compositing/pipeline.rs | 2 | ||||
-rw-r--r-- | components/gfx/paint_task.rs | 3 | ||||
-rw-r--r-- | components/gfx_traits/Cargo.toml | 4 | ||||
-rw-r--r-- | components/gfx_traits/lib.rs | 10 | ||||
-rw-r--r-- | components/msg/constellation_msg.rs | 6 | ||||
-rw-r--r-- | components/servo/Cargo.lock | 2 | ||||
-rw-r--r-- | ports/cef/Cargo.lock | 2 | ||||
-rw-r--r-- | ports/gonk/Cargo.lock | 2 |
9 files changed, 23 insertions, 10 deletions
diff --git a/components/compositing/constellation.rs b/components/compositing/constellation.rs index 131dfbd9e1d..0d59d06d028 100644 --- a/components/compositing/constellation.rs +++ b/components/compositing/constellation.rs @@ -22,12 +22,12 @@ use euclid::size::{Size2D, TypedSize2D}; use gaol; use gaol::sandbox::{self, Sandbox, SandboxMethods}; use gfx::font_cache_task::FontCacheTask; +use gfx_traits::PaintMsg as FromPaintMsg; use ipc_channel::ipc::{self, IpcOneShotServer, IpcSender}; use ipc_channel::router::ROUTER; use layout_traits::{LayoutControlChan, LayoutTaskFactory}; use msg::compositor_msg::Epoch; use msg::constellation_msg::AnimationState; -use msg::constellation_msg::PaintMsg as FromPaintMsg; use msg::constellation_msg::WebDriverCommandMsg; use msg::constellation_msg::{DocumentState, FrameId, PipelineId}; use msg::constellation_msg::{IframeLoadInfo, IFrameSandboxState, MozBrowserEvent, NavigationDirection}; diff --git a/components/compositing/pipeline.rs b/components/compositing/pipeline.rs index ffcb915153c..e33803fdd40 100644 --- a/components/compositing/pipeline.rs +++ b/components/compositing/pipeline.rs @@ -10,12 +10,12 @@ use euclid::scale_factor::ScaleFactor; use euclid::size::TypedSize2D; use gfx::font_cache_task::FontCacheTask; use gfx::paint_task::{ChromeToPaintMsg, LayoutToPaintMsg, PaintTask}; +use gfx_traits::PaintMsg; use ipc_channel::ipc::{self, IpcReceiver, IpcSender}; use ipc_channel::router::ROUTER; use layers::geometry::DevicePixel; use layout_traits::{LayoutControlChan, LayoutTaskFactory}; use msg::compositor_msg::ScriptToCompositorMsg; -use msg::constellation_msg::PaintMsg; use msg::constellation_msg::{ConstellationChan, Failure, FrameId, PipelineId, SubpageId}; use msg::constellation_msg::{LoadData, MozBrowserEvent, WindowSizeData}; use msg::constellation_msg::{PipelineNamespaceId}; diff --git a/components/gfx/paint_task.rs b/components/gfx/paint_task.rs index 6924b35f2c8..c972ed7cfbc 100644 --- a/components/gfx/paint_task.rs +++ b/components/gfx/paint_task.rs @@ -15,12 +15,11 @@ use euclid::rect::Rect; use euclid::size::Size2D; use font_cache_task::FontCacheTask; use font_context::FontContext; -use gfx_traits::{PaintListener, color}; +use gfx_traits::{color, PaintListener, PaintMsg as ConstellationMsg}; use ipc_channel::ipc::IpcSender; use layers::layers::{BufferRequest, LayerBuffer, LayerBufferSet}; use layers::platform::surface::{NativeDisplay, NativeSurface}; use msg::compositor_msg::{Epoch, FrameTreeId, LayerId, LayerKind, LayerProperties, ScrollPolicy}; -use msg::constellation_msg::PaintMsg as ConstellationMsg; use msg::constellation_msg::{ConstellationChan, Failure, PipelineId}; use paint_context::PaintContext; use profile_traits::mem::{self, ReportsChan}; diff --git a/components/gfx_traits/Cargo.toml b/components/gfx_traits/Cargo.toml index 6289f073cc7..ce66910fd75 100644 --- a/components/gfx_traits/Cargo.toml +++ b/components/gfx_traits/Cargo.toml @@ -17,3 +17,7 @@ features = ["plugins"] [dependencies.msg] path = "../msg" + +[dependencies] +serde = "0.6" +serde_macros = "0.6" diff --git a/components/gfx_traits/lib.rs b/components/gfx_traits/lib.rs index 2500db1db20..b2a7789089e 100644 --- a/components/gfx_traits/lib.rs +++ b/components/gfx_traits/lib.rs @@ -2,14 +2,24 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ +#![feature(custom_derive, plugin)] +#![plugin(serde_macros)] #![crate_name = "gfx_traits"] #![crate_type = "rlib"] extern crate azure; extern crate layers; extern crate msg; +extern crate serde; pub mod color; mod paint_listener; pub use paint_listener::PaintListener; +use msg::constellation_msg::Failure; + +/// Messages from the paint task to the constellation. +#[derive(Deserialize, Serialize)] +pub enum PaintMsg { + Failure(Failure), +} diff --git a/components/msg/constellation_msg.rs b/components/msg/constellation_msg.rs index bd03f7769b7..6f1acd219cf 100644 --- a/components/msg/constellation_msg.rs +++ b/components/msg/constellation_msg.rs @@ -241,12 +241,6 @@ pub enum MouseButton { Right, } -/// Messages from the paint task to the constellation. -#[derive(Deserialize, Serialize)] -pub enum PaintMsg { - Failure(Failure), -} - #[derive(Clone, Eq, PartialEq, Deserialize, Serialize, Debug)] pub enum AnimationState { AnimationsPresent, diff --git a/components/servo/Cargo.lock b/components/servo/Cargo.lock index 83368e8df21..08fcc44cf5e 100644 --- a/components/servo/Cargo.lock +++ b/components/servo/Cargo.lock @@ -658,6 +658,8 @@ dependencies = [ "azure 0.2.1 (git+https://github.com/servo/rust-azure)", "layers 0.2.0 (git+https://github.com/servo/rust-layers)", "msg 0.0.1", + "serde 0.6.6 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_macros 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] diff --git a/ports/cef/Cargo.lock b/ports/cef/Cargo.lock index 9c3bd919b2d..e10d54059d2 100644 --- a/ports/cef/Cargo.lock +++ b/ports/cef/Cargo.lock @@ -618,6 +618,8 @@ dependencies = [ "azure 0.2.1 (git+https://github.com/servo/rust-azure)", "layers 0.2.0 (git+https://github.com/servo/rust-layers)", "msg 0.0.1", + "serde 0.6.6 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_macros 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] diff --git a/ports/gonk/Cargo.lock b/ports/gonk/Cargo.lock index 95ee579945e..8207fb8d522 100644 --- a/ports/gonk/Cargo.lock +++ b/ports/gonk/Cargo.lock @@ -608,6 +608,8 @@ dependencies = [ "azure 0.2.1 (git+https://github.com/servo/rust-azure)", "layers 0.2.0 (git+https://github.com/servo/rust-layers)", "msg 0.0.1", + "serde 0.6.6 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_macros 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] |