Chromium Code Reviews| Index: perf_tools/skpicture_printer.py |
| =================================================================== |
| --- perf_tools/skpicture_printer.py (revision 198791) |
| +++ perf_tools/skpicture_printer.py (working copy) |
| @@ -1,7 +1,9 @@ |
| # Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| # Use of this source code is governed by a BSD-style license that can be |
| # found in the LICENSE file. |
| +import logging |
| import os |
| +import tempfile |
| from telemetry.page import page_measurement |
| @@ -9,16 +11,24 @@ |
| class SkPicturePrinter(page_measurement.PageMeasurement): |
| def AddCommandLineOptions(self, parser): |
| - parser.add_option('-o', '--outdir', help='Output directory') |
| + parser.add_option('-s', '--skp-outdir', |
| + help='Output directory for the SKP files') |
| def CustomizeBrowserOptions(self, options): |
| options.extra_browser_args.extend(['--enable-gpu-benchmarking', |
| - '--no-sandbox']) |
| + '--no-sandbox', |
| + '--enable-deferred-image-decoding', |
| + '--force-compositing-mode']) |
| def MeasurePage(self, page, tab, results): |
| - if self.options.outdir is not None: |
| - outpath = os.path.join(self.options.outdir, page.url_as_file_safe_name) |
| - outpath = os.path.abspath(outpath) |
| + skp_outdir = self.options.skp-outdir |
|
dtu
2013/05/28 21:35:55
Sorry, the variable name is still skp_outdir, the
rmistry
2013/05/28 21:41:32
I should change it back to skp_outdir then?
|
| + if not skp_outdir: |
| + skp_outdir = tempfile.gettempdir() |
| + logging.warning('--skp-outdir has not been specified, outputting to ' |
| + '%s instead.' % skp_outdir) |
| + outpath = os.path.abspath( |
| + os.path.join(skp_outdir, |
| + page.url_as_file_safe_name)) |
| # Replace win32 path separator char '\' with '\\'. |
| js = _JS.format(outpath.replace('\\', '\\\\')) |
| tab.EvaluateJavaScript(js) |