Add wr-debug option.

This commit is contained in:
Glenn Watson 2016-08-02 07:03:38 +10:00 committed by Ms2ger
parent b2f69f3635
commit e5f183a086
2 changed files with 11 additions and 1 deletions

View file

@ -150,6 +150,7 @@ impl<Window> Browser<Window> where Window: WindowMethods + 'static {
enable_aa: opts.enable_text_antialiasing, enable_aa: opts.enable_text_antialiasing,
enable_msaa: opts.use_msaa, enable_msaa: opts.use_msaa,
enable_profiler: opts.webrender_stats, enable_profiler: opts.webrender_stats,
debug: opts.webrender_debug,
}); });
(Some(webrender), Some(webrender_sender)) (Some(webrender), Some(webrender_sender))
} else { } else {

View file

@ -191,6 +191,9 @@ pub struct Opts {
/// True to show webrender profiling stats on screen. /// True to show webrender profiling stats on screen.
pub webrender_stats: bool, pub webrender_stats: bool,
/// True to show webrender debug on screen.
pub webrender_debug: bool,
/// True if WebRender should use multisample antialiasing. /// True if WebRender should use multisample antialiasing.
pub use_msaa: bool, pub use_msaa: bool,
@ -289,6 +292,9 @@ pub struct DebugOptions {
/// Show webrender profiling stats on screen. /// Show webrender profiling stats on screen.
pub webrender_stats: bool, pub webrender_stats: bool,
/// Show webrender debug on screen.
pub webrender_debug: bool,
/// Use multisample antialiasing in WebRender. /// Use multisample antialiasing in WebRender.
pub use_msaa: bool, pub use_msaa: bool,
@ -328,6 +334,7 @@ impl DebugOptions {
"load-webfonts-synchronously" => debug_options.load_webfonts_synchronously = true, "load-webfonts-synchronously" => debug_options.load_webfonts_synchronously = true,
"disable-vsync" => debug_options.disable_vsync = true, "disable-vsync" => debug_options.disable_vsync = true,
"wr-stats" => debug_options.webrender_stats = true, "wr-stats" => debug_options.webrender_stats = true,
"wr-debug" => debug_options.webrender_debug = true,
"msaa" => debug_options.use_msaa = true, "msaa" => debug_options.use_msaa = true,
"full-backtraces" => debug_options.full_backtraces = true, "full-backtraces" => debug_options.full_backtraces = true,
"" => {}, "" => {},
@ -377,6 +384,7 @@ pub fn print_debug_usage(app: &str) -> ! {
print_option("wr-stats", "Show WebRender profiler on screen."); print_option("wr-stats", "Show WebRender profiler on screen.");
print_option("msaa", "Use multisample antialiasing in WebRender."); print_option("msaa", "Use multisample antialiasing in WebRender.");
print_option("full-backtraces", "Print full backtraces for all errors"); print_option("full-backtraces", "Print full backtraces for all errors");
print_option("wr-debug", "Display webrender tile borders. Must be used with -w option.");
println!(""); println!("");
@ -511,6 +519,7 @@ pub fn default_opts() -> Opts {
config_dir: None, config_dir: None,
full_backtraces: false, full_backtraces: false,
is_printing_version: false, is_printing_version: false,
webrender_debug: false,
} }
} }
@ -570,7 +579,6 @@ pub fn from_cmdline_args(args: &[String]) -> ArgumentParsingResult {
"config directory following xdg spec on linux platform", ""); "config directory following xdg spec on linux platform", "");
opts.optflag("v", "version", "Display servo version information"); opts.optflag("v", "version", "Display servo version information");
let opt_match = match opts.parse(args) { let opt_match = match opts.parse(args) {
Ok(m) => m, Ok(m) => m,
Err(f) => args_fail(&f.to_string()), Err(f) => args_fail(&f.to_string()),
@ -815,6 +823,7 @@ pub fn from_cmdline_args(args: &[String]) -> ArgumentParsingResult {
config_dir: opt_match.opt_str("config-dir"), config_dir: opt_match.opt_str("config-dir"),
full_backtraces: debug_options.full_backtraces, full_backtraces: debug_options.full_backtraces,
is_printing_version: is_printing_version, is_printing_version: is_printing_version,
webrender_debug: debug_options.webrender_debug,
}; };
set_defaults(opts); set_defaults(opts);