| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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 #include "cc/overdraw_metrics.h" | 5 #include "cc/overdraw_metrics.h" |
| 6 | 6 |
| 7 #include "base/debug/trace_event.h" | 7 #include "base/debug/trace_event.h" |
| 8 #include "base/metrics/histogram.h" | 8 #include "base/metrics/histogram.h" |
| 9 #include "cc/layer_tree_host.h" | 9 #include "cc/layer_tree_host.h" |
| 10 #include "cc/layer_tree_host_impl.h" | 10 #include "cc/layer_tree_host_impl.h" |
| (...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 144 if (record_metrics_for_frame_) { | 144 if (record_metrics_for_frame_) { |
| 145 RecordMetricsInternal<LayerTreeHostImpl>(DrawingToScreen, | 145 RecordMetricsInternal<LayerTreeHostImpl>(DrawingToScreen, |
| 146 layer_tree_host_impl); | 146 layer_tree_host_impl); |
| 147 } | 147 } |
| 148 } | 148 } |
| 149 | 149 |
| 150 static gfx::Size DeviceViewportSize(const LayerTreeHost* host) { | 150 static gfx::Size DeviceViewportSize(const LayerTreeHost* host) { |
| 151 return host->device_viewport_size(); | 151 return host->device_viewport_size(); |
| 152 } | 152 } |
| 153 static gfx::Size DeviceViewportSize(const LayerTreeHostImpl* host_impl) { | 153 static gfx::Size DeviceViewportSize(const LayerTreeHostImpl* host_impl) { |
| 154 return host_impl->DeviceViewportSize(); | 154 return host_impl->device_viewport_size(); |
| 155 } | 155 } |
| 156 | 156 |
| 157 template <typename LayerTreeHostType> | 157 template <typename LayerTreeHostType> |
| 158 void OverdrawMetrics::RecordMetricsInternal( | 158 void OverdrawMetrics::RecordMetricsInternal( |
| 159 MetricsType metrics_type, | 159 MetricsType metrics_type, |
| 160 const LayerTreeHostType* layer_tree_host) const { | 160 const LayerTreeHostType* layer_tree_host) const { |
| 161 // This gives approximately 10x the percentage of pixels to fill the viewport | 161 // This gives approximately 10x the percentage of pixels to fill the viewport |
| 162 // once. | 162 // once. |
| 163 float normalization = 1000.f / (DeviceViewportSize(layer_tree_host).width() * | 163 float normalization = 1000.f / (DeviceViewportSize(layer_tree_host).width() * |
| 164 DeviceViewportSize(layer_tree_host).height()); | 164 DeviceViewportSize(layer_tree_host).height()); |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 258 contents_texture_use_bytes_, | 258 contents_texture_use_bytes_, |
| 259 "RenderSurfaceTextureBytes", | 259 "RenderSurfaceTextureBytes", |
| 260 render_surface_texture_use_bytes_); | 260 render_surface_texture_use_bytes_); |
| 261 } | 261 } |
| 262 break; | 262 break; |
| 263 } | 263 } |
| 264 } | 264 } |
| 265 } | 265 } |
| 266 | 266 |
| 267 } // namespace cc | 267 } // namespace cc |
| OLD | NEW |