No more headless compositor. Just the normal one.

This changes headless operation to strictly be a runtime option, rather
than a compile-time one. Note that the old headless version still relied
on a display server to support WebGL, while it now requires one all the
time.

Fixes #8573
This commit is contained in:
Michael Howell 2016-01-01 17:11:10 -07:00
parent f2f05869d6
commit c9cb4839e4
25 changed files with 119 additions and 474 deletions

View file

@ -79,7 +79,6 @@ use profile::mem as profile_mem;
use profile::time as profile_time;
use profile_traits::mem;
use profile_traits::time;
use std::borrow::Borrow;
use std::rc::Rc;
use std::sync::mpsc::Sender;
use util::opts;
@ -103,7 +102,7 @@ pub struct Browser {
}
impl Browser {
pub fn new<Window>(window: Option<Rc<Window>>) -> Browser
pub fn new<Window>(window: Rc<Window>) -> Browser
where Window: WindowMethods + 'static {
// Global configuration options, parsed from the command line.
let opts = opts::get();
@ -115,14 +114,8 @@ impl Browser {
// messages to client may need to pump a platform-specific event loop
// to deliver the message.
let (compositor_proxy, compositor_receiver) =
WindowMethods::create_compositor_channel(&window);
let supports_clipboard = match window {
Some(ref win_rc) => {
let win: &Window = win_rc.borrow();
win.supports_clipboard()
}
None => false
};
window.create_compositor_channel();
let supports_clipboard = window.supports_clipboard();
let time_profiler_chan = profile_time::Profiler::create(opts.time_profiler_period);
let mem_profiler_chan = profile_mem::Profiler::create(opts.mem_profiler_period);
let devtools_chan = opts.devtools_port.map(|port| {
@ -134,9 +127,7 @@ impl Browser {
resource_path.push("shaders");
// TODO(gw): Duplicates device_pixels_per_screen_px from compositor. Tidy up!
let hidpi_factor = window.as_ref()
.map(|window| window.hidpi_factor().get())
.unwrap_or(1.0);
let hidpi_factor = window.hidpi_factor().get();
let device_pixel_ratio = match opts.device_pixels_per_px {
Some(device_pixels_per_px) => device_pixels_per_px,
None => match opts.output_file {