Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / cc / debug / rendering_stats.h
blobcb7ebb2cbabeb733ddb506c429896cbdb44899db
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 <vector>
10 #include "base/basictypes.h"
11 #include "base/time/time.h"
12 #include "base/trace_event/trace_event_argument.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(const char* name,
28 base::trace_event::TracedValue* list_value) const;
30 void Add(const TimeDeltaList& other);
32 base::TimeDelta GetLastTimeDelta() const;
34 private:
35 std::vector<base::TimeDelta> values;
38 RenderingStats();
39 ~RenderingStats();
41 // Note: when adding new members, please remember to update Add in
42 // rendering_stats.cc.
44 int64 frame_count;
45 int64 visible_content_area;
46 int64 approximated_visible_content_area;
47 int64 checkerboarded_visible_content_area;
49 TimeDeltaList draw_duration;
50 TimeDeltaList draw_duration_estimate;
51 TimeDeltaList begin_main_frame_to_commit_duration;
52 TimeDeltaList begin_main_frame_to_commit_duration_estimate;
53 TimeDeltaList commit_to_activate_duration;
54 TimeDeltaList commit_to_activate_duration_estimate;
56 scoped_refptr<base::trace_event::ConvertableToTraceFormat> AsTraceableData()
57 const;
58 void Add(const RenderingStats& other);
61 } // namespace cc
63 #endif // CC_DEBUG_RENDERING_STATS_H_