aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrandon Fairchild <csbit32@gmail.com>2015-12-20 19:21:51 -0500
committerBrandon Fairchild <csbit32@gmail.com>2015-12-20 20:43:31 -0500
commit637afecec972c290dcfe036df8e3fc7ebaa2bc0d (patch)
treef9335f79930f15ecd42cc851a9ef0ccb9453016a
parenta900196b3f56fac46f86d8a8157a61f14fdca364 (diff)
downloadservo-637afecec972c290dcfe036df8e3fc7ebaa2bc0d.tar.gz
servo-637afecec972c290dcfe036df8e3fc7ebaa2bc0d.zip
Move LayerKind and ScrollPolicy enums to gfx_traits
This also moves LayerId and LayerProperties to gfx_traits. Fixes #8836.
-rw-r--r--components/compositing/compositor.rs5
-rw-r--r--components/compositing/compositor_layer.rs3
-rw-r--r--components/compositing/compositor_task.rs4
-rw-r--r--components/gfx/display_list/mod.rs3
-rw-r--r--components/gfx/paint_context.rs3
-rw-r--r--components/gfx/paint_task.rs4
-rw-r--r--components/gfx_traits/Cargo.toml7
-rw-r--r--components/gfx_traits/lib.rs95
-rw-r--r--components/gfx_traits/paint_listener.rs4
-rw-r--r--components/layout/block.rs2
-rw-r--r--components/layout/context.rs2
-rw-r--r--components/layout/display_list_builder.rs3
-rw-r--r--components/layout/flow.rs3
-rw-r--r--components/layout/fragment.rs3
-rw-r--r--components/layout/layout_task.rs4
-rw-r--r--components/msg/compositor_msg.rs88
-rw-r--r--components/script/Cargo.toml3
-rw-r--r--components/script/dom/window.rs2
-rw-r--r--components/script/layout_interface.rs2
-rw-r--r--components/script/lib.rs1
-rw-r--r--components/script/script_task.rs2
-rw-r--r--components/script_traits/Cargo.toml3
-rw-r--r--components/script_traits/lib.rs4
-rw-r--r--components/servo/Cargo.lock5
-rw-r--r--ports/cef/Cargo.lock5
-rw-r--r--ports/gonk/Cargo.lock5
26 files changed, 150 insertions, 115 deletions
diff --git a/components/compositing/compositor.rs b/components/compositing/compositor.rs
index e530f192d78..bcf65be9aa1 100644
--- a/components/compositing/compositor.rs
+++ b/components/compositing/compositor.rs
@@ -14,7 +14,7 @@ use euclid::scale_factor::ScaleFactor;
use euclid::size::TypedSize2D;
use euclid::{Matrix4, Point2D, Rect, Size2D};
use gfx::paint_task::{ChromeToPaintMsg, PaintRequest};
-use gfx_traits::color;
+use gfx_traits::{color, LayerId, LayerKind, LayerProperties, ScrollPolicy};
use gleam::gl;
use gleam::gl::types::{GLint, GLsizei};
use image::{DynamicImage, ImageFormat, RgbImage};
@@ -27,8 +27,7 @@ use layers::rendergl;
use layers::rendergl::RenderContext;
use layers::scene::Scene;
use layout_traits::LayoutControlChan;
-use msg::compositor_msg::{Epoch, FrameTreeId, LayerId, LayerKind};
-use msg::compositor_msg::{LayerProperties, ScrollPolicy};
+use msg::compositor_msg::{Epoch, FrameTreeId};
use msg::constellation_msg::{AnimationState, Image, PixelFormat};
use msg::constellation_msg::{Key, KeyModifiers, KeyState, LoadData, MouseButton};
use msg::constellation_msg::{NavigationDirection, PipelineId, WindowSizeData};
diff --git a/components/compositing/compositor_layer.rs b/components/compositing/compositor_layer.rs
index 27308adddbc..157b98a68d4 100644
--- a/components/compositing/compositor_layer.rs
+++ b/components/compositing/compositor_layer.rs
@@ -8,10 +8,11 @@ use euclid::length::Length;
use euclid::point::{Point2D, TypedPoint2D};
use euclid::rect::Rect;
use euclid::size::TypedSize2D;
+use gfx_traits::{LayerId, LayerProperties, ScrollPolicy};
use layers::color::Color;
use layers::geometry::LayerPixel;
use layers::layers::{Layer, LayerBufferSet};
-use msg::compositor_msg::{Epoch, LayerId, LayerProperties, ScrollPolicy};
+use msg::compositor_msg::Epoch;
use msg::constellation_msg::{MouseEventType, PipelineId};
use script_traits::CompositorEvent;
use script_traits::CompositorEvent::{MouseButtonEvent, MouseMoveEvent};
diff --git a/components/compositing/compositor_task.rs b/components/compositing/compositor_task.rs
index 75943b7932f..293312b3778 100644
--- a/components/compositing/compositor_task.rs
+++ b/components/compositing/compositor_task.rs
@@ -8,12 +8,12 @@ use CompositorMsg as ConstellationMsg;
use compositor;
use euclid::point::Point2D;
use euclid::size::Size2D;
-use gfx_traits::PaintListener;
+use gfx_traits::{LayerId, LayerProperties, PaintListener};
use headless;
use ipc_channel::ipc::{self, IpcReceiver, IpcSender};
use layers::layers::{BufferRequest, LayerBufferSet};
use layers::platform::surface::{NativeDisplay, NativeSurface};
-use msg::compositor_msg::{Epoch, FrameTreeId, LayerId, LayerProperties};
+use msg::compositor_msg::{Epoch, FrameTreeId};
use msg::constellation_msg::{AnimationState, PipelineId};
use msg::constellation_msg::{Image, Key, KeyModifiers, KeyState};
use profile_traits::mem;
diff --git a/components/gfx/display_list/mod.rs b/components/gfx/display_list/mod.rs
index 88f70c9773e..bdb3e2e2d41 100644
--- a/components/gfx/display_list/mod.rs
+++ b/components/gfx/display_list/mod.rs
@@ -21,9 +21,8 @@ use display_list::optimizer::DisplayListOptimizer;
use euclid::approxeq::ApproxEq;
use euclid::num::Zero;
use euclid::{Matrix2D, Matrix4, Point2D, Rect, SideOffsets2D, Size2D};
-use gfx_traits::color;
+use gfx_traits::{color, LayerId, LayerKind, ScrollPolicy};
use libc::uintptr_t;
-use msg::compositor_msg::{LayerId, LayerKind, ScrollPolicy};
use msg::constellation_msg::PipelineId;
use net_traits::image::base::Image;
use paint_context::PaintContext;
diff --git a/components/gfx/paint_context.rs b/components/gfx/paint_context.rs
index 2f9049db39d..0000c62f0ca 100644
--- a/components/gfx/paint_context.rs
+++ b/components/gfx/paint_context.rs
@@ -26,8 +26,7 @@ use euclid::side_offsets::SideOffsets2D;
use euclid::size::Size2D;
use filters;
use font_context::FontContext;
-use gfx_traits::color;
-use msg::compositor_msg::LayerKind;
+use gfx_traits::{color, LayerKind};
use net_traits::image::base::{Image, PixelFormat};
use std::default::Default;
use std::sync::Arc;
diff --git a/components/gfx/paint_task.rs b/components/gfx/paint_task.rs
index c972ed7cfbc..9c9edcbe40b 100644
--- a/components/gfx/paint_task.rs
+++ b/components/gfx/paint_task.rs
@@ -15,11 +15,11 @@ use euclid::rect::Rect;
use euclid::size::Size2D;
use font_cache_task::FontCacheTask;
use font_context::FontContext;
-use gfx_traits::{color, PaintListener, PaintMsg as ConstellationMsg};
+use gfx_traits::{color, LayerId, LayerKind, LayerProperties, PaintListener, PaintMsg as ConstellationMsg, ScrollPolicy};
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::compositor_msg::{Epoch, FrameTreeId};
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 ce66910fd75..fd927351ed1 100644
--- a/components/gfx_traits/Cargo.toml
+++ b/components/gfx_traits/Cargo.toml
@@ -18,6 +18,13 @@ features = ["plugins"]
[dependencies.msg]
path = "../msg"
+[dependencies.plugins]
+path = "../plugins"
+
+[dependencies.util]
+path = "../util"
+
[dependencies]
+euclid = {version = "0.4", features = ["plugins"]}
serde = "0.6"
serde_macros = "0.6"
diff --git a/components/gfx_traits/lib.rs b/components/gfx_traits/lib.rs
index b2a7789089e..513969c9529 100644
--- a/components/gfx_traits/lib.rs
+++ b/components/gfx_traits/lib.rs
@@ -3,23 +3,114 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#![feature(custom_derive, plugin)]
-#![plugin(serde_macros)]
+#![plugin(plugins, serde_macros)]
+
#![crate_name = "gfx_traits"]
#![crate_type = "rlib"]
extern crate azure;
+extern crate euclid;
extern crate layers;
extern crate msg;
extern crate serde;
+extern crate util;
pub mod color;
mod paint_listener;
pub use paint_listener::PaintListener;
-use msg::constellation_msg::Failure;
+use azure::azure_hl::Color;
+use euclid::matrix::Matrix4;
+use euclid::rect::Rect;
+use msg::compositor_msg::LayerType;
+use msg::constellation_msg::{Failure, PipelineId};
+use std::fmt::{self, Debug, Formatter};
/// Messages from the paint task to the constellation.
#[derive(Deserialize, Serialize)]
pub enum PaintMsg {
Failure(Failure),
}
+
+#[derive(Clone, Copy, Debug, PartialEq)]
+pub enum LayerKind {
+ NoTransform,
+ HasTransform,
+}
+
+/// The scrolling policy of a layer.
+#[derive(Clone, PartialEq, Eq, Copy, Deserialize, Serialize, Debug, HeapSizeOf)]
+pub enum ScrollPolicy {
+ /// These layers scroll when the parent receives a scrolling message.
+ Scrollable,
+ /// These layers do not scroll when the parent receives a scrolling message.
+ FixedPosition,
+}
+
+#[derive(Clone, PartialEq, Eq, Copy, Hash, Deserialize, Serialize, HeapSizeOf)]
+pub struct LayerId(
+ /// The type of the layer. This serves to differentiate layers that share fragments.
+ LayerType,
+ /// The identifier for this layer's fragment, derived from the fragment memory address.
+ usize,
+ /// An index for identifying companion layers, synthesized to ensure that
+ /// content on top of this layer's fragment has the proper rendering order.
+ usize
+);
+
+impl Debug for LayerId {
+ fn fmt(&self, f: &mut Formatter) -> fmt::Result {
+ let LayerId(layer_type, id, companion) = *self;
+ let type_string = match layer_type {
+ LayerType::FragmentBody => "-FragmentBody",
+ LayerType::OverflowScroll => "-OverflowScroll",
+ LayerType::BeforePseudoContent => "-BeforePseudoContent",
+ LayerType::AfterPseudoContent => "-AfterPseudoContent",
+ };
+
+ write!(f, "{}{}-{}", id, type_string, companion)
+ }
+}
+
+impl LayerId {
+ /// FIXME(#2011, pcwalton): This is unfortunate. Maybe remove this in the future.
+ pub fn null() -> LayerId {
+ LayerId(LayerType::FragmentBody, 0, 0)
+ }
+
+ pub fn new_of_type(layer_type: LayerType, fragment_id: usize) -> LayerId {
+ LayerId(layer_type, fragment_id, 0)
+ }
+
+ pub fn companion_layer_id(&self) -> LayerId {
+ let LayerId(layer_type, id, companion) = *self;
+ LayerId(layer_type, id, companion + 1)
+ }
+}
+
+/// All layer-specific information that the painting task sends to the compositor other than the
+/// buffer contents of the layer itself.
+#[derive(Copy, Clone)]
+pub struct LayerProperties {
+ /// An opaque ID. This is usually the address of the flow and index of the box within it.
+ pub id: LayerId,
+ /// The id of the parent layer.
+ pub parent_id: Option<LayerId>,
+ /// The position and size of the layer in pixels.
+ pub rect: Rect<f32>,
+ /// The background color of the layer.
+ pub background_color: Color,
+ /// The scrolling policy of this layer.
+ pub scroll_policy: ScrollPolicy,
+ /// The transform for this layer
+ pub transform: Matrix4,
+ /// The perspective transform for this layer
+ pub perspective: Matrix4,
+ /// The subpage that this layer represents. If this is `Some`, this layer represents an
+ /// iframe.
+ pub subpage_pipeline_id: Option<PipelineId>,
+ /// Whether this layer establishes a new 3d rendering context.
+ pub establishes_3d_context: bool,
+ /// Whether this layer scrolls its overflow area.
+ pub scrolls_overflow_area: bool,
+}
diff --git a/components/gfx_traits/paint_listener.rs b/components/gfx_traits/paint_listener.rs
index 8ca8ff05488..74ba4c0318d 100644
--- a/components/gfx_traits/paint_listener.rs
+++ b/components/gfx_traits/paint_listener.rs
@@ -2,9 +2,11 @@
* 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/. */
+use LayerId;
+use LayerProperties;
use layers::layers::{BufferRequest, LayerBufferSet};
use layers::platform::surface::NativeDisplay;
-use msg::compositor_msg::{Epoch, FrameTreeId, LayerId, LayerProperties};
+use msg::compositor_msg::{Epoch, FrameTreeId};
use msg::constellation_msg::PipelineId;
/// The interface used by the painter to acquire draw targets for each paint frame and
diff --git a/components/layout/block.rs b/components/layout/block.rs
index a601e27891c..ebda80f4035 100644
--- a/components/layout/block.rs
+++ b/components/layout/block.rs
@@ -44,12 +44,12 @@ use flow::{self, BaseFlow, EarlyAbsolutePositionInfo, Flow, FlowClass, ForceNonf
use fragment::{CoordinateSystem, Fragment, FragmentBorderBoxIterator, HAS_LAYER};
use fragment::{SpecificFragmentInfo};
use gfx::display_list::{ClippingRegion, DisplayList};
+use gfx_traits::LayerId;
use incremental::{REFLOW, REFLOW_OUT_OF_FLOW};
use layout_debug;
use layout_task::DISPLAY_PORT_SIZE_FACTOR;
use model::{CollapsibleMargins, MaybeAuto, specified, specified_or_none};
use model::{IntrinsicISizes, MarginCollapseInfo};
-use msg::compositor_msg::LayerId;
use rustc_serialize::{Encodable, Encoder};
use std::cmp::{max, min};
use std::fmt;
diff --git a/components/layout/context.rs b/components/layout/context.rs
index 1520afd4c43..16ca36043ad 100644
--- a/components/layout/context.rs
+++ b/components/layout/context.rs
@@ -14,9 +14,9 @@ use fnv::FnvHasher;
use gfx::display_list::OpaqueNode;
use gfx::font_cache_task::FontCacheTask;
use gfx::font_context::FontContext;
+use gfx_traits::LayerId;
use ipc_channel::ipc::{self, IpcSender};
use msg::ParseErrorReporter;
-use msg::compositor_msg::LayerId;
use net_traits::image::base::Image;
use net_traits::image_cache_task::{ImageCacheChan, ImageCacheTask, ImageResponse, ImageState};
use net_traits::image_cache_task::{UsePlaceholder};
diff --git a/components/layout/display_list_builder.rs b/components/layout/display_list_builder.rs
index 96632c5d47d..97d22b5b4c0 100644
--- a/components/layout/display_list_builder.rs
+++ b/components/layout/display_list_builder.rs
@@ -31,12 +31,11 @@ use gfx::display_list::{LineDisplayItem, OpaqueNode, SolidColorDisplayItem};
use gfx::display_list::{StackingContext, TextDisplayItem, TextOrientation};
use gfx::paint_task::THREAD_TINT_COLORS;
use gfx::text::glyph::CharIndex;
-use gfx_traits::color;
+use gfx_traits::{color, ScrollPolicy};
use inline::{FIRST_FRAGMENT_OF_ELEMENT, InlineFlow, LAST_FRAGMENT_OF_ELEMENT};
use ipc_channel::ipc::{self, IpcSharedMemory};
use list_item::ListItemFlow;
use model::{self, MaybeAuto, ToGfxMatrix};
-use msg::compositor_msg::ScrollPolicy;
use net_traits::image::base::{Image, PixelFormat};
use net_traits::image_cache_task::UsePlaceholder;
use std::default::Default;
diff --git a/components/layout/flow.rs b/components/layout/flow.rs
index 0df6a7bd1d0..0440dcb52bb 100644
--- a/components/layout/flow.rs
+++ b/components/layout/flow.rs
@@ -34,10 +34,11 @@ use flow_list::{FlowList, FlowListIterator, MutFlowListIterator};
use flow_ref::{self, FlowRef, WeakFlowRef};
use fragment::{Fragment, FragmentBorderBoxIterator, SpecificFragmentInfo};
use gfx::display_list::{ClippingRegion, DisplayList};
+use gfx_traits::LayerId;
use incremental::{self, RECONSTRUCT_FLOW, REFLOW, REFLOW_OUT_OF_FLOW, RestyleDamage};
use inline::InlineFlow;
use model::{CollapsibleMargins, IntrinsicISizes, MarginCollapseInfo};
-use msg::compositor_msg::{LayerId, LayerType};
+use msg::compositor_msg::LayerType;
use multicol::MulticolFlow;
use parallel::FlowParallelInfo;
use rustc_serialize::{Encodable, Encoder};
diff --git a/components/layout/fragment.rs b/components/layout/fragment.rs
index 9113088889f..cf88e24aba3 100644
--- a/components/layout/fragment.rs
+++ b/components/layout/fragment.rs
@@ -17,13 +17,14 @@ use gfx;
use gfx::display_list::{BLUR_INFLATION_FACTOR, OpaqueNode};
use gfx::text::glyph::CharIndex;
use gfx::text::text_run::{TextRun, TextRunSlice};
+use gfx_traits::LayerId;
use incremental::{self, RECONSTRUCT_FLOW, RestyleDamage};
use inline::{FIRST_FRAGMENT_OF_ELEMENT, InlineFragmentContext, InlineFragmentNodeInfo};
use inline::{InlineMetrics, LAST_FRAGMENT_OF_ELEMENT};
use ipc_channel::ipc::IpcSender;
use layout_debug;
use model::{self, IntrinsicISizes, IntrinsicISizesContribution, MaybeAuto, specified};
-use msg::compositor_msg::{LayerId, LayerType};
+use msg::compositor_msg::LayerType;
use msg::constellation_msg::PipelineId;
use net_traits::image::base::Image;
use net_traits::image_cache_task::UsePlaceholder;
diff --git a/components/layout/layout_task.rs b/components/layout/layout_task.rs
index 05a86a5c24d..3063690778d 100644
--- a/components/layout/layout_task.rs
+++ b/components/layout/layout_task.rs
@@ -28,7 +28,7 @@ use gfx::font;
use gfx::font_cache_task::FontCacheTask;
use gfx::font_context;
use gfx::paint_task::{LayoutToPaintMsg, PaintLayer};
-use gfx_traits::color;
+use gfx_traits::{color, LayerId, ScrollPolicy};
use incremental::{LayoutDamageComputation, REFLOW, REFLOW_ENTIRE_DOCUMENT, REPAINT};
use ipc_channel::ipc::{self, IpcReceiver, IpcSender};
use ipc_channel::router::ROUTER;
@@ -36,7 +36,7 @@ use layout_debug;
use layout_traits::LayoutTaskFactory;
use log;
use msg::ParseErrorReporter;
-use msg::compositor_msg::{Epoch, LayerId, ScrollPolicy};
+use msg::compositor_msg::Epoch;
use msg::constellation_msg::{ConstellationChan, Failure, PipelineId};
use net_traits::image_cache_task::{ImageCacheChan, ImageCacheResult, ImageCacheTask};
use parallel::{self, WorkQueueData};
diff --git a/components/msg/compositor_msg.rs b/components/msg/compositor_msg.rs
index 7c1d615fd06..f0edf15db70 100644
--- a/components/msg/compositor_msg.rs
+++ b/components/msg/compositor_msg.rs
@@ -2,11 +2,6 @@
* 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/. */
-use azure::azure_hl::Color;
-use constellation_msg::PipelineId;
-use euclid::{Matrix4, Rect};
-use std::fmt::{self, Debug, Formatter};
-
/// A newtype struct for denoting the age of messages; prevents race conditions.
#[derive(PartialEq, Eq, Debug, Copy, Clone, PartialOrd, Ord, Deserialize, Serialize)]
pub struct Epoch(pub u32);
@@ -39,86 +34,3 @@ pub enum LayerType {
/// A layer created to contain ::after pseudo-element content.
AfterPseudoContent,
}
-
-#[derive(Clone, PartialEq, Eq, Copy, Hash, Deserialize, Serialize, HeapSizeOf)]
-pub struct LayerId(
- /// The type of the layer. This serves to differentiate layers that share fragments.
- LayerType,
- /// The identifier for this layer's fragment, derived from the fragment memory address.
- usize,
- /// An index for identifying companion layers, synthesized to ensure that
- /// content on top of this layer's fragment has the proper rendering order.
- usize
-);
-
-impl Debug for LayerId {
- fn fmt(&self, f: &mut Formatter) -> fmt::Result {
- let LayerId(layer_type, id, companion) = *self;
- let type_string = match layer_type {
- LayerType::FragmentBody => "-FragmentBody",
- LayerType::OverflowScroll => "-OverflowScroll",
- LayerType::BeforePseudoContent => "-BeforePseudoContent",
- LayerType::AfterPseudoContent => "-AfterPseudoContent",
- };
-
- write!(f, "{}{}-{}", id, type_string, companion)
- }
-}
-
-impl LayerId {
- /// FIXME(#2011, pcwalton): This is unfortunate. Maybe remove this in the future.
- pub fn null() -> LayerId {
- LayerId(LayerType::FragmentBody, 0, 0)
- }
-
- pub fn new_of_type(layer_type: LayerType, fragment_id: usize) -> LayerId {
- LayerId(layer_type, fragment_id, 0)
- }
-
- pub fn companion_layer_id(&self) -> LayerId {
- let LayerId(layer_type, id, companion) = *self;
- LayerId(layer_type, id, companion + 1)
- }
-}
-
-#[derive(Clone, Copy, Debug, PartialEq)]
-pub enum LayerKind {
- NoTransform,
- HasTransform,
-}
-
-/// The scrolling policy of a layer.
-#[derive(Clone, PartialEq, Eq, Copy, Deserialize, Serialize, Debug, HeapSizeOf)]
-pub enum ScrollPolicy {
- /// These layers scroll when the parent receives a scrolling message.
- Scrollable,
- /// These layers do not scroll when the parent receives a scrolling message.
- FixedPosition,
-}
-
-/// All layer-specific information that the painting task sends to the compositor other than the
-/// buffer contents of the layer itself.
-#[derive(Copy, Clone)]
-pub struct LayerProperties {
- /// An opaque ID. This is usually the address of the flow and index of the box within it.
- pub id: LayerId,
- /// The id of the parent layer.
- pub parent_id: Option<LayerId>,
- /// The position and size of the layer in pixels.
- pub rect: Rect<f32>,
- /// The background color of the layer.
- pub background_color: Color,
- /// The scrolling policy of this layer.
- pub scroll_policy: ScrollPolicy,
- /// The transform for this layer
- pub transform: Matrix4,
- /// The perspective transform for this layer
- pub perspective: Matrix4,
- /// The subpage that this layer represents. If this is `Some`, this layer represents an
- /// iframe.
- pub subpage_pipeline_id: Option<PipelineId>,
- /// Whether this layer establishes a new 3d rendering context.
- pub establishes_3d_context: bool,
- /// Whether this layer scrolls its overflow area.
- pub scrolls_overflow_area: bool,
-}
diff --git a/components/script/Cargo.toml b/components/script/Cargo.toml
index b24c6287691..8abc8e8133e 100644
--- a/components/script/Cargo.toml
+++ b/components/script/Cargo.toml
@@ -62,6 +62,9 @@ git = "https://github.com/servo/ipc-channel"
git = "https://github.com/Ygg01/xml5ever"
features = ["unstable"]
+[dependencies.gfx_traits]
+path = "../gfx_traits"
+
[dependencies]
app_units = {version = "0.1", features = ["plugins"]}
cssparser = { version = "0.4", features = [ "serde-serialization" ] }
diff --git a/components/script/dom/window.rs b/components/script/dom/window.rs
index 602f815ebe7..5651519318f 100644
--- a/components/script/dom/window.rs
+++ b/components/script/dom/window.rs
@@ -33,6 +33,7 @@ use dom::performance::Performance;
use dom::screen::Screen;
use dom::storage::Storage;
use euclid::{Point2D, Rect, Size2D};
+use gfx_traits::LayerId;
use ipc_channel::ipc::{self, IpcSender};
use js::jsapi::{Evaluate2, MutableHandleValue};
use js::jsapi::{HandleValue, JSContext};
@@ -43,7 +44,6 @@ use layout_interface::{ContentBoxResponse, ContentBoxesResponse, ResolvedStyleRe
use layout_interface::{LayoutChan, LayoutRPC, Msg, Reflow, ReflowGoal, ReflowQueryType};
use libc;
use msg::ParseErrorReporter;
-use msg::compositor_msg::LayerId;
use msg::constellation_msg::{ConstellationChan, DocumentState, LoadData};
use msg::constellation_msg::{MozBrowserEvent, PipelineId, SubpageId, WindowSizeData};
use msg::webdriver_msg::{WebDriverJSError, WebDriverJSResult};
diff --git a/components/script/layout_interface.rs b/components/script/layout_interface.rs
index 87a4e8f7ca6..a533fd6418d 100644
--- a/components/script/layout_interface.rs
+++ b/components/script/layout_interface.rs
@@ -10,10 +10,10 @@ use app_units::Au;
use dom::node::LayoutData;
use euclid::point::Point2D;
use euclid::rect::Rect;
+use gfx_traits::LayerId;
use ipc_channel::ipc::{IpcReceiver, IpcSender};
use libc::uintptr_t;
use msg::compositor_msg::Epoch;
-use msg::compositor_msg::LayerId;
use msg::constellation_msg::{ConstellationChan, Failure, PipelineId};
use msg::constellation_msg::{WindowSizeData};
use net_traits::image_cache_task::ImageCacheTask;
diff --git a/components/script/lib.rs b/components/script/lib.rs
index cec53d69ae2..743b56be20f 100644
--- a/components/script/lib.rs
+++ b/components/script/lib.rs
@@ -43,6 +43,7 @@ extern crate devtools_traits;
extern crate encoding;
extern crate euclid;
extern crate fnv;
+extern crate gfx_traits;
extern crate html5ever;
extern crate hyper;
extern crate image;
diff --git a/components/script/script_task.rs b/components/script/script_task.rs
index 94193b3077a..953bf3dacde 100644
--- a/components/script/script_task.rs
+++ b/components/script/script_task.rs
@@ -42,6 +42,7 @@ use dom::window::{ReflowReason, ScriptHelpers, Window};
use dom::worker::TrustedWorkerAddress;
use euclid::Rect;
use euclid::point::Point2D;
+use gfx_traits::LayerId;
use hyper::header::{ContentType, HttpDate};
use hyper::header::{Headers, LastModified};
use hyper::method::Method;
@@ -61,7 +62,6 @@ use layout_interface::{ReflowQueryType};
use layout_interface::{self, LayoutChan, NewLayoutTaskInfo, ReflowGoal, ScriptLayoutChan};
use libc;
use mem::heap_size_of_self_and_children;
-use msg::compositor_msg::LayerId;
use msg::constellation_msg::{ConstellationChan, LoadData};
use msg::constellation_msg::{MouseButton, MouseEventType, MozBrowserEvent, PipelineId};
use msg::constellation_msg::{PipelineNamespace};
diff --git a/components/script_traits/Cargo.toml b/components/script_traits/Cargo.toml
index 36ea9b5d274..1d53b0c5869 100644
--- a/components/script_traits/Cargo.toml
+++ b/components/script_traits/Cargo.toml
@@ -10,6 +10,9 @@ path = "lib.rs"
[dependencies.canvas_traits]
path = "../canvas_traits"
+[dependencies.gfx_traits]
+path = "../gfx_traits"
+
[dependencies.msg]
path = "../msg"
diff --git a/components/script_traits/lib.rs b/components/script_traits/lib.rs
index e06fbf32c10..c305b75e2fc 100644
--- a/components/script_traits/lib.rs
+++ b/components/script_traits/lib.rs
@@ -14,6 +14,7 @@ extern crate app_units;
extern crate canvas_traits;
extern crate devtools_traits;
extern crate euclid;
+extern crate gfx_traits;
extern crate ipc_channel;
extern crate libc;
extern crate msg;
@@ -34,9 +35,10 @@ use euclid::Size2D;
use euclid::length::Length;
use euclid::point::Point2D;
use euclid::rect::Rect;
+use gfx_traits::LayerId;
use ipc_channel::ipc::{IpcReceiver, IpcSender};
use libc::c_void;
-use msg::compositor_msg::{Epoch, LayerId};
+use msg::compositor_msg::Epoch;
use msg::constellation_msg::{ConstellationChan, Failure, PipelineId, WindowSizeData};
use msg::constellation_msg::{Key, KeyModifiers, KeyState, LoadData, SubpageId};
use msg::constellation_msg::{MouseButton, MouseEventType};
diff --git a/components/servo/Cargo.lock b/components/servo/Cargo.lock
index 08fcc44cf5e..51035235d0a 100644
--- a/components/servo/Cargo.lock
+++ b/components/servo/Cargo.lock
@@ -656,10 +656,13 @@ name = "gfx_traits"
version = "0.0.1"
dependencies = [
"azure 0.2.1 (git+https://github.com/servo/rust-azure)",
+ "euclid 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
"layers 0.2.0 (git+https://github.com/servo/rust-layers)",
"msg 0.0.1",
+ "plugins 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)",
+ "util 0.0.1",
]
[[package]]
@@ -1507,6 +1510,7 @@ dependencies = [
"encoding 0.2.32 (registry+https://github.com/rust-lang/crates.io-index)",
"euclid 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
"fnv 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "gfx_traits 0.0.1",
"html5ever 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)",
"hyper 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
"image 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -1557,6 +1561,7 @@ dependencies = [
"canvas_traits 0.0.1",
"devtools_traits 0.0.1",
"euclid 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "gfx_traits 0.0.1",
"ipc-channel 0.1.0 (git+https://github.com/servo/ipc-channel)",
"libc 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
"msg 0.0.1",
diff --git a/ports/cef/Cargo.lock b/ports/cef/Cargo.lock
index e10d54059d2..7c2e3c488be 100644
--- a/ports/cef/Cargo.lock
+++ b/ports/cef/Cargo.lock
@@ -616,10 +616,13 @@ name = "gfx_traits"
version = "0.0.1"
dependencies = [
"azure 0.2.1 (git+https://github.com/servo/rust-azure)",
+ "euclid 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
"layers 0.2.0 (git+https://github.com/servo/rust-layers)",
"msg 0.0.1",
+ "plugins 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)",
+ "util 0.0.1",
]
[[package]]
@@ -1432,6 +1435,7 @@ dependencies = [
"encoding 0.2.32 (registry+https://github.com/rust-lang/crates.io-index)",
"euclid 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
"fnv 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "gfx_traits 0.0.1",
"html5ever 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)",
"hyper 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
"image 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -1473,6 +1477,7 @@ dependencies = [
"canvas_traits 0.0.1",
"devtools_traits 0.0.1",
"euclid 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "gfx_traits 0.0.1",
"ipc-channel 0.1.0 (git+https://github.com/servo/ipc-channel)",
"libc 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
"msg 0.0.1",
diff --git a/ports/gonk/Cargo.lock b/ports/gonk/Cargo.lock
index 8207fb8d522..3c18731468e 100644
--- a/ports/gonk/Cargo.lock
+++ b/ports/gonk/Cargo.lock
@@ -606,10 +606,13 @@ name = "gfx_traits"
version = "0.0.1"
dependencies = [
"azure 0.2.1 (git+https://github.com/servo/rust-azure)",
+ "euclid 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
"layers 0.2.0 (git+https://github.com/servo/rust-layers)",
"msg 0.0.1",
+ "plugins 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)",
+ "util 0.0.1",
]
[[package]]
@@ -1400,6 +1403,7 @@ dependencies = [
"encoding 0.2.32 (registry+https://github.com/rust-lang/crates.io-index)",
"euclid 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
"fnv 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "gfx_traits 0.0.1",
"html5ever 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)",
"hyper 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
"image 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -1441,6 +1445,7 @@ dependencies = [
"canvas_traits 0.0.1",
"devtools_traits 0.0.1",
"euclid 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "gfx_traits 0.0.1",
"ipc-channel 0.1.0 (git+https://github.com/servo/ipc-channel)",
"libc 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
"msg 0.0.1",