Skip to content

Commit

Permalink
Move ConvertPipelineIdFromWebRender to compositing
Browse files Browse the repository at this point in the history
  • Loading branch information
tetsuharuohzeki committed May 9, 2016
1 parent 58a9b31 commit 4f06470
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 15 deletions.
18 changes: 16 additions & 2 deletions components/compositing/compositor.rs
Expand Up @@ -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};
Expand Down Expand Up @@ -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)]
Expand Down
13 changes: 0 additions & 13 deletions components/msg/constellation_msg.rs
Expand Up @@ -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)]
Expand Down

0 comments on commit 4f06470

Please sign in to comment.