| 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 | 4 |
| 5 import time | 5 import time |
| 6 | 6 |
| 7 from metrics import smoothness | 7 from metrics import smoothness |
| 8 from telemetry.page import page_measurement | 8 from telemetry.page import page_measurement |
| 9 | 9 |
| 10 class StatsCollector(object): | 10 class StatsCollector(object): |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 111 default=5, | 111 default=5, |
| 112 help='Wait time before measurement is taken ' + | 112 help='Wait time before measurement is taken ' + |
| 113 '(must be long enough to render one frame)') | 113 '(must be long enough to render one frame)') |
| 114 | 114 |
| 115 def CustomizeBrowserOptions(self, options): | 115 def CustomizeBrowserOptions(self, options): |
| 116 smoothness.SmoothnessMetrics.CustomizeBrowserOptions(options) | 116 smoothness.SmoothnessMetrics.CustomizeBrowserOptions(options) |
| 117 # Run each raster task N times. This allows us to report the time for the | 117 # Run each raster task N times. This allows us to report the time for the |
| 118 # best run, effectively excluding cache effects and time when the thread is | 118 # best run, effectively excluding cache effects and time when the thread is |
| 119 # de-scheduled. | 119 # de-scheduled. |
| 120 options.AppendExtraBrowserArgs([ | 120 options.AppendExtraBrowserArgs([ |
| 121 '--slow-down-raster-scale-factor=%d' % options.raster_record_repeat, | 121 '--slow-down-raster-scale-factor=%d' % int( |
| 122 options.raster_record_repeat), |
| 122 # Enable impl-side-painting. Current version of benchmark only works for | 123 # Enable impl-side-painting. Current version of benchmark only works for |
| 123 # this mode. | 124 # this mode. |
| 124 '--enable-impl-side-painting', | 125 '--enable-impl-side-painting', |
| 125 '--force-compositing-mode', | 126 '--force-compositing-mode', |
| 126 '--enable-threaded-compositing' | 127 '--enable-threaded-compositing' |
| 127 ]) | 128 ]) |
| 128 | 129 |
| 129 def MeasurePage(self, page, tab, results): | 130 def MeasurePage(self, page, tab, results): |
| 130 self._metrics = smoothness.SmoothnessMetrics(tab) | 131 self._metrics = smoothness.SmoothnessMetrics(tab) |
| 131 | 132 |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 183 results.Add('total_pixels_rasterized', 'pixels', | 184 results.Add('total_pixels_rasterized', 'pixels', |
| 184 collector.total_pixels_rasterized, | 185 collector.total_pixels_rasterized, |
| 185 data_type='unimportant') | 186 data_type='unimportant') |
| 186 results.Add('total_pixels_recorded', 'pixels', | 187 results.Add('total_pixels_recorded', 'pixels', |
| 187 collector.total_pixels_recorded, | 188 collector.total_pixels_recorded, |
| 188 data_type='unimportant') | 189 data_type='unimportant') |
| 189 | 190 |
| 190 if self.options.report_all_results: | 191 if self.options.report_all_results: |
| 191 for k, v in rendering_stats.iteritems(): | 192 for k, v in rendering_stats.iteritems(): |
| 192 results.Add(k, '', v) | 193 results.Add(k, '', v) |
| OLD | NEW |