aboutsummaryrefslogtreecommitdiffstats
path: root/components/util
diff options
context:
space:
mode:
Diffstat (limited to 'components/util')
-rw-r--r--components/util/Cargo.toml4
-rw-r--r--components/util/geometry.rs14
-rw-r--r--components/util/lib.rs2
-rw-r--r--components/util/opts.rs10
4 files changed, 12 insertions, 18 deletions
diff --git a/components/util/Cargo.toml b/components/util/Cargo.toml
index d32c015637f..e03464b7fb9 100644
--- a/components/util/Cargo.toml
+++ b/components/util/Cargo.toml
@@ -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}
diff --git a/components/util/geometry.rs b/components/util/geometry.rs
index 95b6194a14e..84d3761b92c 100644
--- a/components/util/geometry.rs
+++ b/components/util/geometry.rs
@@ -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> {
diff --git a/components/util/lib.rs b/components/util/lib.rs
index 13e763b9cbc..abb02adb440 100644
--- a/components/util/lib.rs
+++ b/components/util/lib.rs
@@ -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;
diff --git a/components/util/opts.rs b/components/util/opts.rs
index 81b83d2b273..6395e134147 100644
--- a/components/util/opts.rs
+++ b/components/util/opts.rs
@@ -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)
}
};