aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbors-servo <lbergstrom+bors@mozilla.com>2017-01-11 11:31:15 -0800
committerGitHub <noreply@github.com>2017-01-11 11:31:15 -0800
commit5d3847dddc9bb7907abfa5d38a7927d6c656fbc1 (patch)
treeed573ad2693b85cee07973c909d0e37c3839aca7
parentcfc74e20603e7395a743b3b3c202db6db840da4d (diff)
parent7879edb451049b6ddc173490c8878dcb0075389c (diff)
downloadservo-5d3847dddc9bb7907abfa5d38a7927d6c656fbc1.tar.gz
servo-5d3847dddc9bb7907abfa5d38a7927d6c656fbc1.zip
Auto merge of #14961 - Ms2ger:DevicePixel, r=nox
Move DevicePixel to script_traits. <!-- Reviewable:start --> This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/14961) <!-- Reviewable:end -->
-rw-r--r--Cargo.lock2
-rw-r--r--components/compositing/compositor.rs5
-rw-r--r--components/compositing/touch.rs3
-rw-r--r--components/compositing/windowing.rs3
-rw-r--r--components/constellation/pipeline.rs3
-rw-r--r--components/gfx_traits/lib.rs8
-rw-r--r--components/script_traits/lib.rs7
-rw-r--r--ports/cef/Cargo.toml1
-rw-r--r--ports/cef/lib.rs1
-rw-r--r--ports/cef/window.rs2
-rw-r--r--ports/glutin/Cargo.toml1
-rw-r--r--ports/glutin/lib.rs1
-rw-r--r--ports/glutin/window.rs3
13 files changed, 13 insertions, 27 deletions
diff --git a/Cargo.lock b/Cargo.lock
index 98d718b0590..415643a0011 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -660,7 +660,6 @@ dependencies = [
"compositing 0.0.1",
"devtools 0.0.1",
"euclid 0.10.3 (registry+https://github.com/rust-lang/crates.io-index)",
- "gfx_traits 0.0.1",
"gleam 0.2.30 (registry+https://github.com/rust-lang/crates.io-index)",
"glutin_app 0.0.1",
"libc 0.2.18 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -1023,7 +1022,6 @@ dependencies = [
"compositing 0.0.1",
"euclid 0.10.3 (registry+https://github.com/rust-lang/crates.io-index)",
"gdi32-sys 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "gfx_traits 0.0.1",
"gleam 0.2.30 (registry+https://github.com/rust-lang/crates.io-index)",
"log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
"msg 0.0.1",
diff --git a/components/compositing/compositor.rs b/components/compositing/compositor.rs
index d852ae728f1..ea0da5168e5 100644
--- a/components/compositing/compositor.rs
+++ b/components/compositing/compositor.rs
@@ -11,8 +11,7 @@ use euclid::Point2D;
use euclid::point::TypedPoint2D;
use euclid::scale_factor::ScaleFactor;
use euclid::size::TypedSize2D;
-use gfx_traits::{DevicePixel, ScrollRootId};
-use gfx_traits::{Epoch, FragmentType};
+use gfx_traits::{Epoch, FragmentType, ScrollRootId};
use gleam::gl;
use gleam::gl::types::{GLint, GLsizei};
use image::{DynamicImage, ImageFormat, RgbImage};
@@ -22,7 +21,7 @@ use msg::constellation_msg::{PipelineId, PipelineIndex, PipelineNamespaceId, Tra
use net_traits::image::base::{Image, PixelFormat};
use profile_traits::time::{self, ProfilerCategory, profile};
use script_traits::{AnimationState, AnimationTickType, ConstellationControlMsg};
-use script_traits::{ConstellationMsg, LayoutControlMsg, LoadData, MouseButton};
+use script_traits::{ConstellationMsg, DevicePixel, LayoutControlMsg, LoadData, MouseButton};
use script_traits::{MouseEventType, StackingContextScrollState};
use script_traits::{TouchpadPressurePhase, TouchEventType, TouchId, WindowSizeData, WindowSizeType};
use script_traits::CompositorEvent::{self, MouseMoveEvent, MouseButtonEvent, TouchEvent, TouchpadPressureEvent};
diff --git a/components/compositing/touch.rs b/components/compositing/touch.rs
index fe494cb7ba6..a158c1e5c33 100644
--- a/components/compositing/touch.rs
+++ b/components/compositing/touch.rs
@@ -4,8 +4,7 @@
use euclid::point::TypedPoint2D;
use euclid::scale_factor::ScaleFactor;
-use gfx_traits::DevicePixel;
-use script_traits::{EventResult, TouchId};
+use script_traits::{DevicePixel, EventResult, TouchId};
use self::TouchState::*;
/// Minimum number of `ScreenPx` to begin touch scrolling.
diff --git a/components/compositing/windowing.rs b/components/compositing/windowing.rs
index a6933ce92fd..ca34aeddd5b 100644
--- a/components/compositing/windowing.rs
+++ b/components/compositing/windowing.rs
@@ -9,10 +9,9 @@ use euclid::{Point2D, Size2D};
use euclid::point::TypedPoint2D;
use euclid::scale_factor::ScaleFactor;
use euclid::size::TypedSize2D;
-use gfx_traits::DevicePixel;
use msg::constellation_msg::{Key, KeyModifiers, KeyState};
use net_traits::net_error_list::NetError;
-use script_traits::{MouseButton, TouchEventType, TouchId, TouchpadPressurePhase};
+use script_traits::{DevicePixel, MouseButton, TouchEventType, TouchId, TouchpadPressurePhase};
use servo_geometry::ScreenPx;
use servo_url::ServoUrl;
use std::fmt::{Debug, Error, Formatter};
diff --git a/components/constellation/pipeline.rs b/components/constellation/pipeline.rs
index fba15eefcf7..075c53e84f8 100644
--- a/components/constellation/pipeline.rs
+++ b/components/constellation/pipeline.rs
@@ -11,7 +11,6 @@ use euclid::scale_factor::ScaleFactor;
use euclid::size::TypedSize2D;
use event_loop::EventLoop;
use gfx::font_cache_thread::FontCacheThread;
-use gfx_traits::DevicePixel;
use ipc_channel::ipc::{self, IpcReceiver, IpcSender};
use ipc_channel::router::ROUTER;
use layout_traits::LayoutThreadFactory;
@@ -20,7 +19,7 @@ use net_traits::{IpcSend, ResourceThreads};
use net_traits::image_cache_thread::ImageCacheThread;
use profile_traits::mem as profile_mem;
use profile_traits::time;
-use script_traits::{ConstellationControlMsg, DiscardBrowsingContext, InitialScriptState};
+use script_traits::{ConstellationControlMsg, DevicePixel, DiscardBrowsingContext, InitialScriptState};
use script_traits::{LayoutControlMsg, LayoutMsg, LoadData, MozBrowserEvent};
use script_traits::{NewLayoutInfo, SWManagerMsg, SWManagerSenders, ScriptMsg};
use script_traits::{ScriptThreadFactory, TimerEventRequest, WindowSizeData};
diff --git a/components/gfx_traits/lib.rs b/components/gfx_traits/lib.rs
index afc0aac0080..30ab09ba103 100644
--- a/components/gfx_traits/lib.rs
+++ b/components/gfx_traits/lib.rs
@@ -35,14 +35,6 @@ static NEXT_SPECIAL_STACKING_CONTEXT_ID: AtomicUsize = ATOMIC_USIZE_INIT;
/// Note that we assume that the top 16 bits of the address space are unused on the platform.
const SPECIAL_STACKING_CONTEXT_ID_MASK: usize = 0xffff;
-// Units for use with euclid::length and euclid::scale_factor.
-
-/// One hardware pixel.
-///
-/// This unit corresponds to the smallest addressable element of the display hardware.
-#[derive(Copy, Clone, Debug)]
-pub enum DevicePixel {}
-
/// 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);
diff --git a/components/script_traits/lib.rs b/components/script_traits/lib.rs
index 1916d666a3e..c0131158326 100644
--- a/components/script_traits/lib.rs
+++ b/components/script_traits/lib.rs
@@ -48,7 +48,6 @@ use euclid::point::Point2D;
use euclid::rect::Rect;
use euclid::scale_factor::ScaleFactor;
use euclid::size::TypedSize2D;
-use gfx_traits::DevicePixel;
use gfx_traits::Epoch;
use gfx_traits::ScrollRootId;
use heapsize::HeapSizeOf;
@@ -642,6 +641,12 @@ pub struct StackingContextScrollState {
pub scroll_offset: Point2D<f32>,
}
+/// One hardware pixel.
+///
+/// This unit corresponds to the smallest addressable element of the display hardware.
+#[derive(Copy, Clone, Debug)]
+pub enum DevicePixel {}
+
/// Data about the window size.
#[derive(Copy, Clone, Deserialize, Serialize, HeapSizeOf)]
pub struct WindowSizeData {
diff --git a/ports/cef/Cargo.toml b/ports/cef/Cargo.toml
index 6bca49baae4..3ca91e933f8 100644
--- a/ports/cef/Cargo.toml
+++ b/ports/cef/Cargo.toml
@@ -21,7 +21,6 @@ debugmozjs = ["libservo/debugmozjs"]
compositing = {path = "../../components/compositing"}
devtools = {path = "../../components/devtools"}
euclid = "0.10.1"
-gfx_traits = {path = "../../components/gfx_traits"}
gleam = "0.2.8"
glutin_app = {path = "../glutin"}
libc = "0.2"
diff --git a/ports/cef/lib.rs b/ports/cef/lib.rs
index 3e44e308091..94e61baca55 100644
--- a/ports/cef/lib.rs
+++ b/ports/cef/lib.rs
@@ -18,7 +18,6 @@ extern crate servo;
extern crate compositing;
extern crate euclid;
-extern crate gfx_traits;
extern crate gleam;
extern crate glutin_app;
extern crate script_traits;
diff --git a/ports/cef/window.rs b/ports/cef/window.rs
index 6886ff018fa..958bc0b2221 100644
--- a/ports/cef/window.rs
+++ b/ports/cef/window.rs
@@ -22,10 +22,10 @@ use compositing::windowing::{WindowEvent, WindowMethods};
use euclid::point::Point2D;
use euclid::scale_factor::ScaleFactor;
use euclid::size::{Size2D, TypedSize2D};
-use gfx_traits::DevicePixel;
use gleam::gl;
use msg::constellation_msg::{Key, KeyModifiers};
use net_traits::net_error_list::NetError;
+use script_traits::DevicePixel;
use servo_geometry::ScreenPx;
use std::cell::RefCell;
use std::ffi::CString;
diff --git a/ports/glutin/Cargo.toml b/ports/glutin/Cargo.toml
index 9afffe6dc66..09557e32ed3 100644
--- a/ports/glutin/Cargo.toml
+++ b/ports/glutin/Cargo.toml
@@ -12,7 +12,6 @@ path = "lib.rs"
bitflags = "0.7"
compositing = {path = "../../components/compositing"}
euclid = "0.10.1"
-gfx_traits = {path = "../../components/gfx_traits"}
gleam = "0.2.8"
log = "0.3.5"
msg = {path = "../../components/msg"}
diff --git a/ports/glutin/lib.rs b/ports/glutin/lib.rs
index 3d1bb34a258..dd9ebef4087 100644
--- a/ports/glutin/lib.rs
+++ b/ports/glutin/lib.rs
@@ -11,7 +11,6 @@ extern crate compositing;
#[allow(unused_extern_crates)]
#[cfg(target_os = "android")] extern crate egl;
extern crate euclid;
-extern crate gfx_traits;
extern crate gleam;
extern crate glutin;
#[macro_use] extern crate log;
diff --git a/ports/glutin/window.rs b/ports/glutin/window.rs
index bba97dad8f2..e8565474ca3 100644
--- a/ports/glutin/window.rs
+++ b/ports/glutin/window.rs
@@ -13,7 +13,6 @@ use euclid::scale_factor::ScaleFactor;
use euclid::size::TypedSize2D;
#[cfg(target_os = "windows")]
use gdi32;
-use gfx_traits::DevicePixel;
use gleam::gl;
use glutin;
use glutin::{Api, ElementState, Event, GlRequest, MouseButton, MouseScrollDelta, VirtualKeyCode};
@@ -25,7 +24,7 @@ use msg::constellation_msg::{ALT, CONTROL, KeyState, NONE, SHIFT, SUPER};
use net_traits::net_error_list::NetError;
#[cfg(any(target_os = "linux", target_os = "macos"))]
use osmesa_sys;
-use script_traits::{TouchEventType, TouchpadPressurePhase};
+use script_traits::{DevicePixel, TouchEventType, TouchpadPressurePhase};
use servo_config::opts;
use servo_config::prefs::PREFS;
use servo_config::resource_files;