Auto merge of #11090 - saneyuki:fix11082, r=jdm

Move ConvertPipelineIdFromWebRender to compositing

Fix #11082

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/11090)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2016-05-09 13:50:05 -07:00
commit 500b0a6d36
2 changed files with 16 additions and 15 deletions

View file

@ -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)]