[NaCl SDK]: use standard __BEGIN_DECLS macros in sys/select.h
[chromium-blink-merge.git] / cc / debug / rendering_stats.h
blob73ca9c4dd7d4e93cdc4ee2d17114cae2b2795283
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
3 // found in the LICENSE file.
5 #ifndef CC_DEBUG_RENDERING_STATS_H_
6 #define CC_DEBUG_RENDERING_STATS_H_
8 #include <list>
10 #include "base/basictypes.h"
11 #include "base/debug/trace_event_argument.h"
12 #include "base/time/time.h"
13 #include "base/values.h"
14 #include "cc/base/cc_export.h"
15 #include "cc/debug/traced_value.h"
17 namespace cc {
19 struct CC_EXPORT RenderingStats {
20 // Stores a sequence of TimeDelta objects.
21 class CC_EXPORT TimeDeltaList {
22 public:
23 TimeDeltaList();
24 ~TimeDeltaList();
26 void Append(base::TimeDelta value);
27 void AddToTracedValue(base::debug::TracedValue* list_value) const;
29 void Add(const TimeDeltaList& other);
31 private:
32 std::list<base::TimeDelta> values;
35 struct CC_EXPORT MainThreadRenderingStats {
36 // Note: when adding new members, please remember to update Add in
37 // rendering_stats.cc.
39 int64 frame_count;
40 base::TimeDelta paint_time;
41 int64 painted_pixel_count;
42 base::TimeDelta record_time;
43 int64 recorded_pixel_count;
45 MainThreadRenderingStats();
46 ~MainThreadRenderingStats();
47 scoped_refptr<base::debug::ConvertableToTraceFormat> AsTraceableData()
48 const;
49 void Add(const MainThreadRenderingStats& other);
52 struct CC_EXPORT ImplThreadRenderingStats {
53 // Note: when adding new members, please remember to update Add in
54 // rendering_stats.cc.
56 int64 frame_count;
57 base::TimeDelta rasterize_time;
58 base::TimeDelta analysis_time;
59 int64 rasterized_pixel_count;
60 int64 visible_content_area;
61 int64 approximated_visible_content_area;
63 TimeDeltaList draw_duration;
64 TimeDeltaList draw_duration_estimate;
65 TimeDeltaList begin_main_frame_to_commit_duration;
66 TimeDeltaList begin_main_frame_to_commit_duration_estimate;
67 TimeDeltaList commit_to_activate_duration;
68 TimeDeltaList commit_to_activate_duration_estimate;
70 ImplThreadRenderingStats();
71 ~ImplThreadRenderingStats();
72 scoped_refptr<base::debug::ConvertableToTraceFormat> AsTraceableData()
73 const;
74 void Add(const ImplThreadRenderingStats& other);
77 MainThreadRenderingStats main_stats;
78 ImplThreadRenderingStats impl_stats;
80 // Add fields of |other| to the fields in this structure.
81 void Add(const RenderingStats& other);
84 } // namespace cc
86 #endif // CC_DEBUG_RENDERING_STATS_H_