diff options
author | bors-servo <lbergstrom+bors@mozilla.com> | 2016-05-09 03:14:03 -0700 |
---|---|---|
committer | bors-servo <lbergstrom+bors@mozilla.com> | 2016-05-09 03:14:03 -0700 |
commit | 9a8c81773a7dc51301e52ce3f02f8ea55984365a (patch) | |
tree | 54c01ac02b0e47fe59bce0aac7addae4c8cf817c /components | |
parent | 33fa63a3c5f2f2df27b68ca67cf46bf9788d8723 (diff) | |
parent | 8b6a6097646ba1d5f89ee851b3e02685fb080757 (diff) | |
download | servo-9a8c81773a7dc51301e52ce3f02f8ea55984365a.tar.gz servo-9a8c81773a7dc51301e52ce3f02f8ea55984365a.zip |
Auto merge of #11084 - kevgs:layout_traits, r=Ms2ger
move trait ConvertPipelineIdToWebRender to a better place
<!-- Reviewable:start -->
This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/11084)
<!-- Reviewable:end -->
Diffstat (limited to 'components')
-rw-r--r-- | components/compositing/compositor.rs | 4 | ||||
-rw-r--r-- | components/layout/layout_thread.rs | 4 | ||||
-rw-r--r-- | components/layout/webrender_helpers.rs | 2 | ||||
-rw-r--r-- | components/layout_traits/lib.rs | 14 | ||||
-rw-r--r-- | components/msg/constellation_msg.rs | 12 |
5 files changed, 18 insertions, 18 deletions
diff --git a/components/compositing/compositor.rs b/components/compositing/compositor.rs index 35b6c8133b6..f6069f5f9d4 100644 --- a/components/compositing/compositor.rs +++ b/components/compositing/compositor.rs @@ -28,8 +28,8 @@ use layers::platform::surface::NativeDisplay; use layers::rendergl; use layers::rendergl::RenderContext; use layers::scene::Scene; -use layout_traits::LayoutControlChan; -use msg::constellation_msg::{ConvertPipelineIdFromWebRender, ConvertPipelineIdToWebRender, Image, PixelFormat}; +use layout_traits::{ConvertPipelineIdToWebRender, LayoutControlChan}; +use msg::constellation_msg::{ConvertPipelineIdFromWebRender, Image, PixelFormat}; use msg::constellation_msg::{Key, KeyModifiers, KeyState, LoadData}; use msg::constellation_msg::{NavigationDirection, PipelineId, WindowSizeData, WindowSizeType}; use pipeline::CompositionPipeline; diff --git a/components/layout/layout_thread.rs b/components/layout/layout_thread.rs index bf325b8dbdd..0712e302752 100644 --- a/components/layout/layout_thread.rs +++ b/components/layout/layout_thread.rs @@ -35,9 +35,9 @@ use incremental::{REPAINT}; use ipc_channel::ipc::{self, IpcReceiver, IpcSender}; use ipc_channel::router::ROUTER; use layout_debug; -use layout_traits::LayoutThreadFactory; +use layout_traits::{ConvertPipelineIdToWebRender, LayoutThreadFactory}; use log; -use msg::constellation_msg::{ConstellationChan, ConvertPipelineIdToWebRender, PanicMsg, PipelineId}; +use msg::constellation_msg::{ConstellationChan, PanicMsg, PipelineId}; use net_traits::image_cache_thread::{ImageCacheChan, ImageCacheResult, ImageCacheThread}; use net_traits::image_cache_thread::{UsePlaceholder}; use parallel; diff --git a/components/layout/webrender_helpers.rs b/components/layout/webrender_helpers.rs index a66d3821cf2..a06fc045500 100644 --- a/components/layout/webrender_helpers.rs +++ b/components/layout/webrender_helpers.rs @@ -15,7 +15,7 @@ use gfx::display_list::{BorderRadii, BoxShadowClipMode, ClippingRegion}; use gfx::display_list::{DisplayItem, DisplayList}; use gfx::display_list::{DisplayListTraversal, GradientStop, StackingContext, StackingContextType}; use gfx_traits::ScrollPolicy; -use msg::constellation_msg::ConvertPipelineIdToWebRender; +use layout_traits::ConvertPipelineIdToWebRender; use style::computed_values::filter::{self, Filter}; use style::computed_values::{image_rendering, mix_blend_mode}; use style::values::computed::BorderStyle; diff --git a/components/layout_traits/lib.rs b/components/layout_traits/lib.rs index 61f9618f421..efc24f33fc3 100644 --- a/components/layout_traits/lib.rs +++ b/components/layout_traits/lib.rs @@ -26,7 +26,7 @@ extern crate webrender_traits; use gfx::font_cache_thread::FontCacheThread; use gfx::paint_thread::LayoutToPaintMsg; use ipc_channel::ipc::{IpcReceiver, IpcSender}; -use msg::constellation_msg::{ConstellationChan, PanicMsg, PipelineId}; +use msg::constellation_msg::{ConstellationChan, PanicMsg, PipelineId, PipelineNamespaceId, PipelineIndex}; use net_traits::image_cache_thread::ImageCacheThread; use profile_traits::{mem, time}; use script_traits::LayoutMsg as ConstellationMsg; @@ -60,3 +60,15 @@ pub trait LayoutThreadFactory { content_process_shutdown_chan: IpcSender<()>, webrender_api_sender: Option<webrender_traits::RenderApiSender>); } + +pub trait ConvertPipelineIdToWebRender { + fn to_webrender(&self) -> webrender_traits::PipelineId; +} + +impl ConvertPipelineIdToWebRender for PipelineId { + fn to_webrender(&self) -> webrender_traits::PipelineId { + let PipelineNamespaceId(namespace_id) = self.namespace_id; + let PipelineIndex(index) = self.index; + webrender_traits::PipelineId(namespace_id, index) + } +} diff --git a/components/msg/constellation_msg.rs b/components/msg/constellation_msg.rs index 08d7a5439b3..2a0cad52485 100644 --- a/components/msg/constellation_msg.rs +++ b/components/msg/constellation_msg.rs @@ -359,22 +359,10 @@ impl fmt::Display for PipelineId { #[derive(Clone, PartialEq, Eq, Copy, Hash, Debug, Deserialize, Serialize, HeapSizeOf)] pub struct SubpageId(pub u32); -pub trait ConvertPipelineIdToWebRender { - fn to_webrender(&self) -> webrender_traits::PipelineId; -} - pub trait ConvertPipelineIdFromWebRender { fn from_webrender(&self) -> PipelineId; } -impl ConvertPipelineIdToWebRender for PipelineId { - fn to_webrender(&self) -> webrender_traits::PipelineId { - let PipelineNamespaceId(namespace_id) = self.namespace_id; - let PipelineIndex(index) = self.index; - webrender_traits::PipelineId(namespace_id, index) - } -} - impl ConvertPipelineIdFromWebRender for webrender_traits::PipelineId { fn from_webrender(&self) -> PipelineId { PipelineId { |