diff options
author | KimSnj <karimair@gmail.com> | 2016-11-27 18:15:51 +0100 |
---|---|---|
committer | KimSnj <karimair@gmail.com> | 2016-11-27 18:15:51 +0100 |
commit | b5b76e80536c1245e9535980f6b00347f1dcd648 (patch) | |
tree | 4518ca1d95b4429e8b432f23d8ce0fcfd80fb8c1 /python/servo/post_build_commands.py | |
parent | c4f87f451faf8eeac3e046c38ebf8b9b3dd0051e (diff) | |
download | servo-b5b76e80536c1245e9535980f6b00347f1dcd648.tar.gz servo-b5b76e80536c1245e9535980f6b00347f1dcd648.zip |
Use software rendering when running servo in headless mode
Diffstat (limited to 'python/servo/post_build_commands.py')
-rw-r--r-- | python/servo/post_build_commands.py | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/python/servo/post_build_commands.py b/python/servo/post_build_commands.py index 78e1a230ed5..af5270df007 100644 --- a/python/servo/post_build_commands.py +++ b/python/servo/post_build_commands.py @@ -22,7 +22,11 @@ from mach.decorators import ( Command, ) -from servo.command_base import CommandBase, call, check_call, find_dep_path_newest, is_windows, is_macosx +from servo.command_base import ( + CommandBase, + call, check_call, find_dep_path_newest, + is_windows, is_macosx, set_osmesa_env, +) def read_file(filename, if_exists=False): @@ -52,10 +56,13 @@ class PostBuildCommands(CommandBase): help='Name of debugger to use.') @CommandArgument('--browserhtml', '-b', action='store_true', help='Launch with Browser.html') + @CommandArgument('--headless', '-z', action='store_true', + help='Launch in headless mode') @CommandArgument( 'params', nargs='...', help="Command-line arguments to be passed through to Servo") - def run(self, params, release=False, dev=False, android=None, debug=False, debugger=None, browserhtml=False): + def run(self, params, release=False, dev=False, android=None, debug=False, debugger=None, browserhtml=False, + headless=False): env = self.build_env() env["RUST_BACKTRACE"] = "1" @@ -107,6 +114,10 @@ class PostBuildCommands(CommandBase): '--pref', 'shell.builtin-key-shortcuts.enabled=false', path.join(browserhtml_path, 'out', 'index.html')] + if headless: + set_osmesa_env(args[0], env) + args.append('-z') + # Borrowed and modified from: # http://hg.mozilla.org/mozilla-central/file/c9cfa9b91dea/python/mozbuild/mozbuild/mach_commands.py#l883 if debug: |