mirror of
https://github.com/servo/servo.git
synced 2025-08-05 21:50:18 +01:00
Move DevicePixel to script_traits.
This commit is contained in:
parent
04a3242dc5
commit
7879edb451
13 changed files with 13 additions and 27 deletions
|
@ -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 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue