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 // This should only be called once per frame. | |
150 DCHECK(impl_thread_rendering_stats_.draw_duration == base::TimeDelta()); | |
Dominik Grewe
2014/07/02 14:43:22
I added these DCHECKS because I thought we'd only
brianderson
2014/07/02 22:39:29
I think it has to do with the various draw early o
Dominik Grewe
2014/07/03 13:16:38
I see. Thanks for the clarification!
| |
151 DCHECK(impl_thread_rendering_stats_.draw_duration_estimate == | |
152 base::TimeDelta()); | |
153 impl_thread_rendering_stats_.draw_duration = draw_duration; | |
154 impl_thread_rendering_stats_.draw_duration_estimate = draw_duration_estimate; | |
155 } | |
156 | |
157 void RenderingStatsInstrumentation::AddBeginMainFrameToCommitDuration( | |
158 base::TimeDelta begin_main_frame_to_commit_duration, | |
159 base::TimeDelta begin_main_frame_to_commit_duration_estimate) { | |
160 if (!record_rendering_stats_) | |
161 return; | |
162 | |
163 base::AutoLock scoped_lock(lock_); | |
164 // This should only be called once per frame. | |
165 DCHECK(impl_thread_rendering_stats_.begin_main_frame_to_commit_duration == | |
166 base::TimeDelta()); | |
167 DCHECK(impl_thread_rendering_stats_ | |
168 .begin_main_frame_to_commit_duration_estimate == | |
169 base::TimeDelta()); | |
170 impl_thread_rendering_stats_.begin_main_frame_to_commit_duration = | |
171 begin_main_frame_to_commit_duration; | |
172 impl_thread_rendering_stats_.begin_main_frame_to_commit_duration_estimate = | |
173 begin_main_frame_to_commit_duration_estimate; | |
174 } | |
175 | |
176 void RenderingStatsInstrumentation::AddCommitToActivateDuration( | |
177 base::TimeDelta commit_to_activate_duration, | |
178 base::TimeDelta commit_to_activate_duration_estimate) { | |
179 if (!record_rendering_stats_) | |
180 return; | |
181 | |
182 base::AutoLock scoped_lock(lock_); | |
183 // This should only be called once per frame. | |
184 DCHECK(impl_thread_rendering_stats_.commit_to_activate_duration == | |
185 base::TimeDelta()); | |
186 DCHECK(impl_thread_rendering_stats_.commit_to_activate_duration_estimate == | |
187 base::TimeDelta()); | |
188 impl_thread_rendering_stats_.commit_to_activate_duration = | |
189 commit_to_activate_duration; | |
190 impl_thread_rendering_stats_.commit_to_activate_duration_estimate = | |
191 commit_to_activate_duration_estimate; | |
192 } | |
193 | |
142 } // namespace cc | 194 } // namespace cc |
OLD | NEW |