Chromium Code Reviews| Index: cc/scheduler/scheduler.h |
| diff --git a/cc/scheduler/scheduler.h b/cc/scheduler/scheduler.h |
| index aec0cdf2b56dcb4e801f41af44f165831ae3205d..3915d8e191d2970a7f6c9b5090246e50a87178b5 100644 |
| --- a/cc/scheduler/scheduler.h |
| +++ b/cc/scheduler/scheduler.h |
| @@ -33,6 +33,7 @@ struct ScheduledActionDrawAndSwapResult { |
| class SchedulerClient { |
| public: |
| + virtual void SetNeedsBeginFrameOnImplThread(bool enable) = 0; |
| virtual void ScheduledActionSendBeginFrameToMainThread() = 0; |
| virtual ScheduledActionDrawAndSwapResult |
| ScheduledActionDrawAndSwapIfPossible() = 0; |
| @@ -49,14 +50,13 @@ class SchedulerClient { |
| virtual ~SchedulerClient() {} |
| }; |
| -class CC_EXPORT Scheduler : FrameRateControllerClient { |
| +class CC_EXPORT Scheduler { |
| public: |
| static scoped_ptr<Scheduler> Create( |
| SchedulerClient* client, |
| - scoped_ptr<FrameRateController> frame_rate_controller, |
| - const SchedulerSettings& scheduler_settings) { |
| - return make_scoped_ptr(new Scheduler( |
| - client, frame_rate_controller.Pass(), scheduler_settings)); |
| + const SchedulerSettings& scheduler_settings, |
| + Thread* thread) { |
| + return make_scoped_ptr(new Scheduler(client, scheduler_settings, thread)); |
| } |
| virtual ~Scheduler(); |
| @@ -86,13 +86,6 @@ class CC_EXPORT Scheduler : FrameRateControllerClient { |
| void FinishCommit(); |
| void BeginFrameAbortedByMainThread(); |
| - void SetMaxFramesPending(int max); |
| - int MaxFramesPending() const; |
| - int NumFramesPendingForTesting() const; |
| - |
| - void SetSwapBuffersCompleteSupported(bool supported); |
| - void DidSwapBuffersComplete(); |
| - |
| void DidLoseOutputSurface(); |
| void DidCreateAndInitializeOutputSurface(); |
| bool HasInitializedOutputSurface() const { |
| @@ -104,28 +97,34 @@ class CC_EXPORT Scheduler : FrameRateControllerClient { |
| bool WillDrawIfNeeded() const; |
| - void SetTimebaseAndInterval(base::TimeTicks timebase, |
| - base::TimeDelta interval); |
| - |
| base::TimeTicks AnticipatedDrawTime(); |
| base::TimeTicks LastBeginFrameOnImplThreadTime(); |
| - // FrameRateControllerClient implementation |
| - virtual void BeginFrame(bool throttled) OVERRIDE; |
| + void BeginFrame(base::TimeTicks frame_time); |
| + void BeginFrameRetry(); |
| std::string StateAsStringForTesting() { return state_machine_.ToString(); } |
| private: |
| Scheduler(SchedulerClient* client, |
| - scoped_ptr<FrameRateController> frame_rate_controller, |
| - const SchedulerSettings& scheduler_settings); |
| + const SchedulerSettings& scheduler_settings, |
| + Thread* thread); |
| + void DidSwapBuffers(); |
| + void SetNeedsBeginFrameIfNeeded(); |
| void ProcessScheduledActions(); |
| const SchedulerSettings settings_; |
| SchedulerClient* client_; |
| - scoped_ptr<FrameRateController> frame_rate_controller_; |
| + |
| + base::WeakPtrFactory<Scheduler> weak_factory_; |
|
brianderson
2013/06/01 04:30:29
I'll probably move these into the StateMachine so
|
| + Thread* thread_; |
| + bool last_set_needs_begin_frame_; |
| + int pending_begin_frames_; |
|
Sami
2013/06/03 17:30:33
Does it ever make sense to have more than one of t
brianderson
2013/06/03 18:51:40
Currently, it does not make sense: one BeginFrame
|
| + base::TimeTicks last_begin_frame_time_; |
| + base::TimeDelta interval_; |
| + |
| SchedulerStateMachine state_machine_; |
| bool inside_process_scheduled_actions_; |