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 "base/basictypes.h"
10 #include "cc/base/cc_export.h"
14 struct CC_EXPORT RenderingStats
{
15 int64 animation_frame_count
;
16 int64 screen_frame_count
;
17 int64 dropped_frame_count
;
18 base::TimeDelta total_paint_time
;
19 base::TimeDelta total_rasterize_time
;
20 base::TimeDelta total_rasterize_time_for_now_bins_on_pending_tree
;
21 base::TimeDelta total_commit_time
;
22 int64 total_commit_count
;
23 int64 total_pixels_painted
;
24 int64 total_pixels_rasterized
;
25 int64 num_impl_thread_scrolls
;
26 int64 num_main_thread_scrolls
;
27 int64 num_layers_drawn
;
28 int64 num_missing_tiles
;
29 int64 total_deferred_image_decode_count
;
30 int64 total_deferred_image_cache_hit_count
;
31 int64 total_image_gathering_count
;
32 base::TimeDelta total_deferred_image_decode_time
;
33 base::TimeDelta total_image_gathering_time
;
34 // Note: when adding new members, please remember to update EnumerateFields
35 // and Add in rendering_stats.cc.
39 // In conjunction with EnumerateFields, this allows the embedder to
40 // enumerate the values in this structure without
41 // having to embed references to its specific member variables. This
42 // simplifies the addition of new fields to this type.
45 virtual void AddInt64(const char* name
, int64 value
) = 0;
46 virtual void AddDouble(const char* name
, double value
) = 0;
47 virtual void AddInt(const char* name
, int value
) = 0;
48 virtual void AddTimeDeltaInSecondsF(const char* name
,
49 const base::TimeDelta
& value
) = 0;
52 virtual ~Enumerator() {}
55 // Outputs the fields in this structure to the provided enumerator.
56 void EnumerateFields(Enumerator
* enumerator
) const;
58 // Add fields of |other| to the fields in this structure.
59 void Add(const RenderingStats
& other
);
64 #endif // CC_DEBUG_RENDERING_STATS_H_