mirror of
https://github.com/servo/servo.git
synced 2025-08-09 15:35:34 +01:00
Add support for showing debug borders
This can help debug issues with the compositor and show when a page is creating layers.
This commit is contained in:
parent
4b689caa5d
commit
b5802659c2
4 changed files with 11 additions and 2 deletions
|
@ -143,11 +143,13 @@ impl IOCompositor {
|
||||||
let window_size = window.framebuffer_size();
|
let window_size = window.framebuffer_size();
|
||||||
let hidpi_factor = window.hidpi_factor();
|
let hidpi_factor = window.hidpi_factor();
|
||||||
|
|
||||||
|
let show_debug_borders = opts.show_debug_borders;
|
||||||
IOCompositor {
|
IOCompositor {
|
||||||
window: window,
|
window: window,
|
||||||
port: port,
|
port: port,
|
||||||
opts: opts,
|
opts: opts,
|
||||||
context: rendergl::init_render_context(CompositorTask::create_graphics_context()),
|
context: rendergl::RenderContext::new(CompositorTask::create_graphics_context(),
|
||||||
|
show_debug_borders),
|
||||||
root_pipeline: None,
|
root_pipeline: None,
|
||||||
scene: Scene::new(window_size.as_f32().to_untyped(), identity()),
|
scene: Scene::new(window_size.as_f32().to_untyped(), identity()),
|
||||||
window_size: window_size,
|
window_size: window_size,
|
||||||
|
|
|
@ -64,6 +64,7 @@ pub extern "C" fn cef_run_message_loop() {
|
||||||
headless: false,
|
headless: false,
|
||||||
hard_fail: false,
|
hard_fail: false,
|
||||||
bubble_inline_sizes_separately: false,
|
bubble_inline_sizes_separately: false,
|
||||||
|
show_debug_borders: false,
|
||||||
};
|
};
|
||||||
native::start(0, 0 as **u8, proc() {
|
native::start(0, 0 as **u8, proc() {
|
||||||
servo::run(opts);
|
servo::run(opts);
|
||||||
|
|
|
@ -68,6 +68,10 @@ pub struct Opts {
|
||||||
/// may wish to turn this flag on in order to benchmark style recalculation against other
|
/// may wish to turn this flag on in order to benchmark style recalculation against other
|
||||||
/// browser engines.
|
/// browser engines.
|
||||||
pub bubble_inline_sizes_separately: bool,
|
pub bubble_inline_sizes_separately: bool,
|
||||||
|
|
||||||
|
/// True if we should show borders on all layers and tiles for
|
||||||
|
/// debugging purposes (`--show-debug-borders`).
|
||||||
|
pub show_debug_borders: bool,
|
||||||
}
|
}
|
||||||
|
|
||||||
fn print_usage(app: &str, opts: &[getopts::OptGroup]) {
|
fn print_usage(app: &str, opts: &[getopts::OptGroup]) {
|
||||||
|
@ -99,6 +103,7 @@ pub fn from_cmdline_args(args: &[String]) -> Option<Opts> {
|
||||||
getopts::optflag("z", "headless", "Headless mode"),
|
getopts::optflag("z", "headless", "Headless mode"),
|
||||||
getopts::optflag("f", "hard-fail", "Exit on task failure instead of displaying about:failure"),
|
getopts::optflag("f", "hard-fail", "Exit on task failure instead of displaying about:failure"),
|
||||||
getopts::optflag("b", "bubble-widths", "Bubble intrinsic widths separately like other engines"),
|
getopts::optflag("b", "bubble-widths", "Bubble intrinsic widths separately like other engines"),
|
||||||
|
getopts::optflag("", "show-debug-borders", "Show debugging borders on layers and tiles."),
|
||||||
getopts::optflag("h", "help", "Print this message")
|
getopts::optflag("h", "help", "Print this message")
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -187,6 +192,7 @@ pub fn from_cmdline_args(args: &[String]) -> Option<Opts> {
|
||||||
headless: opt_match.opt_present("z"),
|
headless: opt_match.opt_present("z"),
|
||||||
hard_fail: opt_match.opt_present("f"),
|
hard_fail: opt_match.opt_present("f"),
|
||||||
bubble_inline_sizes_separately: opt_match.opt_present("b"),
|
bubble_inline_sizes_separately: opt_match.opt_present("b"),
|
||||||
|
show_debug_borders: opt_match.opt_present("show-debug-borders"),
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
Subproject commit 0f47c0a74863ccc7819c6667a4556f7b9b585670
|
Subproject commit 10e34dbdf9b9d4a437fedc412d37f13a42182e44
|
Loading…
Add table
Add a link
Reference in a new issue