Skip to content
Permalink
Browse files

Move ConvertPipelineIdFromWebRender to compositing

  • Loading branch information
tetsuharuohzeki committed May 9, 2016
1 parent 58a9b31 commit 4f064707483fdcc0fbe0551fb944f87b85302ed7
Showing with 16 additions and 15 deletions.
  1. +16 −2 components/compositing/compositor.rs
  2. +0 −13 components/msg/constellation_msg.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)]
@@ -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)]

0 comments on commit 4f06470

Please sign in to comment.
You can’t perform that action at this time.