mirror of
https://github.com/servo/servo.git
synced 2025-08-03 12:40:06 +01:00
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 -->
This commit is contained in:
commit
ab07b06823
74 changed files with 2862 additions and 886 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue