Update to euclid 0.8

This commit is contained in:
Martin Robinson 2016-08-11 00:29:19 +02:00 committed by Anthony Ramine
parent b7facf41cb
commit 6259df5e2d
56 changed files with 538 additions and 558 deletions

View file

@ -12,12 +12,12 @@ path = "lib.rs"
[features]
# servo as opposed to geckolib
servo = ["serde", "serde_macros", "ipc-channel", "app_units/plugins",
"euclid/plugins", "euclid/unstable", "url/heap_size", "url/serde", "plugins"]
"euclid/unstable", "url/heap_size", "url/serde", "plugins"]
[dependencies]
app_units = "0.2.5"
bitflags = "0.7"
euclid = "0.7.1"
euclid = "0.8.2"
getopts = "0.2.11"
heapsize = "0.3.0"
ipc-channel = {version = "0.4.0", optional = true}

View file

@ -32,16 +32,10 @@ known_heap_size!(0, ScreenPx);
// originally proposed in 2002 as a standard unit of measure in Gecko.
// See https://bugzilla.mozilla.org/show_bug.cgi?id=177805 for more info.
pub static MAX_RECT: Rect<Au> = Rect {
origin: Point2D {
x: Au(i32::MIN / 2),
y: Au(i32::MIN / 2),
},
size: Size2D {
width: MAX_AU,
height: MAX_AU,
}
};
#[inline(always)]
pub fn max_rect() -> Rect<Au> {
Rect::new(Point2D::new(Au(i32::MIN / 2), Au(i32::MIN / 2)), Size2D::new(MAX_AU, MAX_AU))
}
/// A helper function to convert a rect of `f32` pixels to a rect of app units.
pub fn f32_rect_to_au_rect(rect: Rect<f32>) -> Rect<Au> {

View file

@ -14,7 +14,7 @@
extern crate app_units;
#[allow(unused_extern_crates)] #[macro_use] extern crate bitflags;
extern crate core;
extern crate euclid;
#[macro_use] extern crate euclid;
extern crate getopts;
#[macro_use] extern crate heapsize;
#[cfg(feature = "servo")] extern crate ipc_channel;

View file

@ -5,7 +5,7 @@
//! Configuration options for a single run of the servo application. Created
//! from command line arguments.
use euclid::size::{Size2D, TypedSize2D};
use euclid::size::TypedSize2D;
use geometry::ScreenPx;
use getopts::Options;
use num_cpus;
@ -136,7 +136,7 @@ pub struct Opts {
pub webdriver_port: Option<u16>,
/// The initial requested size of the window.
pub initial_window_size: TypedSize2D<ScreenPx, u32>,
pub initial_window_size: TypedSize2D<u32, ScreenPx>,
/// An optional string allowing the user agent to be set for testing.
pub user_agent: String,
@ -494,7 +494,7 @@ pub fn default_opts() -> Opts {
trace_layout: false,
devtools_port: None,
webdriver_port: None,
initial_window_size: Size2D::typed(1024, 740),
initial_window_size: TypedSize2D::new(1024, 740),
user_agent: default_user_agent_string(DEFAULT_USER_AGENT),
multiprocess: false,
random_pipeline_closure_probability: None,
@ -722,10 +722,10 @@ pub fn from_cmdline_args(args: &[String]) -> ArgumentParsingResult {
let res: Vec<u32> = res_string.split('x').map(|r| {
r.parse().unwrap_or_else(|err| args_fail(&format!("Error parsing option: --resolution ({})", err)))
}).collect();
Size2D::typed(res[0], res[1])
TypedSize2D::new(res[0], res[1])
}
None => {
Size2D::typed(1024, 740)
TypedSize2D::new(1024, 740)
}
};