diff --git a/servo/components/compositing/compositor.rs b/servo/components/compositing/compositor.rs index 50e91e09b643..e0d496c5652a 100644 --- a/servo/components/compositing/compositor.rs +++ b/servo/components/compositing/compositor.rs @@ -29,9 +29,10 @@ use layers::rendergl; use layers::rendergl::RenderContext; use layers::scene::Scene; use layout_traits::{ConvertPipelineIdToWebRender, LayoutControlChan}; -use msg::constellation_msg::{ConvertPipelineIdFromWebRender, Image, PixelFormat}; +use msg::constellation_msg::{Image, PixelFormat}; use msg::constellation_msg::{Key, KeyModifiers, KeyState, LoadData}; -use msg::constellation_msg::{NavigationDirection, PipelineId, WindowSizeData, WindowSizeType}; +use msg::constellation_msg::{NavigationDirection, PipelineId, PipelineIndex, PipelineNamespaceId}; +use msg::constellation_msg::{WindowSizeData, WindowSizeType}; use pipeline::CompositionPipeline; use profile_traits::mem::{self, ReportKind, Reporter, ReporterRequest}; use profile_traits::time::{self, ProfilerCategory, profile}; @@ -79,6 +80,19 @@ const BUFFER_MAP_SIZE: usize = 10000000; const MAX_ZOOM: f32 = 8.0; const MIN_ZOOM: f32 = 0.1; +pub trait ConvertPipelineIdFromWebRender { + fn from_webrender(&self) -> PipelineId; +} + +impl ConvertPipelineIdFromWebRender for webrender_traits::PipelineId { + fn from_webrender(&self) -> PipelineId { + PipelineId { + namespace_id: PipelineNamespaceId(self.0), + index: PipelineIndex(self.1), + } + } +} + /// Holds the state when running reftests that determines when it is /// safe to save the output image. #[derive(Copy, Clone, PartialEq)] diff --git a/servo/components/msg/constellation_msg.rs b/servo/components/msg/constellation_msg.rs index 2a0cad524850..5114ae8a3848 100644 --- a/servo/components/msg/constellation_msg.rs +++ b/servo/components/msg/constellation_msg.rs @@ -359,19 +359,6 @@ impl fmt::Display for PipelineId { #[derive(Clone, PartialEq, Eq, Copy, Hash, Debug, Deserialize, Serialize, HeapSizeOf)] pub struct SubpageId(pub u32); -pub trait ConvertPipelineIdFromWebRender { - fn from_webrender(&self) -> PipelineId; -} - -impl ConvertPipelineIdFromWebRender for webrender_traits::PipelineId { - fn from_webrender(&self) -> PipelineId { - PipelineId { - namespace_id: PipelineNamespaceId(self.0), - index: PipelineIndex(self.1), - } - } -} - /// [Policies](https://w3c.github.io/webappsec-referrer-policy/#referrer-policy-states) /// for providing a referrer header for a request #[derive(HeapSizeOf, Clone, Deserialize, Serialize)]