Chromium Code Reviews| Index: cc/scheduler/scheduler.h |
| diff --git a/cc/scheduler/scheduler.h b/cc/scheduler/scheduler.h |
| index 311a71d4b0a66135b84cd0f5f0e1ea9279548d4c..6950b06940775a4020cc0375b7df4d6ebfaca851 100644 |
| --- a/cc/scheduler/scheduler.h |
| +++ b/cc/scheduler/scheduler.h |
| @@ -14,6 +14,7 @@ |
| #include "base/time/time.h" |
| #include "cc/base/cc_export.h" |
| #include "cc/output/begin_frame_args.h" |
| +#include "cc/scheduler/begin_frame_manager.h" |
| #include "cc/scheduler/delay_based_time_source.h" |
| #include "cc/scheduler/draw_result.h" |
| #include "cc/scheduler/scheduler_settings.h" |
| @@ -51,15 +52,19 @@ class SchedulerClient { |
| virtual ~SchedulerClient() {} |
| }; |
| -class CC_EXPORT Scheduler { |
| +class CC_EXPORT Scheduler : public BeginFrameManager::Delegate { |
| public: |
| static scoped_ptr<Scheduler> Create( |
| SchedulerClient* client, |
| const SchedulerSettings& scheduler_settings, |
| int layer_tree_host_id, |
| - const scoped_refptr<base::SingleThreadTaskRunner>& task_runner) { |
| - return make_scoped_ptr(new Scheduler( |
| - client, scheduler_settings, layer_tree_host_id, task_runner)); |
| + const scoped_refptr<base::SingleThreadTaskRunner>& task_runner, |
| + BeginFrameManager* begin_frame_manager) { |
| + return make_scoped_ptr(new Scheduler(client, |
| + scheduler_settings, |
| + layer_tree_host_id, |
| + task_runner, |
| + begin_frame_manager)); |
| } |
| virtual ~Scheduler(); |
| @@ -143,6 +148,13 @@ class CC_EXPORT Scheduler { |
| state_machine_.SetContinuousPainting(continuous_painting); |
| } |
| + // BeginFrameManager::Delegate implementation. |
| + // SetChildrenNeedBeginFrames() is only used when this Scheduler is acting |
| + // the publisher. |
|
brianderson
2014/08/27 01:34:08
the -> as the
simonhong
2014/08/27 07:56:12
Done.
|
| + virtual void SetChildrenNeedBeginFrames(bool need_begin_frame) OVERRIDE; |
| + virtual void SetAuthoritativeVSyncInterval( |
| + base::TimeDelta interval) OVERRIDE; |
| + |
| protected: |
| class CC_EXPORT SyntheticBeginFrameSource : public TimeSourceClient { |
| public: |
| @@ -176,7 +188,8 @@ class CC_EXPORT Scheduler { |
| Scheduler(SchedulerClient* client, |
| const SchedulerSettings& scheduler_settings, |
| int layer_tree_host_id, |
| - const scoped_refptr<base::SingleThreadTaskRunner>& task_runner); |
| + const scoped_refptr<base::SingleThreadTaskRunner>& task_runner, |
| + BeginFrameManager* begin_frame_manager); |
| const SchedulerSettings settings_; |
| SchedulerClient* client_; |
| @@ -184,6 +197,9 @@ class CC_EXPORT Scheduler { |
| scoped_refptr<base::SingleThreadTaskRunner> task_runner_; |
| base::TimeDelta vsync_interval_; |
| + base::TimeDelta authoritative_vsync_interval_; |
| + base::TimeTicks last_timebase_; |
| + |
| base::TimeDelta estimated_parent_draw_time_; |
| bool last_set_needs_begin_frame_; |
| @@ -208,6 +224,9 @@ class CC_EXPORT Scheduler { |
| bool inside_process_scheduled_actions_; |
| SchedulerStateMachine::Action inside_action_; |
| + // Not owned. |
| + BeginFrameManager* begin_frame_manager_; |
| + |
| private: |
| base::TimeTicks AdjustedBeginImplFrameDeadline( |
| const BeginFrameArgs& args, |