OLD | NEW |
1 // Copyright 2011 The Chromium Authors. All rights reserved. | 1 // Copyright 2011 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CC_SCHEDULER_SCHEDULER_H_ | 5 #ifndef CC_SCHEDULER_SCHEDULER_H_ |
6 #define CC_SCHEDULER_SCHEDULER_H_ | 6 #define CC_SCHEDULER_SCHEDULER_H_ |
7 | 7 |
8 #include <deque> | 8 #include <deque> |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 virtual BeginFrameSource* ConstructPrimaryFrameSource(Scheduler* scheduler); | 66 virtual BeginFrameSource* ConstructPrimaryFrameSource(Scheduler* scheduler); |
67 virtual BeginFrameSource* ConstructUnthrottledFrameSource( | 67 virtual BeginFrameSource* ConstructUnthrottledFrameSource( |
68 Scheduler* scheduler); | 68 Scheduler* scheduler); |
69 | 69 |
70 protected: | 70 protected: |
71 SchedulerFrameSourcesConstructor() {} | 71 SchedulerFrameSourcesConstructor() {} |
72 | 72 |
73 friend class Scheduler; | 73 friend class Scheduler; |
74 }; | 74 }; |
75 | 75 |
76 class CC_EXPORT Scheduler : public BeginFrameObserverMixIn { | 76 class CC_EXPORT Scheduler : public BeginFrameObserverBase { |
77 public: | 77 public: |
78 static scoped_ptr<Scheduler> Create( | 78 static scoped_ptr<Scheduler> Create( |
79 SchedulerClient* client, | 79 SchedulerClient* client, |
80 const SchedulerSettings& scheduler_settings, | 80 const SchedulerSettings& scheduler_settings, |
81 int layer_tree_host_id, | 81 int layer_tree_host_id, |
82 const scoped_refptr<base::SingleThreadTaskRunner>& task_runner, | 82 const scoped_refptr<base::SingleThreadTaskRunner>& task_runner, |
83 scoped_ptr<BeginFrameSource> external_begin_frame_source) { | 83 scoped_ptr<BeginFrameSource> external_begin_frame_source) { |
84 SchedulerFrameSourcesConstructor frame_sources_constructor; | 84 SchedulerFrameSourcesConstructor frame_sources_constructor; |
85 return make_scoped_ptr(new Scheduler(client, | 85 return make_scoped_ptr(new Scheduler(client, |
86 scheduler_settings, | 86 scheduler_settings, |
87 layer_tree_host_id, | 87 layer_tree_host_id, |
88 task_runner, | 88 task_runner, |
89 external_begin_frame_source.Pass(), | 89 external_begin_frame_source.Pass(), |
90 &frame_sources_constructor)); | 90 &frame_sources_constructor)); |
91 } | 91 } |
92 | 92 |
93 ~Scheduler() override; | 93 ~Scheduler() override; |
94 | 94 |
95 // BeginFrameObserverMixin | 95 // BeginFrameObserverBase |
96 bool OnBeginFrameMixInDelegate(const BeginFrameArgs& args) override; | 96 bool OnBeginFrameDerivedImpl(const BeginFrameArgs& args) override; |
97 | 97 |
98 void OnDrawForOutputSurface(); | 98 void OnDrawForOutputSurface(); |
99 | 99 |
100 const SchedulerSettings& settings() const { return settings_; } | 100 const SchedulerSettings& settings() const { return settings_; } |
101 | 101 |
102 void CommitVSyncParameters(base::TimeTicks timebase, | 102 void CommitVSyncParameters(base::TimeTicks timebase, |
103 base::TimeDelta interval); | 103 base::TimeDelta interval); |
104 void SetEstimatedParentDrawTime(base::TimeDelta draw_time); | 104 void SetEstimatedParentDrawTime(base::TimeDelta draw_time); |
105 | 105 |
106 void SetCanStart(); | 106 void SetCanStart(); |
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
253 | 253 |
254 friend class SchedulerFrameSourcesConstructor; | 254 friend class SchedulerFrameSourcesConstructor; |
255 friend class TestSchedulerFrameSourcesConstructor; | 255 friend class TestSchedulerFrameSourcesConstructor; |
256 | 256 |
257 DISALLOW_COPY_AND_ASSIGN(Scheduler); | 257 DISALLOW_COPY_AND_ASSIGN(Scheduler); |
258 }; | 258 }; |
259 | 259 |
260 } // namespace cc | 260 } // namespace cc |
261 | 261 |
262 #endif // CC_SCHEDULER_SCHEDULER_H_ | 262 #endif // CC_SCHEDULER_SCHEDULER_H_ |
OLD | NEW |