Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
move trait ConvertPipelineIdToWebRender to a better place
  • Loading branch information
kevgs committed May 8, 2016
1 parent 47c2858 commit 8b6a609
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 18 deletions.
4 changes: 2 additions & 2 deletions components/compositing/compositor.rs
Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions components/layout/layout_thread.rs
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion components/layout/webrender_helpers.rs
Expand Up @@ -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;
Expand Down
14 changes: 13 additions & 1 deletion components/layout_traits/lib.rs
Expand Up @@ -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;
Expand Down Expand Up @@ -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)
}
}
12 changes: 0 additions & 12 deletions components/msg/constellation_msg.rs
Expand Up @@ -365,22 +365,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 {
Expand Down

0 comments on commit 8b6a609

Please sign in to comment.