Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(358)

Side by Side Diff: cc/debug/overdraw_metrics.cc

Issue 23171014: Fix UpdateTilePriorities viewport in Android WebView. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add tests Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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/debug/overdraw_metrics.h" 5 #include "cc/debug/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/base/math_util.h" 9 #include "cc/base/math_util.h"
10 #include "cc/trees/layer_tree_host.h" 10 #include "cc/trees/layer_tree_host.h"
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
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->device_viewport_size(); 154 return host_impl->DeviceViewport().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 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
259 contents_texture_use_bytes_, 259 contents_texture_use_bytes_,
260 "RenderSurfaceTextureBytes", 260 "RenderSurfaceTextureBytes",
261 render_surface_texture_use_bytes_); 261 render_surface_texture_use_bytes_);
262 } 262 }
263 break; 263 break;
264 } 264 }
265 } 265 }
266 } 266 }
267 267
268 } // namespace cc 268 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698