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> |
11 RenderingStatsInstrumentation::Create() { | 11 RenderingStatsInstrumentation::Create() { |
12 return make_scoped_ptr(new RenderingStatsInstrumentation()); | 12 return make_scoped_ptr(new RenderingStatsInstrumentation()); |
13 } | 13 } |
14 | 14 |
15 RenderingStatsInstrumentation::RenderingStatsInstrumentation() | 15 RenderingStatsInstrumentation::RenderingStatsInstrumentation() |
16 : record_rendering_stats_(false) { | 16 : record_rendering_stats_(false) { |
17 } | 17 } |
18 | 18 |
19 RenderingStatsInstrumentation::~RenderingStatsInstrumentation() {} | 19 RenderingStatsInstrumentation::~RenderingStatsInstrumentation() {} |
20 | 20 |
| 21 MainThreadRenderingStats |
| 22 RenderingStatsInstrumentation::main_thread_rendering_stats() { |
| 23 base::AutoLock scoped_lock(lock_); |
| 24 return main_stats_; |
| 25 } |
| 26 |
| 27 ImplThreadRenderingStats |
| 28 RenderingStatsInstrumentation::impl_thread_rendering_stats() { |
| 29 base::AutoLock scoped_lock(lock_); |
| 30 return impl_stats_; |
| 31 } |
| 32 |
21 RenderingStats RenderingStatsInstrumentation::GetRenderingStats() { | 33 RenderingStats RenderingStatsInstrumentation::GetRenderingStats() { |
22 base::AutoLock scoped_lock(lock_); | 34 base::AutoLock scoped_lock(lock_); |
23 RenderingStats rendering_stats; | 35 RenderingStats rendering_stats; |
24 rendering_stats.main_stats = main_stats_accu_; | 36 rendering_stats.main_stats = main_stats_accu_; |
25 rendering_stats.main_stats.Add(main_stats_); | 37 rendering_stats.main_stats.Add(main_stats_); |
26 rendering_stats.impl_stats = impl_stats_accu_; | 38 rendering_stats.impl_stats = impl_stats_accu_; |
27 rendering_stats.impl_stats.Add(impl_stats_); | 39 rendering_stats.impl_stats.Add(impl_stats_); |
28 return rendering_stats; | 40 return rendering_stats; |
29 } | 41 } |
30 | 42 |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
121 void RenderingStatsInstrumentation::AddApproximatedVisibleContentArea( | 133 void RenderingStatsInstrumentation::AddApproximatedVisibleContentArea( |
122 int64 area) { | 134 int64 area) { |
123 if (!record_rendering_stats_) | 135 if (!record_rendering_stats_) |
124 return; | 136 return; |
125 | 137 |
126 base::AutoLock scoped_lock(lock_); | 138 base::AutoLock scoped_lock(lock_); |
127 impl_stats_.approximated_visible_content_area += area; | 139 impl_stats_.approximated_visible_content_area += area; |
128 } | 140 } |
129 | 141 |
130 } // namespace cc | 142 } // namespace cc |
OLD | NEW |