OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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.h" | 5 #include "cc/debug/rendering_stats.h" |
6 | 6 |
7 namespace cc { | 7 namespace cc { |
8 | 8 |
9 RenderingStats::TimeDeltaList::TimeDeltaList() { | 9 RenderingStats::TimeDeltaList::TimeDeltaList() { |
10 } | 10 } |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 void RenderingStats::MainThreadRenderingStats::Add( | 53 void RenderingStats::MainThreadRenderingStats::Add( |
54 const MainThreadRenderingStats& other) { | 54 const MainThreadRenderingStats& other) { |
55 paint_time += other.paint_time; | 55 paint_time += other.paint_time; |
56 painted_pixel_count += other.painted_pixel_count; | 56 painted_pixel_count += other.painted_pixel_count; |
57 record_time += other.record_time; | 57 record_time += other.record_time; |
58 recorded_pixel_count += other.recorded_pixel_count; | 58 recorded_pixel_count += other.recorded_pixel_count; |
59 } | 59 } |
60 | 60 |
61 RenderingStats::ImplThreadRenderingStats::ImplThreadRenderingStats() | 61 RenderingStats::ImplThreadRenderingStats::ImplThreadRenderingStats() |
62 : frame_count(0), | 62 : frame_count(0), |
63 rasterized_pixel_count(0), | |
64 visible_content_area(0), | 63 visible_content_area(0), |
65 approximated_visible_content_area(0) { | 64 approximated_visible_content_area(0) { |
66 } | 65 } |
67 | 66 |
68 RenderingStats::ImplThreadRenderingStats::~ImplThreadRenderingStats() { | 67 RenderingStats::ImplThreadRenderingStats::~ImplThreadRenderingStats() { |
69 } | 68 } |
70 | 69 |
71 scoped_refptr<base::debug::ConvertableToTraceFormat> | 70 scoped_refptr<base::debug::ConvertableToTraceFormat> |
72 RenderingStats::ImplThreadRenderingStats::AsTraceableData() const { | 71 RenderingStats::ImplThreadRenderingStats::AsTraceableData() const { |
73 scoped_refptr<base::debug::TracedValue> record_data = | 72 scoped_refptr<base::debug::TracedValue> record_data = |
74 new base::debug::TracedValue(); | 73 new base::debug::TracedValue(); |
75 record_data->SetInteger("frame_count", frame_count); | 74 record_data->SetInteger("frame_count", frame_count); |
76 record_data->SetDouble("rasterize_time", rasterize_time.InSecondsF()); | |
77 record_data->SetInteger("rasterized_pixel_count", rasterized_pixel_count); | |
78 record_data->SetInteger("visible_content_area", visible_content_area); | 75 record_data->SetInteger("visible_content_area", visible_content_area); |
79 record_data->SetInteger("approximated_visible_content_area", | 76 record_data->SetInteger("approximated_visible_content_area", |
80 approximated_visible_content_area); | 77 approximated_visible_content_area); |
81 record_data->BeginArray("draw_duration_ms"); | 78 record_data->BeginArray("draw_duration_ms"); |
82 draw_duration.AddToTracedValue(record_data.get()); | 79 draw_duration.AddToTracedValue(record_data.get()); |
83 record_data->EndArray(); | 80 record_data->EndArray(); |
84 | 81 |
85 record_data->BeginArray("draw_duration_estimate_ms"); | 82 record_data->BeginArray("draw_duration_estimate_ms"); |
86 draw_duration_estimate.AddToTracedValue(record_data.get()); | 83 draw_duration_estimate.AddToTracedValue(record_data.get()); |
87 record_data->EndArray(); | 84 record_data->EndArray(); |
(...skipping 13 matching lines...) Expand all Loading... |
101 | 98 |
102 record_data->BeginArray("commit_to_activate_duration_estimate_ms"); | 99 record_data->BeginArray("commit_to_activate_duration_estimate_ms"); |
103 commit_to_activate_duration_estimate.AddToTracedValue(record_data.get()); | 100 commit_to_activate_duration_estimate.AddToTracedValue(record_data.get()); |
104 record_data->EndArray(); | 101 record_data->EndArray(); |
105 return record_data; | 102 return record_data; |
106 } | 103 } |
107 | 104 |
108 void RenderingStats::ImplThreadRenderingStats::Add( | 105 void RenderingStats::ImplThreadRenderingStats::Add( |
109 const ImplThreadRenderingStats& other) { | 106 const ImplThreadRenderingStats& other) { |
110 frame_count += other.frame_count; | 107 frame_count += other.frame_count; |
111 rasterize_time += other.rasterize_time; | |
112 analysis_time += other.analysis_time; | |
113 rasterized_pixel_count += other.rasterized_pixel_count; | |
114 visible_content_area += other.visible_content_area; | 108 visible_content_area += other.visible_content_area; |
115 approximated_visible_content_area += other.approximated_visible_content_area; | 109 approximated_visible_content_area += other.approximated_visible_content_area; |
116 | 110 |
117 draw_duration.Add(other.draw_duration); | 111 draw_duration.Add(other.draw_duration); |
118 draw_duration_estimate.Add(other.draw_duration_estimate); | 112 draw_duration_estimate.Add(other.draw_duration_estimate); |
119 begin_main_frame_to_commit_duration.Add( | 113 begin_main_frame_to_commit_duration.Add( |
120 other.begin_main_frame_to_commit_duration); | 114 other.begin_main_frame_to_commit_duration); |
121 begin_main_frame_to_commit_duration_estimate.Add( | 115 begin_main_frame_to_commit_duration_estimate.Add( |
122 other.begin_main_frame_to_commit_duration_estimate); | 116 other.begin_main_frame_to_commit_duration_estimate); |
123 commit_to_activate_duration.Add(other.commit_to_activate_duration); | 117 commit_to_activate_duration.Add(other.commit_to_activate_duration); |
124 commit_to_activate_duration_estimate.Add( | 118 commit_to_activate_duration_estimate.Add( |
125 other.commit_to_activate_duration_estimate); | 119 other.commit_to_activate_duration_estimate); |
126 } | 120 } |
127 | 121 |
128 void RenderingStats::Add(const RenderingStats& other) { | 122 void RenderingStats::Add(const RenderingStats& other) { |
129 main_stats.Add(other.main_stats); | 123 main_stats.Add(other.main_stats); |
130 impl_stats.Add(other.impl_stats); | 124 impl_stats.Add(other.impl_stats); |
131 } | 125 } |
132 | 126 |
133 } // namespace cc | 127 } // namespace cc |
OLD | NEW |