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

Unified Diff: cc/frame_rate_controller.h

Issue 11122003: [cc] Rename all cc/ filenames to Chromium style (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 2 months 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/frame_buffer_skpicture_canvas_layer_texture_updater.cc ('k') | cc/frame_rate_controller.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/frame_rate_controller.h
diff --git a/cc/frame_rate_controller.h b/cc/frame_rate_controller.h
index 638cbb270ce9b24689d5095baf174ade4f4d1a13..2aeeae156d658073507eb9d9af03f72585949a40 100644
--- a/cc/frame_rate_controller.h
+++ b/cc/frame_rate_controller.h
@@ -1,3 +1,82 @@
-// Copyright 2012 The Chromium Authors. All rights reserved.
+// Copyright 2011 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 CCFrameRateController_h
+#define CCFrameRateController_h
+
+#include "base/memory/scoped_ptr.h"
+#include "base/time.h"
+#include "CCTimer.h"
+#include <wtf/PassRefPtr.h>
+#include <wtf/RefPtr.h>
+
+namespace cc {
+
+class CCThread;
+class CCTimeSource;
+
+class CCFrameRateControllerClient {
+public:
+ // Throttled is true when we have a maximum number of frames pending.
+ virtual void vsyncTick(bool throttled) = 0;
+
+protected:
+ virtual ~CCFrameRateControllerClient() {}
+};
+
+class CCFrameRateControllerTimeSourceAdapter;
+
+class CCFrameRateController : public CCTimerClient {
+public:
+ explicit CCFrameRateController(PassRefPtr<CCTimeSource>);
+ // Alternate form of CCFrameRateController with unthrottled frame-rate.
+ explicit CCFrameRateController(CCThread*);
+ virtual ~CCFrameRateController();
+
+ void setClient(CCFrameRateControllerClient* client) { m_client = client; }
+
+ void setActive(bool);
+
+ // Use the following methods to adjust target frame rate.
+ //
+ // Multiple frames can be in-progress, but for every didBeginFrame, a
+ // didFinishFrame should be posted.
+ //
+ // If the rendering pipeline crashes, call didAbortAllPendingFrames.
+ void didBeginFrame();
+ void didFinishFrame();
+ void didAbortAllPendingFrames();
+ void setMaxFramesPending(int); // 0 for unlimited.
+
+ // This returns null for unthrottled frame-rate.
+ base::TimeTicks nextTickTime();
+
+ void setTimebaseAndInterval(base::TimeTicks timebase, base::TimeDelta interval);
+ void setSwapBuffersCompleteSupported(bool);
+
+protected:
+ friend class CCFrameRateControllerTimeSourceAdapter;
+ void onTimerTick();
+
+ void postManualTick();
+
+ // CCTimerClient implementation (used for unthrottled frame-rate).
+ virtual void onTimerFired() OVERRIDE;
+
+ CCFrameRateControllerClient* m_client;
+ int m_numFramesPending;
+ int m_maxFramesPending;
+ RefPtr<CCTimeSource> m_timeSource;
+ scoped_ptr<CCFrameRateControllerTimeSourceAdapter> m_timeSourceClientAdapter;
+ bool m_active;
+ bool m_swapBuffersCompleteSupported;
+
+ // Members for unthrottled frame-rate.
+ bool m_isTimeSourceThrottling;
+ scoped_ptr<CCTimer> m_manualTicker;
+};
+
+} // namespace cc
+
+#endif // CCFrameRateController_h
« no previous file with comments | « cc/frame_buffer_skpicture_canvas_layer_texture_updater.cc ('k') | cc/frame_rate_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698