Chromium Code Reviews| Index: cc/scheduler/frame_rate_controller.h |
| diff --git a/cc/scheduler/frame_rate_controller.h b/cc/scheduler/frame_rate_controller.h |
| index 46fa592a90f9a47e20e5637f240f6f9ebd7516b1..6f123c6e2c7b764a79c1489ecba5616c7b21d759 100644 |
| --- a/cc/scheduler/frame_rate_controller.h |
| +++ b/cc/scheduler/frame_rate_controller.h |
| @@ -17,73 +17,74 @@ class Thread; |
| class TimeSource; |
| class CC_EXPORT FrameRateControllerClient { |
| -public: |
| - // Throttled is true when we have a maximum number of frames pending. |
| - virtual void vsyncTick(bool throttled) = 0; |
| + public: |
| + // Throttled is true when we have a maximum number of frames pending. |
| + virtual void VsyncTick(bool throttled) = 0; |
|
enne (OOO)
2013/03/19 04:14:57
cc generally says VSync and not Vsync.
|
| -protected: |
| - virtual ~FrameRateControllerClient() {} |
| + protected: |
| + virtual ~FrameRateControllerClient() {} |
| }; |
| class FrameRateControllerTimeSourceAdapter; |
| class CC_EXPORT FrameRateController { |
| -public: |
| - enum { |
| - kDefaultMaxFramesPending = 2 |
| - }; |
| - |
| - explicit FrameRateController(scoped_refptr<TimeSource>); |
| - // Alternate form of FrameRateController with unthrottled frame-rate. |
| - explicit FrameRateController(Thread*); |
| - virtual ~FrameRateController(); |
| - |
| - void setClient(FrameRateControllerClient* 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. |
| - int maxFramesPending() const { return m_maxFramesPending; } |
| - |
| - // This returns null for unthrottled frame-rate. |
| - base::TimeTicks nextTickTime(); |
| - |
| - // This returns now for unthrottled frame-rate. |
| - base::TimeTicks lastTickTime(); |
| - |
| - void setTimebaseAndInterval(base::TimeTicks timebase, base::TimeDelta interval); |
| - void setSwapBuffersCompleteSupported(bool); |
| - |
| -protected: |
| - friend class FrameRateControllerTimeSourceAdapter; |
| - void onTimerTick(); |
| - |
| - void postManualTick(); |
| - void manualTick(); |
| - |
| - FrameRateControllerClient* m_client; |
| - int m_numFramesPending; |
| - int m_maxFramesPending; |
| - scoped_refptr<TimeSource> m_timeSource; |
| - scoped_ptr<FrameRateControllerTimeSourceAdapter> m_timeSourceClientAdapter; |
| - bool m_active; |
| - bool m_swapBuffersCompleteSupported; |
| - |
| - // Members for unthrottled frame-rate. |
| - bool m_isTimeSourceThrottling; |
| - base::WeakPtrFactory<FrameRateController> m_weakFactory; |
| - Thread* m_thread; |
| - |
| - DISALLOW_COPY_AND_ASSIGN(FrameRateController); |
| + public: |
| + enum { |
| + kDefaultMaxFramesPending = 2 |
|
enne (OOO)
2013/03/19 04:14:57
DEFAULT_MAX_FRAMES_PENDING
|
| + }; |
| + |
| + explicit FrameRateController(scoped_refptr<TimeSource> timer); |
| + // Alternate form of FrameRateController with unthrottled frame-rate. |
| + explicit FrameRateController(Thread* thread); |
| + virtual ~FrameRateController(); |
| + |
| + void SetClient(FrameRateControllerClient* client) { client_ = client; } |
| + |
| + void SetActive(bool active); |
| + |
| + // Use the following methods to adjust target frame rate. |
| + // |
| + // Multiple frames can be in-progress, but for every didBeginFrame, a |
|
enne (OOO)
2013/03/19 04:14:57
DidBeginFrame
|
| + // didFinishFrame should be posted. |
|
enne (OOO)
2013/03/19 04:14:57
DidFinishFrame
|
| + // |
| + // If the rendering pipeline crashes, call didAbortAllPendingFrames. |
|
enne (OOO)
2013/03/19 04:14:57
DidAbortAllPendingFrames
|
| + void DidBeginFrame(); |
| + void DidFinishFrame(); |
| + void DidAbortAllPendingFrames(); |
| + void SetMaxFramesPending(int max_frames_pending); // 0 for unlimited. |
| + int MaxFramesPending() const { return max_frames_pending_; } |
| + |
| + // This returns null for unthrottled frame-rate. |
| + base::TimeTicks NextTickTime(); |
| + |
| + // This returns now for unthrottled frame-rate. |
| + base::TimeTicks LastTickTime(); |
| + |
| + void SetTimebaseAndInterval(base::TimeTicks timebase, |
| + base::TimeDelta interval); |
| + void SetSwapBuffersCompleteSupported(bool supported); |
| + |
| + protected: |
| + friend class FrameRateControllerTimeSourceAdapter; |
| + void OnTimerTick(); |
| + |
| + void PostManualTick(); |
| + void ManualTick(); |
| + |
| + FrameRateControllerClient* client_; |
| + int num_frames_pending_; |
| + int max_frames_pending_; |
| + scoped_refptr<TimeSource> time_source_; |
| + scoped_ptr<FrameRateControllerTimeSourceAdapter> time_source_client_adapter_; |
| + bool active_; |
| + bool swap_buffers_complete_supported_; |
| + |
| + // Members for unthrottled frame-rate. |
| + bool is_time_source_throttling_; |
| + base::WeakPtrFactory<FrameRateController> weak_factory_; |
| + Thread* thread_; |
| + |
| + DISALLOW_COPY_AND_ASSIGN(FrameRateController); |
| }; |
| } // namespace cc |