| 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 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 140 # first frame requested has more variance in the number of pixels | 140 # first frame requested has more variance in the number of pixels |
| 141 # rasterized. | 141 # rasterized. |
| 142 tab.ExecuteJavaScript(""" | 142 tab.ExecuteJavaScript(""" |
| 143 window.__rafFired = false; | 143 window.__rafFired = false; |
| 144 window.webkitRequestAnimationFrame(function() { | 144 window.webkitRequestAnimationFrame(function() { |
| 145 chrome.gpuBenchmarking.setNeedsDisplayOnAllLayers(); | 145 chrome.gpuBenchmarking.setNeedsDisplayOnAllLayers(); |
| 146 window.__rafFired = true; | 146 window.__rafFired = true; |
| 147 }); | 147 }); |
| 148 """) | 148 """) |
| 149 | 149 |
| 150 tab.browser.StartTracing('webkit,benchmark', 60) | 150 tab.browser.StartTracing('webkit,webkit.console,benchmark', 60) |
| 151 self._metrics.Start() | 151 self._metrics.Start() |
| 152 | 152 |
| 153 tab.ExecuteJavaScript(""" | 153 tab.ExecuteJavaScript(""" |
| 154 console.time("measureNextFrame"); | 154 console.time("measureNextFrame"); |
| 155 window.__rafFired = false; | 155 window.__rafFired = false; |
| 156 window.webkitRequestAnimationFrame(function() { | 156 window.webkitRequestAnimationFrame(function() { |
| 157 chrome.gpuBenchmarking.setNeedsDisplayOnAllLayers(); | 157 chrome.gpuBenchmarking.setNeedsDisplayOnAllLayers(); |
| 158 window.__rafFired = true; | 158 window.__rafFired = true; |
| 159 }); | 159 }); |
| 160 """) | 160 """) |
| (...skipping 22 matching lines...) Expand all Loading... |
| 183 results.Add('total_pixels_rasterized', 'pixels', | 183 results.Add('total_pixels_rasterized', 'pixels', |
| 184 collector.total_pixels_rasterized, | 184 collector.total_pixels_rasterized, |
| 185 data_type='unimportant') | 185 data_type='unimportant') |
| 186 results.Add('total_pixels_recorded', 'pixels', | 186 results.Add('total_pixels_recorded', 'pixels', |
| 187 collector.total_pixels_recorded, | 187 collector.total_pixels_recorded, |
| 188 data_type='unimportant') | 188 data_type='unimportant') |
| 189 | 189 |
| 190 if self.options.report_all_results: | 190 if self.options.report_all_results: |
| 191 for k, v in rendering_stats.iteritems(): | 191 for k, v in rendering_stats.iteritems(): |
| 192 results.Add(k, '', v) | 192 results.Add(k, '', v) |
| OLD | NEW |