diff --git a/components/compositing/compositor.rs b/components/compositing/compositor.rs index 0b78e688728..5d29140e356 100644 --- a/components/compositing/compositor.rs +++ b/components/compositing/compositor.rs @@ -58,14 +58,14 @@ use webrender_traits::{self, ScrollEventPhase}; use windowing::{self, MouseWindowEvent, WindowEvent, WindowMethods, WindowNavigateMsg}; #[derive(Debug, PartialEq)] -pub enum UnableToComposite { +enum UnableToComposite { NoContext, WindowUnprepared, NotReadyToPaintImage(NotReadyToPaint), } #[derive(Debug, PartialEq)] -pub enum NotReadyToPaint { +enum NotReadyToPaint { LayerHasOutstandingPaintMessages, MissingRoot, PendingSubpages(usize), @@ -80,7 +80,7 @@ const BUFFER_MAP_SIZE: usize = 10000000; const MAX_ZOOM: f32 = 8.0; const MIN_ZOOM: f32 = 0.1; -pub trait ConvertPipelineIdFromWebRender { +trait ConvertPipelineIdFromWebRender { fn from_webrender(&self) -> PipelineId; } @@ -221,7 +221,7 @@ pub struct IOCompositor { } #[derive(Copy, Clone)] -pub struct ScrollZoomEvent { +struct ScrollZoomEvent { /// Change the pinch zoom level by this factor magnification: f32, /// Scroll by this offset @@ -253,7 +253,7 @@ struct HitTestResult { point: TypedPoint2D, } -pub struct PipelineDetails { +struct PipelineDetails { /// The pipeline associated with this PipelineDetails object. pipeline: Option, @@ -279,7 +279,7 @@ impl PipelineDetails { } #[derive(Clone, Copy, PartialEq, Debug)] -pub enum CompositeTarget { +enum CompositeTarget { /// Normal composition to a window Window, @@ -346,7 +346,7 @@ fn initialize_png(width: usize, height: usize) -> RenderTargetInfo { } } -pub fn reporter_name() -> String { +fn reporter_name() -> String { "compositor-reporter".to_owned() } @@ -485,7 +485,7 @@ impl IOCompositor { compositor } - pub fn start_shutting_down(&mut self) { + fn start_shutting_down(&mut self) { debug!("Compositor sending Exit message to Constellation"); if let Err(e) = self.constellation_chan.send(ConstellationMsg::Exit) { warn!("Sending exit message to constellation failed ({}).", e); @@ -496,7 +496,7 @@ impl IOCompositor { self.shutdown_state = ShutdownState::ShuttingDown; } - pub fn finish_shutting_down(&mut self) { + fn finish_shutting_down(&mut self) { debug!("Compositor received message that constellation shutdown is complete"); // Clear out the compositor layers so that painting threads can destroy the buffers. @@ -790,9 +790,7 @@ impl IOCompositor { } } - pub fn pipeline_details (&mut self, - pipeline_id: PipelineId) - -> &mut PipelineDetails { + fn pipeline_details(&mut self, pipeline_id: PipelineId) -> &mut PipelineDetails { if !self.pipeline_details.contains_key(&pipeline_id) { self.pipeline_details.insert(pipeline_id, PipelineDetails::new()); } @@ -1124,11 +1122,11 @@ impl IOCompositor { } } - pub fn move_layer(&self, - pipeline_id: PipelineId, - layer_id: LayerId, - origin: TypedPoint2D) - -> bool { + fn move_layer(&self, + pipeline_id: PipelineId, + layer_id: LayerId, + origin: TypedPoint2D) + -> bool { match self.find_layer_with_pipeline_and_layer_id(pipeline_id, layer_id) { Some(ref layer) => { if layer.wants_scroll_events() == WantsScrollEventsFlag::WantsScrollEvents { @@ -2081,8 +2079,9 @@ impl IOCompositor { /// for some reason. If CompositeTarget is Window or Png no image data is returned; /// in the latter case the image is written directly to a file. If CompositeTarget /// is WindowAndPng Ok(Some(png::Image)) is returned. - pub fn composite_specific_target(&mut self, target: CompositeTarget) -> Result, UnableToComposite> { - + fn composite_specific_target(&mut self, + target: CompositeTarget) + -> Result, UnableToComposite> { if self.context.is_none() && self.webrender.is_none() { return Err(UnableToComposite::NoContext) } diff --git a/components/compositing/delayed_composition.rs b/components/compositing/delayed_composition.rs index bc4b933f1bd..c2ae4b86fa9 100644 --- a/components/compositing/delayed_composition.rs +++ b/components/compositing/delayed_composition.rs @@ -21,7 +21,7 @@ pub struct DelayedCompositionTimerProxy { sender: Sender, } -pub struct DelayedCompositionTimer { +struct DelayedCompositionTimer { compositor_proxy: Box, receiver: Receiver, } @@ -56,7 +56,7 @@ impl DelayedCompositionTimerProxy { } impl DelayedCompositionTimer { - pub fn run(&mut self) { + fn run(&mut self) { 'outer: loop { let mut timestamp; loop {