| Index: cc/scheduler/scheduler.h
|
| diff --git a/cc/scheduler/scheduler.h b/cc/scheduler/scheduler.h
|
| index aec0cdf2b56dcb4e801f41af44f165831ae3205d..98b027023a8a59a077288bd6f7b004b386e81ef3 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,33 @@ 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);
|
|
|
| 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 SetupNextBeginFrameIfNeeded();
|
| + void DrawAndSwapIfPossible();
|
| + void DrawAndSwapForced();
|
| void ProcessScheduledActions();
|
|
|
| const SchedulerSettings settings_;
|
| SchedulerClient* client_;
|
| - scoped_ptr<FrameRateController> frame_rate_controller_;
|
| +
|
| + base::WeakPtrFactory<Scheduler> weak_factory_;
|
| + bool last_set_needs_begin_frame_;
|
| + bool has_pending_begin_frame_;
|
| + base::TimeTicks last_begin_frame_time_;
|
| + base::TimeDelta interval_;
|
| +
|
| SchedulerStateMachine state_machine_;
|
| bool inside_process_scheduled_actions_;
|
|
|
|
|