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

Side by Side Diff: cc/layer_tree_host_impl.cc

Issue 11827009: cc: add PaintTimeCounter to keep track of per frame paint time (Closed) Base URL: http://git.chromium.org/chromium/src.git@ring
Patch Set: resolved nits, TimeDelta throughout the API Created 7 years, 11 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
« no previous file with comments | « cc/layer_tree_host_impl.h ('k') | cc/paint_time_counter.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2011 The Chromium Authors. All rights reserved. 1 // Copyright 2011 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/layer_tree_host_impl.h" 5 #include "cc/layer_tree_host_impl.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "base/debug/trace_event.h" 10 #include "base/debug/trace_event.h"
11 #include "base/json/json_writer.h" 11 #include "base/json/json_writer.h"
12 #include "base/stl_util.h" 12 #include "base/stl_util.h"
13 #include "cc/append_quads_data.h" 13 #include "cc/append_quads_data.h"
14 #include "cc/compositor_frame_metadata.h" 14 #include "cc/compositor_frame_metadata.h"
15 #include "cc/damage_tracker.h" 15 #include "cc/damage_tracker.h"
16 #include "cc/debug_rect_history.h" 16 #include "cc/debug_rect_history.h"
17 #include "cc/delay_based_time_source.h" 17 #include "cc/delay_based_time_source.h"
18 #include "cc/delegating_renderer.h" 18 #include "cc/delegating_renderer.h"
19 #include "cc/frame_rate_counter.h" 19 #include "cc/frame_rate_counter.h"
20 #include "cc/gl_renderer.h" 20 #include "cc/gl_renderer.h"
21 #include "cc/heads_up_display_layer_impl.h" 21 #include "cc/heads_up_display_layer_impl.h"
22 #include "cc/layer_iterator.h" 22 #include "cc/layer_iterator.h"
23 #include "cc/layer_tree_host.h" 23 #include "cc/layer_tree_host.h"
24 #include "cc/layer_tree_host_common.h" 24 #include "cc/layer_tree_host_common.h"
25 #include "cc/layer_tree_impl.h" 25 #include "cc/layer_tree_impl.h"
26 #include "cc/math_util.h" 26 #include "cc/math_util.h"
27 #include "cc/overdraw_metrics.h" 27 #include "cc/overdraw_metrics.h"
28 #include "cc/page_scale_animation.h" 28 #include "cc/page_scale_animation.h"
29 #include "cc/paint_time_counter.h"
29 #include "cc/prioritized_resource_manager.h" 30 #include "cc/prioritized_resource_manager.h"
30 #include "cc/quad_culler.h" 31 #include "cc/quad_culler.h"
31 #include "cc/render_pass_draw_quad.h" 32 #include "cc/render_pass_draw_quad.h"
32 #include "cc/rendering_stats.h" 33 #include "cc/rendering_stats.h"
33 #include "cc/scrollbar_animation_controller.h" 34 #include "cc/scrollbar_animation_controller.h"
34 #include "cc/scrollbar_layer_impl.h" 35 #include "cc/scrollbar_layer_impl.h"
35 #include "cc/shared_quad_state.h" 36 #include "cc/shared_quad_state.h"
36 #include "cc/single_thread_proxy.h" 37 #include "cc/single_thread_proxy.h"
37 #include "cc/software_renderer.h" 38 #include "cc/software_renderer.h"
38 #include "cc/solid_color_draw_quad.h" 39 #include "cc/solid_color_draw_quad.h"
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
136 , m_deviceScaleFactor(1) 137 , m_deviceScaleFactor(1)
137 , m_visible(true) 138 , m_visible(true)
138 , m_contentsTexturesPurged(false) 139 , m_contentsTexturesPurged(false)
139 , m_managedMemoryPolicy(PrioritizedResourceManager::defaultMemoryAllocationL imit(), 140 , m_managedMemoryPolicy(PrioritizedResourceManager::defaultMemoryAllocationL imit(),
140 ManagedMemoryPolicy::CUTOFF_ALLOW_EVERYTHING, 141 ManagedMemoryPolicy::CUTOFF_ALLOW_EVERYTHING,
141 0, 142 0,
142 ManagedMemoryPolicy::CUTOFF_ALLOW_NOTHING) 143 ManagedMemoryPolicy::CUTOFF_ALLOW_NOTHING)
143 , m_needsUpdateDrawProperties(false) 144 , m_needsUpdateDrawProperties(false)
144 , m_pinchGestureActive(false) 145 , m_pinchGestureActive(false)
145 , m_fpsCounter(FrameRateCounter::create(m_proxy->hasImplThread())) 146 , m_fpsCounter(FrameRateCounter::create(m_proxy->hasImplThread()))
147 , m_paintTimeCounter(PaintTimeCounter::create())
146 , m_debugRectHistory(DebugRectHistory::create()) 148 , m_debugRectHistory(DebugRectHistory::create())
147 , m_numImplThreadScrolls(0) 149 , m_numImplThreadScrolls(0)
148 , m_numMainThreadScrolls(0) 150 , m_numMainThreadScrolls(0)
149 , m_cumulativeNumLayersDrawn(0) 151 , m_cumulativeNumLayersDrawn(0)
150 , m_cumulativeNumMissingTiles(0) 152 , m_cumulativeNumMissingTiles(0)
151 , m_lastSentMemoryVisibleBytes(0) 153 , m_lastSentMemoryVisibleBytes(0)
152 , m_lastSentMemoryVisibleAndNearbyBytes(0) 154 , m_lastSentMemoryVisibleAndNearbyBytes(0)
153 , m_lastSentMemoryUseBytes(0) 155 , m_lastSentMemoryUseBytes(0)
154 , m_animationRegistrar(AnimationRegistrar::create()) 156 , m_animationRegistrar(AnimationRegistrar::create())
155 { 157 {
(...skipping 1514 matching lines...) Expand 10 before | Expand all | Expand 10 after
1670 return NULL; 1672 return NULL;
1671 } 1673 }
1672 1674
1673 skia::RefPtr<SkPicture> LayerTreeHostImpl::capturePicture() 1675 skia::RefPtr<SkPicture> LayerTreeHostImpl::capturePicture()
1674 { 1676 {
1675 LayerTreeImpl* tree = pendingTree() ? pendingTree() : activeTree(); 1677 LayerTreeImpl* tree = pendingTree() ? pendingTree() : activeTree();
1676 LayerImpl* layer = getNonCompositedContentLayerRecursive(tree->RootLayer()); 1678 LayerImpl* layer = getNonCompositedContentLayerRecursive(tree->RootLayer());
1677 return layer ? layer->getPicture() : skia::RefPtr<SkPicture>(); 1679 return layer ? layer->getPicture() : skia::RefPtr<SkPicture>();
1678 } 1680 }
1679 1681
1682 void LayerTreeHostImpl::savePaintTime(const base::TimeDelta& totalPaintTime)
1683 {
1684 m_paintTimeCounter->SavePaintTime(totalPaintTime);
1685 }
1686
1680 } // namespace cc 1687 } // namespace cc
OLDNEW
« no previous file with comments | « cc/layer_tree_host_impl.h ('k') | cc/paint_time_counter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698