auto merge of #4707 : glennw/servo/split-headless, r=larsbergstrom

The majority of this change is simply re-arranging the code in the glutin port so that the windowed/headless code is configured at build time rather than runtime. There shouldn't be any functional difference as a result of this change.
This commit is contained in:
bors-servo 2015-01-22 14:48:48 -07:00
commit 1b496d80de
10 changed files with 462 additions and 449 deletions

View file

@ -11,7 +11,6 @@ use geom::scale_factor::ScaleFactor;
use geom::size::TypedSize2D;
use layers::geometry::DevicePixel;
use getopts;
use std::borrow::ToOwned;
use std::collections::HashSet;
use std::cmp;
use std::io;
@ -20,12 +19,6 @@ use std::os;
use std::ptr;
use std::rt;
#[deriving(Clone, Copy)]
pub enum RenderApi {
OpenGL,
Mesa,
}
/// Global flags for Servo, currently set on the command line.
#[deriving(Clone)]
pub struct Opts {
@ -113,8 +106,6 @@ pub struct Opts {
/// Whether to show an error when display list geometry escapes flow overflow regions.
pub validate_display_list_geometry: bool,
pub render_api: RenderApi,
/// A specific path to find required resources (such as user-agent.css).
pub resources_path: Option<String>,
}
@ -183,7 +174,6 @@ pub fn default_opts() -> Opts {
dump_flow_tree: false,
validate_display_list_geometry: false,
profile_tasks: false,
render_api: RenderApi::OpenGL,
resources_path: None,
}
}
@ -303,15 +293,6 @@ pub fn from_cmdline_args(args: &[String]) -> bool {
}
};
let render_api = match opt_match.opt_str("r").unwrap_or("gl".to_owned()).as_slice() {
"mesa" => RenderApi::Mesa,
"gl" => RenderApi::OpenGL,
_ => {
args_fail("Unknown render api specified");
return false;
}
};
let opts = Opts {
urls: urls,
n_paint_threads: n_paint_threads,
@ -337,7 +318,6 @@ pub fn from_cmdline_args(args: &[String]) -> bool {
enable_text_antialiasing: !debug_options.contains(&"disable-text-aa"),
dump_flow_tree: debug_options.contains(&"dump-flow-tree"),
validate_display_list_geometry: debug_options.contains(&"validate-display-list-geometry"),
render_api: render_api,
resources_path: opt_match.opt_str("resources-path"),
};