aboutsummaryrefslogtreecommitdiffstats
path: root/components/util/opts.rs
diff options
context:
space:
mode:
Diffstat (limited to 'components/util/opts.rs')
-rw-r--r--components/util/opts.rs28
1 files changed, 28 insertions, 0 deletions
diff --git a/components/util/opts.rs b/components/util/opts.rs
index b154abe211f..d2dbdc1c382 100644
--- a/components/util/opts.rs
+++ b/components/util/opts.rs
@@ -183,6 +183,15 @@ pub struct Opts {
/// Enable vsync in the compositor
pub enable_vsync: bool,
+
+ /// True to enable the webrender painting/compositing backend.
+ pub use_webrender: bool,
+
+ /// True to show webrender profiling stats on screen.
+ pub webrender_stats: bool,
+
+ /// True if WebRender should use multisample antialiasing.
+ pub use_msaa: bool,
}
fn print_usage(app: &str, opts: &Options) {
@@ -272,6 +281,12 @@ pub struct DebugOptions {
/// Disable vsync in the compositor
pub disable_vsync: bool,
+
+ /// Show webrender profiling stats on screen.
+ pub webrender_stats: bool,
+
+ /// Use multisample antialiasing in WebRender.
+ pub use_msaa: bool,
}
@@ -307,6 +322,8 @@ impl DebugOptions {
"gc-profile" => debug_options.gc_profile = true,
"load-webfonts-synchronously" => debug_options.load_webfonts_synchronously = true,
"disable-vsync" => debug_options.disable_vsync = true,
+ "wr-stats" => debug_options.webrender_stats = true,
+ "msaa" => debug_options.use_msaa = true,
"" => {},
_ => return Err(option)
};
@@ -354,6 +371,8 @@ pub fn print_debug_usage(app: &str) -> ! {
"Load web fonts synchronously to avoid non-deterministic network-driven reflows");
print_option("disable-vsync",
"Disable vsync mode in the compositor to allow profiling at more than monitor refresh rate");
+ print_option("wr-stats", "Show WebRender profiler on screen.");
+ print_option("msaa", "Use multisample antialiasing in WebRender.");
println!("");
@@ -483,6 +502,9 @@ pub fn default_opts() -> Opts {
exit_after_load: false,
no_native_titlebar: false,
enable_vsync: true,
+ use_webrender: false,
+ webrender_stats: false,
+ use_msaa: false,
}
}
@@ -526,6 +548,7 @@ pub fn from_cmdline_args(args: &[String]) -> ArgumentParsingResult {
opts.optmulti("", "pref",
"A preference to set to enable", "dom.mozbrowser.enabled");
opts.optflag("b", "no-native-titlebar", "Do not use native titlebar");
+ opts.optflag("w", "webrender", "Use webrender backend");
let opt_match = match opts.parse(args) {
Ok(m) => m,
@@ -668,6 +691,8 @@ pub fn from_cmdline_args(args: &[String]) -> ArgumentParsingResult {
(contents, url)
}).collect();
+ let use_webrender = opt_match.opt_present("w") && !opt_match.opt_present("z");
+
let opts = Opts {
is_running_problem_test: is_running_problem_test,
url: Some(url),
@@ -717,6 +742,9 @@ pub fn from_cmdline_args(args: &[String]) -> ArgumentParsingResult {
exit_after_load: opt_match.opt_present("x"),
no_native_titlebar: opt_match.opt_present("b"),
enable_vsync: !debug_options.disable_vsync,
+ use_webrender: use_webrender,
+ webrender_stats: debug_options.webrender_stats,
+ use_msaa: debug_options.use_msaa,
};
set_defaults(opts);