diff options
author | bors-servo <lbergstrom+bors@mozilla.com> | 2016-02-19 00:54:06 +0530 |
---|---|---|
committer | bors-servo <lbergstrom+bors@mozilla.com> | 2016-02-19 00:54:06 +0530 |
commit | ab07b06823ea9748a6091aee2281495f86f00bce (patch) | |
tree | 2dd06ac4834d5bc4bcba6e4ada3aab12bb2c12d9 /components/util/opts.rs | |
parent | fe70efe07f6d72665f10c752884e5705d5bdc600 (diff) | |
parent | c0531c312fdb0783e4d121b4c2d7f15d4f5cdc1f (diff) | |
download | servo-ab07b06823ea9748a6091aee2281495f86f00bce.tar.gz servo-ab07b06823ea9748a6091aee2281495f86f00bce.zip |
Auto merge of #9589 - glennw:webrender, r=pcwalton
Add WebRender integration to Servo.
WebRender is an experimental GPU accelerated rendering backend for Servo.
The WebRender backend can be specified by running Servo with the -w option (otherwise the default rendering backend will be used).
WebRender has many bugs, and missing features - but it is usable to browse most websites - please report any WebRender specific rendering bugs you encounter!
<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.svg" height="40" alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/9589)
<!-- Reviewable:end -->
Diffstat (limited to 'components/util/opts.rs')
-rw-r--r-- | components/util/opts.rs | 28 |
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); |