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

Unified Diff: cc/scheduler/frame_rate_controller.h

Issue 15836005: cc: Emulate BeginFrame in OutputSurfaces that don't support it natively (Closed) Base URL: http://git.chromium.org/chromium/src.git@nofrc
Patch Set: Ignore last patch set: bad upload. Created 7 years, 6 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
Index: cc/scheduler/frame_rate_controller.h
diff --git a/cc/scheduler/frame_rate_controller.h b/cc/scheduler/frame_rate_controller.h
index 9210a670d9992523c055a35e16310fcddbc6318b..2f256f42c2ff883fdf5159f6b9720c9900ed903d 100644
--- a/cc/scheduler/frame_rate_controller.h
+++ b/cc/scheduler/frame_rate_controller.h
@@ -15,18 +15,21 @@ namespace cc {
class Thread;
class TimeSource;
+class FrameRateController;
class CC_EXPORT FrameRateControllerClient {
- public:
- // Throttled is true when we have a maximum number of frames pending.
- virtual void BeginFrame(bool throttled) = 0;
-
protected:
virtual ~FrameRateControllerClient() {}
+
+ public:
+ // Throttled is true when we have a maximum number of frames pending.
+ virtual void FrameRateControllerTick(bool throttled) = 0;
};
class FrameRateControllerTimeSourceAdapter;
+// The FrameRateController is used in cases where we self-tick (i.e. BeginFrame
+// is not sent by a parent compositor.
class CC_EXPORT FrameRateController {
public:
enum {
@@ -41,6 +44,7 @@ class CC_EXPORT FrameRateController {
void SetClient(FrameRateControllerClient* client) { client_ = client; }
void SetActive(bool active);
+ bool IsActive() { return active_; }
// Use the following methods to adjust target frame rate.
//
@@ -51,9 +55,9 @@ class CC_EXPORT FrameRateController {
void DidSwapBuffers();
void DidSwapBuffersComplete();
void DidAbortAllPendingFrames();
- void SetMaxFramesPending(int max_frames_pending); // 0 for unlimited.
- int MaxFramesPending() const { return max_frames_pending_; }
- int NumFramesPendingForTesting() const { return num_frames_pending_; }
+ void SetMaxSwapsPending(int max_swaps_pending); // 0 for unlimited.
+ int MaxSwapsPending() const { return max_swaps_pending_; }
+ int NumSwapsPendingForTesting() const { return num_frames_pending_; }
// This returns null for unthrottled frame-rate.
base::TimeTicks NextTickTime();
@@ -74,7 +78,7 @@ class CC_EXPORT FrameRateController {
FrameRateControllerClient* client_;
int num_frames_pending_;
- int max_frames_pending_;
+ int max_swaps_pending_;
scoped_refptr<TimeSource> time_source_;
scoped_ptr<FrameRateControllerTimeSourceAdapter> time_source_client_adapter_;
bool active_;

Powered by Google App Engine
This is Rietveld 408576698