mirror of
https://github.com/servo/servo.git
synced 2025-08-05 13:40:08 +01:00
Auto merge of #6666 - glennw:exit-flag, r=larsbergstrom
Restore exit after load command line flag. Also updates glutin with a crash fix that was exposed by this patch. <!-- Reviewable:start --> [<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/6666) <!-- Reviewable:end -->
This commit is contained in:
commit
5ac80bff8e
6 changed files with 24 additions and 12 deletions
|
@ -412,7 +412,7 @@ impl<Window: WindowMethods> IOCompositor<Window> {
|
|||
self.got_load_complete_message = true;
|
||||
|
||||
// If we're painting in headless mode, schedule a recomposite.
|
||||
if opts::get().output_file.is_some() {
|
||||
if opts::get().output_file.is_some() || opts::get().exit_after_load {
|
||||
self.composite_if_necessary(CompositingReason::Headless);
|
||||
}
|
||||
|
||||
|
@ -1376,8 +1376,12 @@ impl<Window: WindowMethods> IOCompositor<Window> {
|
|||
if !self.is_ready_to_paint_image_output() {
|
||||
return None
|
||||
}
|
||||
},
|
||||
_ => {}
|
||||
}
|
||||
CompositeTarget::Window => {
|
||||
if opts::get().exit_after_load && !self.is_ready_to_paint_image_output() {
|
||||
return None
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
let (framebuffer_ids, texture_ids) = match target {
|
||||
|
@ -1414,15 +1418,17 @@ impl<Window: WindowMethods> IOCompositor<Window> {
|
|||
let path = opts::get().output_file.as_ref().unwrap();
|
||||
let res = png::store_png(&mut img, &path);
|
||||
assert!(res.is_ok());
|
||||
|
||||
debug!("shutting down the constellation after generating an output file");
|
||||
let ConstellationChan(ref chan) = self.constellation_chan;
|
||||
chan.send(ConstellationMsg::Exit).unwrap();
|
||||
self.shutdown_state = ShutdownState::ShuttingDown;
|
||||
None
|
||||
}
|
||||
};
|
||||
|
||||
if opts::get().output_file.is_some() || opts::get().exit_after_load {
|
||||
debug!("shutting down the constellation (after generating an output file or exit flag specified)");
|
||||
let ConstellationChan(ref chan) = self.constellation_chan;
|
||||
chan.send(ConstellationMsg::Exit).unwrap();
|
||||
self.shutdown_state = ShutdownState::ShuttingDown;
|
||||
}
|
||||
|
||||
// Perform the page flip. This will likely block for a while.
|
||||
self.window.present();
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue