| OLD | NEW |
| 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" |
| (...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 158 visible_(true), | 158 visible_(true), |
| 159 managed_memory_policy_( | 159 managed_memory_policy_( |
| 160 PrioritizedResourceManager::defaultMemoryAllocationLimit(), | 160 PrioritizedResourceManager::defaultMemoryAllocationLimit(), |
| 161 ManagedMemoryPolicy::CUTOFF_ALLOW_EVERYTHING, | 161 ManagedMemoryPolicy::CUTOFF_ALLOW_EVERYTHING, |
| 162 0, | 162 0, |
| 163 ManagedMemoryPolicy::CUTOFF_ALLOW_NOTHING), | 163 ManagedMemoryPolicy::CUTOFF_ALLOW_NOTHING), |
| 164 pinch_gesture_active_(false), | 164 pinch_gesture_active_(false), |
| 165 fps_counter_(FrameRateCounter::create(proxy_->HasImplThread())), | 165 fps_counter_(FrameRateCounter::create(proxy_->HasImplThread())), |
| 166 paint_time_counter_(PaintTimeCounter::create()), | 166 paint_time_counter_(PaintTimeCounter::create()), |
| 167 memory_history_(MemoryHistory::Create()), | 167 memory_history_(MemoryHistory::Create()), |
| 168 debug_rect_history_(DebugRectHistory::create()), | 168 debug_rect_history_(DebugRectHistory::Create()), |
| 169 num_impl_thread_scrolls_(0), | 169 num_impl_thread_scrolls_(0), |
| 170 num_main_thread_scrolls_(0), | 170 num_main_thread_scrolls_(0), |
| 171 cumulative_num_layers_drawn_(0), | 171 cumulative_num_layers_drawn_(0), |
| 172 cumulative_num_missing_tiles_(0), | 172 cumulative_num_missing_tiles_(0), |
| 173 last_sent_memory_visible_bytes_(0), | 173 last_sent_memory_visible_bytes_(0), |
| 174 last_sent_memory_visible_and_nearby_bytes_(0), | 174 last_sent_memory_visible_and_nearby_bytes_(0), |
| 175 last_sent_memory_use_bytes_(0), | 175 last_sent_memory_use_bytes_(0), |
| 176 animation_registrar_(AnimationRegistrar::create()) { | 176 animation_registrar_(AnimationRegistrar::create()) { |
| 177 DCHECK(proxy_->IsImplThread()); | 177 DCHECK(proxy_->IsImplThread()); |
| 178 DidVisibilityChange(this, visible_); | 178 DidVisibilityChange(this, visible_); |
| (...skipping 760 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 939 // This value is currently inaccessible because it is up in Chromium's | 939 // This value is currently inaccessible because it is up in Chromium's |
| 940 // RenderWidget. | 940 // RenderWidget. |
| 941 fps_counter_->saveTimeStamp(base::TimeTicks::Now()); | 941 fps_counter_->saveTimeStamp(base::TimeTicks::Now()); |
| 942 | 942 |
| 943 if (tile_manager_) { | 943 if (tile_manager_) { |
| 944 memory_history_->SaveEntry( | 944 memory_history_->SaveEntry( |
| 945 tile_manager_->memory_stats_from_last_assign()); | 945 tile_manager_->memory_stats_from_last_assign()); |
| 946 } | 946 } |
| 947 | 947 |
| 948 if (debug_state_.showHudRects()) { | 948 if (debug_state_.showHudRects()) { |
| 949 debug_rect_history_->saveDebugRectsForCurrentFrame( | 949 debug_rect_history_->SaveDebugRectsForCurrentFrame( |
| 950 active_tree_->root_layer(), | 950 active_tree_->root_layer(), |
| 951 *frame->render_surface_layer_list, | 951 *frame->render_surface_layer_list, |
| 952 frame->occluding_screen_space_rects, | 952 frame->occluding_screen_space_rects, |
| 953 frame->non_occluding_screen_space_rects, | 953 frame->non_occluding_screen_space_rects, |
| 954 debug_state_); | 954 debug_state_); |
| 955 } | 955 } |
| 956 | 956 |
| 957 if (debug_state_.traceAllRenderedFrames) { | 957 if (debug_state_.traceAllRenderedFrames) { |
| 958 TRACE_EVENT_INSTANT1("cc.debug", "Frame", | 958 TRACE_EVENT_INSTANT1("cc.debug", "Frame", |
| 959 "frame", ValueToString(FrameStateAsValue())); | 959 "frame", ValueToString(FrameStateAsValue())); |
| (...skipping 962 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1922 tile_manager_->SetRecordRenderingStats(debug_state_.recordRenderingStats()); | 1922 tile_manager_->SetRecordRenderingStats(debug_state_.recordRenderingStats()); |
| 1923 } | 1923 } |
| 1924 | 1924 |
| 1925 void LayerTreeHostImpl::SavePaintTime(const base::TimeDelta& total_paint_time, | 1925 void LayerTreeHostImpl::SavePaintTime(const base::TimeDelta& total_paint_time, |
| 1926 int commit_number) { | 1926 int commit_number) { |
| 1927 DCHECK(debug_state_.continuousPainting); | 1927 DCHECK(debug_state_.continuousPainting); |
| 1928 paint_time_counter_->SavePaintTime(total_paint_time, commit_number); | 1928 paint_time_counter_->SavePaintTime(total_paint_time, commit_number); |
| 1929 } | 1929 } |
| 1930 | 1930 |
| 1931 } // namespace cc | 1931 } // namespace cc |
| OLD | NEW |