From 637afecec972c290dcfe036df8e3fc7ebaa2bc0d Mon Sep 17 00:00:00 2001 From: Brandon Fairchild Date: Sun, 20 Dec 2015 19:21:51 -0500 Subject: [PATCH] Move LayerKind and ScrollPolicy enums to gfx_traits This also moves LayerId and LayerProperties to gfx_traits. Fixes #8836. --- components/compositing/compositor.rs | 5 +- components/compositing/compositor_layer.rs | 3 +- components/compositing/compositor_task.rs | 4 +- components/gfx/display_list/mod.rs | 3 +- components/gfx/paint_context.rs | 3 +- components/gfx/paint_task.rs | 4 +- components/gfx_traits/Cargo.toml | 7 ++ components/gfx_traits/lib.rs | 95 +++++++++++++++++++++- components/gfx_traits/paint_listener.rs | 4 +- components/layout/block.rs | 2 +- components/layout/context.rs | 2 +- components/layout/display_list_builder.rs | 3 +- components/layout/flow.rs | 3 +- components/layout/fragment.rs | 3 +- components/layout/layout_task.rs | 4 +- components/msg/compositor_msg.rs | 88 -------------------- components/script/Cargo.toml | 3 + components/script/dom/window.rs | 2 +- components/script/layout_interface.rs | 2 +- components/script/lib.rs | 1 + components/script/script_task.rs | 2 +- components/script_traits/Cargo.toml | 3 + components/script_traits/lib.rs | 4 +- components/servo/Cargo.lock | 5 ++ ports/cef/Cargo.lock | 5 ++ ports/gonk/Cargo.lock | 5 ++ 26 files changed, 150 insertions(+), 115 deletions(-) diff --git a/components/compositing/compositor.rs b/components/compositing/compositor.rs index e530f192d78a..bcf65be9aa1f 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 27308adddbcc..157b98a68d44 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 75943b7932fb..293312b37782 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 88f70c9773ee..bdb3e2e2d41b 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 2f9049db39d3..0000c62f0caf 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 c972ed7cfbc0..9c9edcbe40bd 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 ce66910fd756..fd927351ed17 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 b2a7789089e2..513969c9529f 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, + /// The position and size of the layer in pixels. + pub rect: Rect, + /// 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, + /// 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 8ca8ff05488b..74ba4c0318d6 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 a601e27891ca..ebda80f40358 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 1520afd4c43c..16ca36043adf 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 96632c5d47df..97d22b5b4c08 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 0df6a7bd1d01..0440dcb52bbd 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 9113088889f9..cf88e24aba3d 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 05a86a5c24d5..3063690778d2 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 7c1d615fd069..f0edf15db708 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, - /// The position and size of the layer in pixels. - pub rect: Rect, - /// 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, - /// 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 b24c62876914..8abc8e8133e6 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 602f815ebe7b..5651519318fa 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 87a4e8f7ca6d..a533fd6418d6 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 cec53d69ae2a..743b56be20fa 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 94193b3077a6..953bf3dacde7 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 36ea9b5d2741..1d53b0c5869b 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 e06fbf32c108..c305b75e2fc2 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 08fcc44cf5eb..51035235d0a5 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 e10d54059d29..7c2e3c488bed 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 8207fb8d5228..3c18731468e9 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",