[email protected] | 0fb2500 | 2012-10-12 07:20:02 | [diff] [blame] | 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. | ||||
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 4 | |
[email protected] | 8fcbaa3 | 2012-11-05 04:12:41 | [diff] [blame] | 5 | #ifndef CC_RENDERING_STATS_H_ |
6 | #define CC_RENDERING_STATS_H_ | ||||
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 7 | |
[email protected] | 63ab542 | 2012-11-09 15:58:45 | [diff] [blame] | 8 | #include "base/basictypes.h" |
[email protected] | 915c4ec | 2012-11-30 17:34:18 | [diff] [blame] | 9 | #include "base/time.h" |
[email protected] | 63ab542 | 2012-11-09 15:58:45 | [diff] [blame] | 10 | #include "cc/cc_export.h" |
11 | |||||
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 12 | namespace cc { |
13 | |||||
[email protected] | 63ab542 | 2012-11-09 15:58:45 | [diff] [blame] | 14 | struct CC_EXPORT RenderingStats { |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 15 | // FIXME: Rename these to animationFrameCount and screenFrameCount, crbug.com/138641. |
[email protected] | 63ab542 | 2012-11-09 15:58:45 | [diff] [blame] | 16 | int64 numAnimationFrames; |
17 | int64 numFramesSentToScreen; | ||||
18 | int64 droppedFrameCount; | ||||
[email protected] | 121cc75 | 2013-01-16 09:12:45 | [diff] [blame] | 19 | base::TimeDelta totalPaintTime; |
20 | base::TimeDelta totalRasterizeTime; | ||||
[email protected] | 652cf13 | 2013-02-15 21:53:24 | [diff] [blame] | 21 | base::TimeDelta totalRasterizeTimeForNowBinsOnPendingTree; |
[email protected] | 121cc75 | 2013-01-16 09:12:45 | [diff] [blame] | 22 | base::TimeDelta totalCommitTime; |
[email protected] | 9c2be6a | 2012-11-27 19:16:10 | [diff] [blame] | 23 | int64 totalCommitCount; |
[email protected] | 63ab542 | 2012-11-09 15:58:45 | [diff] [blame] | 24 | int64 totalPixelsPainted; |
25 | int64 totalPixelsRasterized; | ||||
26 | int64 numImplThreadScrolls; | ||||
27 | int64 numMainThreadScrolls; | ||||
[email protected] | b2136f1 | 2012-11-30 02:45:53 | [diff] [blame] | 28 | int64 numLayersDrawn; |
[email protected] | f2bbb4e | 2012-12-07 21:40:49 | [diff] [blame] | 29 | int64 numMissingTiles; |
[email protected] | 6200cb5 | 2012-12-14 05:14:40 | [diff] [blame] | 30 | int64 totalDeferredImageDecodeCount; |
31 | int64 totalDeferredImageCacheHitCount; | ||||
32 | int64 totalImageGatheringCount; | ||||
[email protected] | 121cc75 | 2013-01-16 09:12:45 | [diff] [blame] | 33 | base::TimeDelta totalDeferredImageDecodeTime; |
34 | base::TimeDelta totalImageGatheringTime; | ||||
[email protected] | 915c4ec | 2012-11-30 17:34:18 | [diff] [blame] | 35 | // Note: when adding new members, please remember to update enumerateFields |
36 | // in rendering_stats.cc. | ||||
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 37 | |
[email protected] | 63ab542 | 2012-11-09 15:58:45 | [diff] [blame] | 38 | RenderingStats(); |
[email protected] | 915c4ec | 2012-11-30 17:34:18 | [diff] [blame] | 39 | |
40 | // In conjunction with enumerateFields, this allows the embedder to | ||||
41 | // enumerate the values in this structure without | ||||
42 | // having to embed references to its specific member variables. This | ||||
43 | // simplifies the addition of new fields to this type. | ||||
44 | class Enumerator { | ||||
45 | public: | ||||
46 | virtual void AddInt64(const char* name, int64 value) = 0; | ||||
47 | virtual void AddDouble(const char* name, double value) = 0; | ||||
48 | virtual void AddInt(const char* name, int value) = 0; | ||||
49 | virtual void AddTimeDeltaInSecondsF(const char* name, | ||||
50 | const base::TimeDelta& value) = 0; | ||||
51 | |||||
52 | protected: | ||||
53 | virtual ~Enumerator() { } | ||||
54 | }; | ||||
55 | |||||
56 | // Outputs the fields in this structure to the provided enumerator. | ||||
57 | void EnumerateFields(Enumerator* enumerator) const; | ||||
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 58 | }; |
59 | |||||
[email protected] | 63ab542 | 2012-11-09 15:58:45 | [diff] [blame] | 60 | } // namespace cc |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 61 | |
[email protected] | 8fcbaa3 | 2012-11-05 04:12:41 | [diff] [blame] | 62 | #endif // CC_RENDERING_STATS_H_ |