servo: Merge #14961 - Move DevicePixel to script_traits (from Ms2ger:DevicePixel); r=nox

Source-Repo: https://github.com/servo/servo
Source-Revision: 5d3847dddc9bb7907abfa5d38a7927d6c656fbc1
This commit is contained in:
Ms2ger 2017-01-11 11:31:15 -08:00
Родитель 079733547a
Коммит c4c86ad9c1
13 изменённых файлов: 13 добавлений и 27 удалений

2
servo/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",

Просмотреть файл

@ -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};

Просмотреть файл

@ -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.

Просмотреть файл

@ -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};

Просмотреть файл

@ -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};

Просмотреть файл

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

Просмотреть файл

@ -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 {

Просмотреть файл

@ -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"

Просмотреть файл

@ -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;

Просмотреть файл

@ -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;

Просмотреть файл

@ -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"}

Просмотреть файл

@ -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;

Просмотреть файл

@ -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;