mirror of
https://github.com/servo/servo.git
synced 2025-08-06 22:15:33 +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 hidpi_factor = window.hidpi_factor();
|
||||
|
||||
let show_debug_borders = opts.show_debug_borders;
|
||||
IOCompositor {
|
||||
window: window,
|
||||
port: port,
|
||||
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,
|
||||
scene: Scene::new(window_size.as_f32().to_untyped(), identity()),
|
||||
window_size: window_size,
|
||||
|
|
|
@ -64,6 +64,7 @@ pub extern "C" fn cef_run_message_loop() {
|
|||
headless: false,
|
||||
hard_fail: false,
|
||||
bubble_inline_sizes_separately: false,
|
||||
show_debug_borders: false,
|
||||
};
|
||||
native::start(0, 0 as **u8, proc() {
|
||||
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
|
||||
/// browser engines.
|
||||
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]) {
|
||||
|
@ -99,6 +103,7 @@ pub fn from_cmdline_args(args: &[String]) -> Option<Opts> {
|
|||
getopts::optflag("z", "headless", "Headless mode"),
|
||||
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("", "show-debug-borders", "Show debugging borders on layers and tiles."),
|
||||
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"),
|
||||
hard_fail: opt_match.opt_present("f"),
|
||||
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