Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
| 4 import os | 4 import os |
| 5 | 5 |
| 6 from telemetry.page import page_measurement | 6 from telemetry.page import page_measurement |
| 7 | 7 |
| 8 _JS = 'chrome.gpuBenchmarking.printToSkPicture("{0}");' | 8 _JS = 'chrome.gpuBenchmarking.printToSkPicture("{0}");' |
| 9 | 9 |
| 10 class SkPicturePrinter(page_measurement.PageMeasurement): | 10 class SkPicturePrinter(page_measurement.PageMeasurement): |
| 11 def AddCommandLineOptions(self, parser): | 11 def AddCommandLineOptions(self, parser): |
| 12 parser.add_option('-o', '--outdir', help='Output directory') | 12 parser.add_option('-s', '--skp_outdir', |
| 13 help='Output directory for the SKP files') | |
| 13 | 14 |
| 14 def CustomizeBrowserOptions(self, options): | 15 def CustomizeBrowserOptions(self, options): |
| 15 options.extra_browser_args.extend(['--enable-gpu-benchmarking', | 16 options.extra_browser_args.extend(['--enable-gpu-benchmarking', |
| 16 '--no-sandbox']) | 17 '--no-sandbox', |
| 18 '--enable-deferred-image-decoding', | |
| 19 '--force-compositing-mode']) | |
| 17 | 20 |
| 18 def MeasurePage(self, page, tab, results): | 21 def MeasurePage(self, page, tab, results): |
| 19 if self.options.outdir is not None: | 22 outpath = os.path.abspath( |
|
nduca
2013/05/28 18:50:25
why'd you remove the is not none handling?
rmistry
2013/05/28 18:55:11
If outdir was not specified (None), the next line
| |
| 20 outpath = os.path.join(self.options.outdir, page.url_as_file_safe_name) | 23 os.path.join(self.options.skp_outdir, |
| 21 outpath = os.path.abspath(outpath) | 24 page.url_as_file_safe_name)) |
| 22 # Replace win32 path separator char '\' with '\\'. | 25 # Replace win32 path separator char '\' with '\\'. |
| 23 js = _JS.format(outpath.replace('\\', '\\\\')) | 26 js = _JS.format(outpath.replace('\\', '\\\\')) |
| 24 tab.EvaluateJavaScript(js) | 27 tab.EvaluateJavaScript(js) |
| 25 results.Add('output_path', 'path', outpath) | 28 results.Add('output_path', 'path', outpath) |
| OLD | NEW |