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 #ifndef CC_DEBUG_RENDERING_STATS_H_ | 5 #ifndef CC_DEBUG_RENDERING_STATS_H_ |
6 #define CC_DEBUG_RENDERING_STATS_H_ | 6 #define CC_DEBUG_RENDERING_STATS_H_ |
7 | 7 |
8 #include <list> | 8 #include <list> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
11 #include "base/debug/trace_event_argument.h" | |
12 #include "base/time/time.h" | 11 #include "base/time/time.h" |
13 #include "base/values.h" | 12 #include "base/values.h" |
14 #include "cc/base/cc_export.h" | 13 #include "cc/base/cc_export.h" |
15 #include "cc/debug/traced_value.h" | 14 #include "cc/debug/traced_value.h" |
16 | 15 |
17 namespace cc { | 16 namespace cc { |
18 | 17 |
19 struct CC_EXPORT RenderingStats { | 18 struct CC_EXPORT RenderingStats { |
20 // Stores a sequence of TimeDelta objects. | 19 // Stores a sequence of TimeDelta objects. |
21 class CC_EXPORT TimeDeltaList { | 20 class CC_EXPORT TimeDeltaList { |
22 public: | 21 public: |
23 TimeDeltaList(); | 22 TimeDeltaList(); |
24 ~TimeDeltaList(); | 23 ~TimeDeltaList(); |
25 | 24 |
26 void Append(base::TimeDelta value); | 25 void Append(base::TimeDelta value); |
27 void AddToTracedValue(base::debug::TracedValue* list_value) const; | 26 scoped_ptr<base::ListValue> AsListValueInMilliseconds() const; |
28 | |
29 void Add(const TimeDeltaList& other); | 27 void Add(const TimeDeltaList& other); |
30 | 28 |
31 private: | 29 private: |
32 std::list<base::TimeDelta> values; | 30 std::list<base::TimeDelta> values; |
33 }; | 31 }; |
34 | 32 |
35 struct CC_EXPORT MainThreadRenderingStats { | 33 struct CC_EXPORT MainThreadRenderingStats { |
36 // Note: when adding new members, please remember to update Add in | 34 // Note: when adding new members, please remember to update Add in |
37 // rendering_stats.cc. | 35 // rendering_stats.cc. |
38 | 36 |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
77 MainThreadRenderingStats main_stats; | 75 MainThreadRenderingStats main_stats; |
78 ImplThreadRenderingStats impl_stats; | 76 ImplThreadRenderingStats impl_stats; |
79 | 77 |
80 // Add fields of |other| to the fields in this structure. | 78 // Add fields of |other| to the fields in this structure. |
81 void Add(const RenderingStats& other); | 79 void Add(const RenderingStats& other); |
82 }; | 80 }; |
83 | 81 |
84 } // namespace cc | 82 } // namespace cc |
85 | 83 |
86 #endif // CC_DEBUG_RENDERING_STATS_H_ | 84 #endif // CC_DEBUG_RENDERING_STATS_H_ |
OLD | NEW |