mirror of
https://github.com/servo/servo.git
synced 2025-06-06 16:45:39 +00:00
Make the choice of layout runtime setting
Co-authored-by: Samson <16504129+sagudev@users.noreply.github.com>
This commit is contained in:
parent
f11c6045e3
commit
d31cdb682f
262 changed files with 1740 additions and 3700 deletions
|
@ -27,6 +27,9 @@ pub struct Opts {
|
|||
/// The initial URL to load.
|
||||
pub url: Option<ServoUrl>,
|
||||
|
||||
/// Whether or not the legacy layout system is enabled.
|
||||
pub legacy_layout: bool,
|
||||
|
||||
/// The maximum size of each tile in pixels (`-s`).
|
||||
pub tile_size: usize,
|
||||
|
||||
|
@ -376,6 +379,7 @@ pub fn default_opts() -> Opts {
|
|||
Opts {
|
||||
is_running_problem_test: false,
|
||||
url: None,
|
||||
legacy_layout: false,
|
||||
tile_size: 512,
|
||||
time_profiling: None,
|
||||
time_profiler_trace_path: None,
|
||||
|
@ -410,6 +414,7 @@ pub fn default_opts() -> Opts {
|
|||
pub fn from_cmdline_args(mut opts: Options, args: &[String]) -> ArgumentParsingResult {
|
||||
let (app_name, args) = args.split_first().unwrap();
|
||||
|
||||
opts.optflag("", "legacy-layout", "Use the legacy layout engine");
|
||||
opts.optflag("c", "cpu", "CPU painting");
|
||||
opts.optflag("g", "gpu", "GPU painting");
|
||||
opts.optopt("o", "output", "Output file", "output.png");
|
||||
|
@ -731,10 +736,17 @@ pub fn from_cmdline_args(mut opts: Options, args: &[String]) -> ArgumentParsingR
|
|||
|
||||
let is_printing_version = opt_match.opt_present("v") || opt_match.opt_present("version");
|
||||
|
||||
let legacy_layout = opt_match.opt_present("legacy-layout");
|
||||
if legacy_layout {
|
||||
set_pref!(layout.legacy_layout, true);
|
||||
set_pref!(layout.flexbox.enabled, true);
|
||||
}
|
||||
|
||||
let opts = Opts {
|
||||
debug: debug_options.clone(),
|
||||
is_running_problem_test,
|
||||
url: url_opt,
|
||||
legacy_layout,
|
||||
tile_size,
|
||||
time_profiling,
|
||||
time_profiler_trace_path: opt_match.opt_str("profiler-trace-path"),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue