blob: 193c98511919e8c0b9e3a6fc1be347343fde23bc [file] [log] [blame]
[email protected]0fb25002012-10-12 07:20:021// 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]cd57cc5a2012-10-12 22:43:414
[email protected]8fcbaa32012-11-05 04:12:415#ifndef CC_RENDERING_STATS_H_
6#define CC_RENDERING_STATS_H_
[email protected]cd57cc5a2012-10-12 22:43:417
[email protected]63ab5422012-11-09 15:58:458#include "base/basictypes.h"
[email protected]915c4ec2012-11-30 17:34:189#include "base/time.h"
[email protected]63ab5422012-11-09 15:58:4510#include "cc/cc_export.h"
11
[email protected]cd57cc5a2012-10-12 22:43:4112namespace cc {
13
[email protected]63ab5422012-11-09 15:58:4514struct CC_EXPORT RenderingStats {
[email protected]cd57cc5a2012-10-12 22:43:4115 // FIXME: Rename these to animationFrameCount and screenFrameCount, crbug.com/138641.
[email protected]63ab5422012-11-09 15:58:4516 int64 numAnimationFrames;
17 int64 numFramesSentToScreen;
18 int64 droppedFrameCount;
[email protected]121cc752013-01-16 09:12:4519 base::TimeDelta totalPaintTime;
20 base::TimeDelta totalRasterizeTime;
[email protected]652cf132013-02-15 21:53:2421 base::TimeDelta totalRasterizeTimeForNowBinsOnPendingTree;
[email protected]121cc752013-01-16 09:12:4522 base::TimeDelta totalCommitTime;
[email protected]9c2be6a2012-11-27 19:16:1023 int64 totalCommitCount;
[email protected]63ab5422012-11-09 15:58:4524 int64 totalPixelsPainted;
25 int64 totalPixelsRasterized;
26 int64 numImplThreadScrolls;
27 int64 numMainThreadScrolls;
[email protected]b2136f12012-11-30 02:45:5328 int64 numLayersDrawn;
[email protected]f2bbb4e2012-12-07 21:40:4929 int64 numMissingTiles;
[email protected]6200cb52012-12-14 05:14:4030 int64 totalDeferredImageDecodeCount;
31 int64 totalDeferredImageCacheHitCount;
32 int64 totalImageGatheringCount;
[email protected]121cc752013-01-16 09:12:4533 base::TimeDelta totalDeferredImageDecodeTime;
34 base::TimeDelta totalImageGatheringTime;
[email protected]915c4ec2012-11-30 17:34:1835 // Note: when adding new members, please remember to update enumerateFields
36 // in rendering_stats.cc.
[email protected]cd57cc5a2012-10-12 22:43:4137
[email protected]63ab5422012-11-09 15:58:4538 RenderingStats();
[email protected]915c4ec2012-11-30 17:34:1839
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]cd57cc5a2012-10-12 22:43:4158};
59
[email protected]63ab5422012-11-09 15:58:4560} // namespace cc
[email protected]cd57cc5a2012-10-12 22:43:4161
[email protected]8fcbaa32012-11-05 04:12:4162#endif // CC_RENDERING_STATS_H_