mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
move trait ConvertPipelineIdToWebRender to a better place
This commit is contained in:
parent
47c2858647
commit
8b6a609764
5 changed files with 18 additions and 18 deletions
|
@ -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)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue