diff options
-rw-r--r-- | components/compositing/compositor.rs | 4 | ||||
-rw-r--r-- | components/compositing/compositor_layer.rs | 3 | ||||
-rw-r--r-- | components/compositing/compositor_thread.rs | 4 | ||||
-rw-r--r-- | components/compositing/constellation.rs | 3 | ||||
-rw-r--r-- | components/compositing/lib.rs | 2 | ||||
-rw-r--r-- | components/gfx/paint_thread.rs | 5 | ||||
-rw-r--r-- | components/gfx_traits/lib.rs | 11 | ||||
-rw-r--r-- | components/gfx_traits/paint_listener.rs | 3 | ||||
-rw-r--r-- | components/layout/layout_thread.rs | 3 | ||||
-rw-r--r-- | components/msg/compositor_msg.rs | 11 | ||||
-rw-r--r-- | components/script/layout_interface.rs | 3 | ||||
-rw-r--r-- | components/script_traits/lib.rs | 2 |
12 files changed, 26 insertions, 28 deletions
diff --git a/components/compositing/compositor.rs b/components/compositing/compositor.rs index 95b04c4a093..da23b60b414 100644 --- a/components/compositing/compositor.rs +++ b/components/compositing/compositor.rs @@ -14,7 +14,7 @@ use euclid::scale_factor::ScaleFactor; use euclid::size::TypedSize2D; use euclid::{Matrix4, Point2D, Rect, Size2D}; use gfx::paint_thread::{ChromeToPaintMsg, PaintRequest}; -use gfx_traits::{color, LayerId, LayerKind, LayerProperties, ScrollPolicy}; +use gfx_traits::{color, Epoch, LayerId, LayerKind, LayerProperties, ScrollPolicy}; use gleam::gl; use gleam::gl::types::{GLint, GLsizei}; use image::{DynamicImage, ImageFormat, RgbImage}; @@ -27,7 +27,7 @@ use layers::rendergl; use layers::rendergl::RenderContext; use layers::scene::Scene; use layout_traits::LayoutControlChan; -use msg::compositor_msg::{Epoch, FrameTreeId}; +use msg::compositor_msg::FrameTreeId; use msg::constellation_msg::{AnimationState, Image, PixelFormat}; use msg::constellation_msg::{Key, KeyModifiers, KeyState, LoadData, MouseButton}; use msg::constellation_msg::{NavigationDirection, PipelineId, WindowSizeData}; diff --git a/components/compositing/compositor_layer.rs b/components/compositing/compositor_layer.rs index 1f2cff4c144..470f70e7acf 100644 --- a/components/compositing/compositor_layer.rs +++ b/components/compositing/compositor_layer.rs @@ -8,11 +8,10 @@ use euclid::length::Length; use euclid::point::{Point2D, TypedPoint2D}; use euclid::rect::Rect; use euclid::size::TypedSize2D; -use gfx_traits::{LayerId, LayerProperties, ScrollPolicy}; +use gfx_traits::{Epoch, LayerId, LayerProperties, ScrollPolicy}; use layers::color::Color; use layers::geometry::LayerPixel; use layers::layers::{Layer, LayerBufferSet}; -use msg::compositor_msg::Epoch; use msg::constellation_msg::{MouseEventType, PipelineId}; use script_traits::CompositorEvent; use script_traits::CompositorEvent::{MouseButtonEvent, MouseMoveEvent}; diff --git a/components/compositing/compositor_thread.rs b/components/compositing/compositor_thread.rs index dfc01d1635e..4972c6bc6cc 100644 --- a/components/compositing/compositor_thread.rs +++ b/components/compositing/compositor_thread.rs @@ -8,12 +8,12 @@ use CompositorMsg as ConstellationMsg; use compositor; use euclid::point::Point2D; use euclid::size::Size2D; -use gfx_traits::{LayerId, LayerProperties, PaintListener}; +use gfx_traits::{Epoch, LayerId, LayerProperties, PaintListener}; use headless; use ipc_channel::ipc::{self, IpcReceiver, IpcSender}; use layers::layers::{BufferRequest, LayerBufferSet}; use layers::platform::surface::{NativeDisplay, NativeSurface}; -use msg::compositor_msg::{Epoch, FrameTreeId}; +use msg::compositor_msg::FrameTreeId; use msg::constellation_msg::{AnimationState, PipelineId}; use msg::constellation_msg::{Image, Key, KeyModifiers, KeyState}; use profile_traits::mem; diff --git a/components/compositing/constellation.rs b/components/compositing/constellation.rs index f590b845d2d..26333d58e48 100644 --- a/components/compositing/constellation.rs +++ b/components/compositing/constellation.rs @@ -22,11 +22,10 @@ use euclid::size::{Size2D, TypedSize2D}; use gaol; use gaol::sandbox::{self, Sandbox, SandboxMethods}; use gfx::font_cache_thread::FontCacheThread; -use gfx_traits::PaintMsg as FromPaintMsg; +use gfx_traits::{Epoch, PaintMsg as FromPaintMsg}; use ipc_channel::ipc::{self, IpcOneShotServer, IpcSender}; use ipc_channel::router::ROUTER; use layout_traits::{LayoutControlChan, LayoutThreadFactory}; -use msg::compositor_msg::Epoch; use msg::constellation_msg::AnimationState; use msg::constellation_msg::WebDriverCommandMsg; use msg::constellation_msg::{DocumentState, FrameId, PipelineId}; diff --git a/components/compositing/lib.rs b/components/compositing/lib.rs index 4264236a8c0..0274c23f613 100644 --- a/components/compositing/lib.rs +++ b/components/compositing/lib.rs @@ -53,8 +53,8 @@ extern crate util; pub use compositor_thread::{CompositorEventListener, CompositorProxy, CompositorThread}; pub use constellation::Constellation; use euclid::size::{Size2D}; +use gfx_traits::Epoch; use ipc_channel::ipc::{IpcSender}; -use msg::compositor_msg::Epoch; use msg::constellation_msg::{FrameId, Key, KeyState, KeyModifiers, LoadData}; use msg::constellation_msg::{NavigationDirection, PipelineId, SubpageId}; use msg::constellation_msg::{WebDriverCommandMsg, WindowSizeData}; diff --git a/components/gfx/paint_thread.rs b/components/gfx/paint_thread.rs index d1ca334fcd4..799960cfd7a 100644 --- a/components/gfx/paint_thread.rs +++ b/components/gfx/paint_thread.rs @@ -15,11 +15,12 @@ use euclid::rect::Rect; use euclid::size::Size2D; use font_cache_thread::FontCacheThread; use font_context::FontContext; -use gfx_traits::{color, LayerId, LayerKind, LayerProperties, PaintListener, PaintMsg as ConstellationMsg, ScrollPolicy}; +use gfx_traits::color; +use gfx_traits::{Epoch, LayerId, LayerKind, LayerProperties, PaintListener, PaintMsg as ConstellationMsg, ScrollPolicy}; use ipc_channel::ipc::IpcSender; use layers::layers::{BufferRequest, LayerBuffer, LayerBufferSet}; use layers::platform::surface::{NativeDisplay, NativeSurface}; -use msg::compositor_msg::{Epoch, FrameTreeId}; +use msg::compositor_msg::FrameTreeId; use msg::constellation_msg::{ConstellationChan, Failure, PipelineId}; use paint_context::PaintContext; use profile_traits::mem::{self, ReportsChan}; diff --git a/components/gfx_traits/lib.rs b/components/gfx_traits/lib.rs index c3afad23f90..30275465d85 100644 --- a/components/gfx_traits/lib.rs +++ b/components/gfx_traits/lib.rs @@ -125,3 +125,14 @@ pub struct LayerProperties { /// Whether this layer scrolls its overflow area. pub scrolls_overflow_area: bool, } + +/// A newtype struct for denoting the age of messages; prevents race conditions. +#[derive(PartialEq, Eq, Debug, Copy, Clone, PartialOrd, Ord, Deserialize, Serialize)] +pub struct Epoch(pub u32); + +impl Epoch { + pub fn next(&mut self) { + let Epoch(ref mut u) = *self; + *u += 1; + } +} diff --git a/components/gfx_traits/paint_listener.rs b/components/gfx_traits/paint_listener.rs index be2f1c403f1..d132e1af0cb 100644 --- a/components/gfx_traits/paint_listener.rs +++ b/components/gfx_traits/paint_listener.rs @@ -2,11 +2,12 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ +use Epoch; use LayerId; use LayerProperties; use layers::layers::{BufferRequest, LayerBufferSet}; use layers::platform::surface::NativeDisplay; -use msg::compositor_msg::{Epoch, FrameTreeId}; +use msg::compositor_msg::FrameTreeId; use msg::constellation_msg::PipelineId; /// The interface used by the painter to acquire draw targets for each paint frame and diff --git a/components/layout/layout_thread.rs b/components/layout/layout_thread.rs index 668d08e2c85..86b86b2793d 100644 --- a/components/layout/layout_thread.rs +++ b/components/layout/layout_thread.rs @@ -27,7 +27,7 @@ use gfx::font; use gfx::font_cache_thread::FontCacheThread; use gfx::font_context; use gfx::paint_thread::{LayoutToPaintMsg, PaintLayer}; -use gfx_traits::{color, LayerId, ScrollPolicy}; +use gfx_traits::{color, Epoch, LayerId, ScrollPolicy}; use incremental::{LayoutDamageComputation, REFLOW, REFLOW_ENTIRE_DOCUMENT, REPAINT}; use ipc_channel::ipc::{self, IpcReceiver, IpcSender}; use ipc_channel::router::ROUTER; @@ -35,7 +35,6 @@ use layout_debug; use layout_traits::LayoutThreadFactory; use log; use msg::ParseErrorReporter; -use msg::compositor_msg::Epoch; use msg::constellation_msg::{ConstellationChan, Failure, PipelineId}; use net_traits::image_cache_thread::{ImageCacheChan, ImageCacheResult, ImageCacheThread}; use parallel; diff --git a/components/msg/compositor_msg.rs b/components/msg/compositor_msg.rs index 9dee0c927d1..bea159abc1f 100644 --- a/components/msg/compositor_msg.rs +++ b/components/msg/compositor_msg.rs @@ -2,17 +2,6 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -/// A newtype struct for denoting the age of messages; prevents race conditions. -#[derive(PartialEq, Eq, Debug, Copy, Clone, PartialOrd, Ord, Deserialize, Serialize)] -pub struct Epoch(pub u32); - -impl Epoch { - pub fn next(&mut self) { - let Epoch(ref mut u) = *self; - *u += 1; - } -} - #[derive(PartialEq, Eq, Debug, Copy, Clone)] pub struct FrameTreeId(pub u32); diff --git a/components/script/layout_interface.rs b/components/script/layout_interface.rs index 9d407c4e8b2..ec889087ec8 100644 --- a/components/script/layout_interface.rs +++ b/components/script/layout_interface.rs @@ -10,9 +10,8 @@ use app_units::Au; use dom::node::OpaqueStyleAndLayoutData; use euclid::point::Point2D; use euclid::rect::Rect; -use gfx_traits::LayerId; +use gfx_traits::{Epoch, LayerId}; use ipc_channel::ipc::{IpcReceiver, IpcSender}; -use msg::compositor_msg::Epoch; use msg::constellation_msg::{ConstellationChan, Failure, PipelineId}; use msg::constellation_msg::{WindowSizeData}; use net_traits::image_cache_thread::ImageCacheThread; diff --git a/components/script_traits/lib.rs b/components/script_traits/lib.rs index a8905de4821..938806cb76a 100644 --- a/components/script_traits/lib.rs +++ b/components/script_traits/lib.rs @@ -35,10 +35,10 @@ use euclid::Size2D; use euclid::length::Length; use euclid::point::Point2D; use euclid::rect::Rect; +use gfx_traits::Epoch; use gfx_traits::LayerId; use ipc_channel::ipc::{IpcReceiver, IpcSender}; use libc::c_void; -use msg::compositor_msg::Epoch; use msg::constellation_msg::{ConstellationChan, Failure, PipelineId, WindowSizeData}; use msg::constellation_msg::{Key, KeyModifiers, KeyState, LoadData, SubpageId}; use msg::constellation_msg::{MouseButton, MouseEventType}; |