OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/rendering_stats_instrumentation.h" | 5 #include "cc/debug/rendering_stats_instrumentation.h" |
6 | 6 |
7 namespace cc { | 7 namespace cc { |
8 | 8 |
9 // static | 9 // static |
10 scoped_ptr<RenderingStatsInstrumentation> | 10 scoped_ptr<RenderingStatsInstrumentation> |
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
132 | 132 |
133 void RenderingStatsInstrumentation::AddApproximatedVisibleContentArea( | 133 void RenderingStatsInstrumentation::AddApproximatedVisibleContentArea( |
134 int64 area) { | 134 int64 area) { |
135 if (!record_rendering_stats_) | 135 if (!record_rendering_stats_) |
136 return; | 136 return; |
137 | 137 |
138 base::AutoLock scoped_lock(lock_); | 138 base::AutoLock scoped_lock(lock_); |
139 impl_thread_rendering_stats_.approximated_visible_content_area += area; | 139 impl_thread_rendering_stats_.approximated_visible_content_area += area; |
140 } | 140 } |
141 | 141 |
| 142 void RenderingStatsInstrumentation::AddDrawDuration( |
| 143 base::TimeDelta draw_duration, |
| 144 base::TimeDelta draw_duration_estimate) { |
| 145 if (!record_rendering_stats_) |
| 146 return; |
| 147 |
| 148 base::AutoLock scoped_lock(lock_); |
| 149 impl_thread_rendering_stats_.draw_duration.Append(draw_duration); |
| 150 impl_thread_rendering_stats_.draw_duration_estimate.Append( |
| 151 draw_duration_estimate); |
| 152 } |
| 153 |
| 154 void RenderingStatsInstrumentation::AddBeginMainFrameToCommitDuration( |
| 155 base::TimeDelta begin_main_frame_to_commit_duration, |
| 156 base::TimeDelta begin_main_frame_to_commit_duration_estimate) { |
| 157 if (!record_rendering_stats_) |
| 158 return; |
| 159 |
| 160 base::AutoLock scoped_lock(lock_); |
| 161 impl_thread_rendering_stats_.begin_main_frame_to_commit_duration.Append( |
| 162 begin_main_frame_to_commit_duration); |
| 163 impl_thread_rendering_stats_.begin_main_frame_to_commit_duration_estimate |
| 164 .Append(begin_main_frame_to_commit_duration_estimate); |
| 165 } |
| 166 |
| 167 void RenderingStatsInstrumentation::AddCommitToActivateDuration( |
| 168 base::TimeDelta commit_to_activate_duration, |
| 169 base::TimeDelta commit_to_activate_duration_estimate) { |
| 170 if (!record_rendering_stats_) |
| 171 return; |
| 172 |
| 173 base::AutoLock scoped_lock(lock_); |
| 174 impl_thread_rendering_stats_.commit_to_activate_duration.Append( |
| 175 commit_to_activate_duration); |
| 176 impl_thread_rendering_stats_.commit_to_activate_duration_estimate.Append( |
| 177 commit_to_activate_duration_estimate); |
| 178 } |
| 179 |
142 } // namespace cc | 180 } // namespace cc |
OLD | NEW |