| 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 912 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 923 | 923 |
| 924 if (!RootScrollLayer()) | 924 if (!RootScrollLayer()) |
| 925 return metadata; | 925 return metadata; |
| 926 | 926 |
| 927 metadata.root_scroll_offset = RootScrollLayer()->scroll_offset() + | 927 metadata.root_scroll_offset = RootScrollLayer()->scroll_offset() + |
| 928 RootScrollLayer()->scroll_delta(); | 928 RootScrollLayer()->scroll_delta(); |
| 929 | 929 |
| 930 return metadata; | 930 return metadata; |
| 931 } | 931 } |
| 932 | 932 |
| 933 void LayerTreeHostImpl::DrawLayers(FrameData* frame) { | 933 void LayerTreeHostImpl::DrawLayers(FrameData* frame, |
| 934 base::TimeTicks frame_begin_time) { |
| 934 TRACE_EVENT0("cc", "LayerTreeHostImpl::DrawLayers"); | 935 TRACE_EVENT0("cc", "LayerTreeHostImpl::DrawLayers"); |
| 935 DCHECK(CanDraw()); | 936 DCHECK(CanDraw()); |
| 936 DCHECK(!frame->render_passes.empty()); | 937 DCHECK(!frame->render_passes.empty()); |
| 937 | 938 |
| 938 // FIXME: use the frame begin time from the overall compositor scheduler. | 939 fps_counter_->saveTimeStamp(frame_begin_time); |
| 939 // This value is currently inaccessible because it is up in Chromium's | |
| 940 // RenderWidget. | |
| 941 fps_counter_->saveTimeStamp(base::TimeTicks::Now()); | |
| 942 | 940 |
| 943 if (tile_manager_) { | 941 if (tile_manager_) { |
| 944 memory_history_->SaveEntry( | 942 memory_history_->SaveEntry( |
| 945 tile_manager_->memory_stats_from_last_assign()); | 943 tile_manager_->memory_stats_from_last_assign()); |
| 946 } | 944 } |
| 947 | 945 |
| 948 if (debug_state_.showHudRects()) { | 946 if (debug_state_.showHudRects()) { |
| 949 debug_rect_history_->SaveDebugRectsForCurrentFrame( | 947 debug_rect_history_->SaveDebugRectsForCurrentFrame( |
| 950 active_tree_->root_layer(), | 948 active_tree_->root_layer(), |
| 951 *frame->render_surface_layer_list, | 949 *frame->render_surface_layer_list, |
| (...skipping 970 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1922 tile_manager_->SetRecordRenderingStats(debug_state_.recordRenderingStats()); | 1920 tile_manager_->SetRecordRenderingStats(debug_state_.recordRenderingStats()); |
| 1923 } | 1921 } |
| 1924 | 1922 |
| 1925 void LayerTreeHostImpl::SavePaintTime(const base::TimeDelta& total_paint_time, | 1923 void LayerTreeHostImpl::SavePaintTime(const base::TimeDelta& total_paint_time, |
| 1926 int commit_number) { | 1924 int commit_number) { |
| 1927 DCHECK(debug_state_.continuousPainting); | 1925 DCHECK(debug_state_.continuousPainting); |
| 1928 paint_time_counter_->SavePaintTime(total_paint_time, commit_number); | 1926 paint_time_counter_->SavePaintTime(total_paint_time, commit_number); |
| 1929 } | 1927 } |
| 1930 | 1928 |
| 1931 } // namespace cc | 1929 } // namespace cc |
| OLD | NEW |