Commit a1b5ca87 authored by rmistry@google.com's avatar rmistry@google.com

Modifications to skpicture_printer

* Changed the output directory option to '-s' and '--skp-outdir' because this was broken, running run_multipage_benchmarks with skpicture_printer resulted in the following error: 
optparse.OptionConflictError: option -o/--outdir: conflicting option string(s): -o 

* Added additional browser options due on recent changes in Skia/Chromium code base.

Review URL: https://chromiumcodereview.appspot.com/15665003

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@202895 0039d316-1c4b-4281-b951-d872f2087c98
parent eec35f63
...@@ -9,16 +9,22 @@ _JS = 'chrome.gpuBenchmarking.printToSkPicture("{0}");' ...@@ -9,16 +9,22 @@ _JS = 'chrome.gpuBenchmarking.printToSkPicture("{0}");'
class SkPicturePrinter(page_measurement.PageMeasurement): class SkPicturePrinter(page_measurement.PageMeasurement):
def AddCommandLineOptions(self, parser): 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): def CustomizeBrowserOptions(self, options):
options.extra_browser_args.extend(['--enable-gpu-benchmarking', 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): def MeasurePage(self, page, tab, results):
if self.options.outdir is not None: skp_outdir = self.options.skp_outdir
outpath = os.path.join(self.options.outdir, page.url_as_file_safe_name) if not skp_outdir:
outpath = os.path.abspath(outpath) raise Exception('Please specify --skp-outdir')
outpath = os.path.abspath(
os.path.join(skp_outdir,
page.url_as_file_safe_name))
# Replace win32 path separator char '\' with '\\'. # Replace win32 path separator char '\' with '\\'.
js = _JS.format(outpath.replace('\\', '\\\\')) js = _JS.format(outpath.replace('\\', '\\\\'))
tab.EvaluateJavaScript(js) tab.EvaluateJavaScript(js)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment