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 23 matching lines...) Expand all Loading... |
34 void RenderingStatsInstrumentation::AccumulateAndClearImplThreadStats() { | 34 void RenderingStatsInstrumentation::AccumulateAndClearImplThreadStats() { |
35 base::AutoLock scoped_lock(lock_); | 35 base::AutoLock scoped_lock(lock_); |
36 impl_thread_rendering_stats_accu_.Add(impl_thread_rendering_stats_); | 36 impl_thread_rendering_stats_accu_.Add(impl_thread_rendering_stats_); |
37 impl_thread_rendering_stats_ = RenderingStats(); | 37 impl_thread_rendering_stats_ = RenderingStats(); |
38 } | 38 } |
39 | 39 |
40 base::TimeTicks RenderingStatsInstrumentation::StartRecording() const { | 40 base::TimeTicks RenderingStatsInstrumentation::StartRecording() const { |
41 if (record_rendering_stats_) { | 41 if (record_rendering_stats_) { |
42 if (base::TimeTicks::IsThreadNowSupported()) | 42 if (base::TimeTicks::IsThreadNowSupported()) |
43 return base::TimeTicks::ThreadNow(); | 43 return base::TimeTicks::ThreadNow(); |
44 return base::TimeTicks::HighResNow(); | 44 return base::TimeTicks::Now(); |
45 } | 45 } |
46 return base::TimeTicks(); | 46 return base::TimeTicks(); |
47 } | 47 } |
48 | 48 |
49 base::TimeDelta RenderingStatsInstrumentation::EndRecording( | 49 base::TimeDelta RenderingStatsInstrumentation::EndRecording( |
50 base::TimeTicks start_time) const { | 50 base::TimeTicks start_time) const { |
51 if (!start_time.is_null()) { | 51 if (!start_time.is_null()) { |
52 if (base::TimeTicks::IsThreadNowSupported()) | 52 if (base::TimeTicks::IsThreadNowSupported()) |
53 return base::TimeTicks::ThreadNow() - start_time; | 53 return base::TimeTicks::ThreadNow() - start_time; |
54 return base::TimeTicks::HighResNow() - start_time; | 54 return base::TimeTicks::Now() - start_time; |
55 } | 55 } |
56 return base::TimeDelta(); | 56 return base::TimeDelta(); |
57 } | 57 } |
58 | 58 |
59 void RenderingStatsInstrumentation::IncrementFrameCount(int64 count) { | 59 void RenderingStatsInstrumentation::IncrementFrameCount(int64 count) { |
60 if (!record_rendering_stats_) | 60 if (!record_rendering_stats_) |
61 return; | 61 return; |
62 | 62 |
63 base::AutoLock scoped_lock(lock_); | 63 base::AutoLock scoped_lock(lock_); |
64 impl_thread_rendering_stats_.frame_count += count; | 64 impl_thread_rendering_stats_.frame_count += count; |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
113 return; | 113 return; |
114 | 114 |
115 base::AutoLock scoped_lock(lock_); | 115 base::AutoLock scoped_lock(lock_); |
116 impl_thread_rendering_stats_.commit_to_activate_duration.Append( | 116 impl_thread_rendering_stats_.commit_to_activate_duration.Append( |
117 commit_to_activate_duration); | 117 commit_to_activate_duration); |
118 impl_thread_rendering_stats_.commit_to_activate_duration_estimate.Append( | 118 impl_thread_rendering_stats_.commit_to_activate_duration_estimate.Append( |
119 commit_to_activate_duration_estimate); | 119 commit_to_activate_duration_estimate); |
120 } | 120 } |
121 | 121 |
122 } // namespace cc | 122 } // namespace cc |
OLD | NEW |