Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1361)

Unified Diff: cc/rendering_stats_subscriber.h

Issue 11198005: NOT READY FOR REVIEW - switch to a subscriber model for rendering stats (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Added missing file. Created 8 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/rendering_stats.cc ('k') | cc/rendering_stats_subscriber.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/rendering_stats_subscriber.h
diff --git a/cc/rendering_stats_subscriber.h b/cc/rendering_stats_subscriber.h
new file mode 100644
index 0000000000000000000000000000000000000000..48b66d036339d07bebdea51cb4a3fa8e7ac8284c
--- /dev/null
+++ b/cc/rendering_stats_subscriber.h
@@ -0,0 +1,40 @@
+// Copyright 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef rendering_stats_subscriber_h
+#define rendering_stats_subscriber_h
+
+#include "base/memory/scoped_ptr.h"
+#include "base/time.h"
+
+#include <vector>
+
+namespace cc {
+
+class RenderingStatsSubscriber {
+public:
+ static scoped_ptr<RenderingStatsSubscriber> create();
+
+ virtual ~RenderingStatsSubscriber();
+
+ // Will have functions here to inform the subscriber of the goings on in the
+ // compositor.
+ void markBeginningOfFrame(base::TimeTicks timestamp);
+
+ void handledScrollEvent(bool content_did_move);
+
+ void getFPSAndStandardDeviation(double& average_fps,
+ double& standard_deviation) const;
+
+private:
+ RenderingStatsSubscriber();
+
+ std::vector<base::TimeTicks> time_stamp_history_;
+ bool is_scrolling_;
+ bool has_scrolled_;
+};
+
+} // namespace cc
+
+#endif // rendering_stats_subscriber_h
« no previous file with comments | « cc/rendering_stats.cc ('k') | cc/rendering_stats_subscriber.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698