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 <stdint.h> |
| 6 |
5 #include "cc/debug/rendering_stats_instrumentation.h" | 7 #include "cc/debug/rendering_stats_instrumentation.h" |
6 | 8 |
7 namespace cc { | 9 namespace cc { |
8 | 10 |
9 // static | 11 // static |
10 scoped_ptr<RenderingStatsInstrumentation> | 12 scoped_ptr<RenderingStatsInstrumentation> |
11 RenderingStatsInstrumentation::Create() { | 13 RenderingStatsInstrumentation::Create() { |
12 return make_scoped_ptr(new RenderingStatsInstrumentation()); | 14 return make_scoped_ptr(new RenderingStatsInstrumentation()); |
13 } | 15 } |
14 | 16 |
(...skipping 15 matching lines...) Expand all Loading... |
30 rendering_stats.Add(impl_thread_rendering_stats_); | 32 rendering_stats.Add(impl_thread_rendering_stats_); |
31 return rendering_stats; | 33 return rendering_stats; |
32 } | 34 } |
33 | 35 |
34 void RenderingStatsInstrumentation::AccumulateAndClearImplThreadStats() { | 36 void RenderingStatsInstrumentation::AccumulateAndClearImplThreadStats() { |
35 base::AutoLock scoped_lock(lock_); | 37 base::AutoLock scoped_lock(lock_); |
36 impl_thread_rendering_stats_accu_.Add(impl_thread_rendering_stats_); | 38 impl_thread_rendering_stats_accu_.Add(impl_thread_rendering_stats_); |
37 impl_thread_rendering_stats_ = RenderingStats(); | 39 impl_thread_rendering_stats_ = RenderingStats(); |
38 } | 40 } |
39 | 41 |
40 void RenderingStatsInstrumentation::IncrementFrameCount(int64 count) { | 42 void RenderingStatsInstrumentation::IncrementFrameCount(int64_t count) { |
41 if (!record_rendering_stats_) | 43 if (!record_rendering_stats_) |
42 return; | 44 return; |
43 | 45 |
44 base::AutoLock scoped_lock(lock_); | 46 base::AutoLock scoped_lock(lock_); |
45 impl_thread_rendering_stats_.frame_count += count; | 47 impl_thread_rendering_stats_.frame_count += count; |
46 } | 48 } |
47 | 49 |
48 void RenderingStatsInstrumentation::AddVisibleContentArea(int64 area) { | 50 void RenderingStatsInstrumentation::AddVisibleContentArea(int64_t area) { |
49 if (!record_rendering_stats_) | 51 if (!record_rendering_stats_) |
50 return; | 52 return; |
51 | 53 |
52 base::AutoLock scoped_lock(lock_); | 54 base::AutoLock scoped_lock(lock_); |
53 impl_thread_rendering_stats_.visible_content_area += area; | 55 impl_thread_rendering_stats_.visible_content_area += area; |
54 } | 56 } |
55 | 57 |
56 void RenderingStatsInstrumentation::AddApproximatedVisibleContentArea( | 58 void RenderingStatsInstrumentation::AddApproximatedVisibleContentArea( |
57 int64 area) { | 59 int64_t area) { |
58 if (!record_rendering_stats_) | 60 if (!record_rendering_stats_) |
59 return; | 61 return; |
60 | 62 |
61 base::AutoLock scoped_lock(lock_); | 63 base::AutoLock scoped_lock(lock_); |
62 impl_thread_rendering_stats_.approximated_visible_content_area += area; | 64 impl_thread_rendering_stats_.approximated_visible_content_area += area; |
63 } | 65 } |
64 | 66 |
65 void RenderingStatsInstrumentation::AddCheckerboardedVisibleContentArea( | 67 void RenderingStatsInstrumentation::AddCheckerboardedVisibleContentArea( |
66 int64 area) { | 68 int64_t area) { |
67 if (!record_rendering_stats_) | 69 if (!record_rendering_stats_) |
68 return; | 70 return; |
69 | 71 |
70 base::AutoLock scoped_lock(lock_); | 72 base::AutoLock scoped_lock(lock_); |
71 impl_thread_rendering_stats_.checkerboarded_visible_content_area += area; | 73 impl_thread_rendering_stats_.checkerboarded_visible_content_area += area; |
72 } | 74 } |
73 | 75 |
74 void RenderingStatsInstrumentation::AddCheckerboardedNoRecordingContentArea( | 76 void RenderingStatsInstrumentation::AddCheckerboardedNoRecordingContentArea( |
75 int64 area) { | 77 int64_t area) { |
76 if (!record_rendering_stats_) | 78 if (!record_rendering_stats_) |
77 return; | 79 return; |
78 | 80 |
79 base::AutoLock scoped_lock(lock_); | 81 base::AutoLock scoped_lock(lock_); |
80 impl_thread_rendering_stats_.checkerboarded_no_recording_content_area += area; | 82 impl_thread_rendering_stats_.checkerboarded_no_recording_content_area += area; |
81 } | 83 } |
82 | 84 |
83 void RenderingStatsInstrumentation::AddCheckerboardedNeedsRasterContentArea( | 85 void RenderingStatsInstrumentation::AddCheckerboardedNeedsRasterContentArea( |
84 int64 area) { | 86 int64_t area) { |
85 if (!record_rendering_stats_) | 87 if (!record_rendering_stats_) |
86 return; | 88 return; |
87 | 89 |
88 base::AutoLock scoped_lock(lock_); | 90 base::AutoLock scoped_lock(lock_); |
89 impl_thread_rendering_stats_.checkerboarded_needs_raster_content_area += area; | 91 impl_thread_rendering_stats_.checkerboarded_needs_raster_content_area += area; |
90 } | 92 } |
91 | 93 |
92 void RenderingStatsInstrumentation::AddDrawDuration( | 94 void RenderingStatsInstrumentation::AddDrawDuration( |
93 base::TimeDelta draw_duration, | 95 base::TimeDelta draw_duration, |
94 base::TimeDelta draw_duration_estimate) { | 96 base::TimeDelta draw_duration_estimate) { |
(...skipping 26 matching lines...) Expand all Loading... |
121 return; | 123 return; |
122 | 124 |
123 base::AutoLock scoped_lock(lock_); | 125 base::AutoLock scoped_lock(lock_); |
124 impl_thread_rendering_stats_.commit_to_activate_duration.Append( | 126 impl_thread_rendering_stats_.commit_to_activate_duration.Append( |
125 commit_to_activate_duration); | 127 commit_to_activate_duration); |
126 impl_thread_rendering_stats_.commit_to_activate_duration_estimate.Append( | 128 impl_thread_rendering_stats_.commit_to_activate_duration_estimate.Append( |
127 commit_to_activate_duration_estimate); | 129 commit_to_activate_duration_estimate); |
128 } | 130 } |
129 | 131 |
130 } // namespace cc | 132 } // namespace cc |
OLD | NEW |