Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(329)

Side by Side Diff: cc/scheduler/scheduler.h

Issue 723343002: Update from https://crrev.com/304121 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « cc/scheduler/begin_frame_source.cc ('k') | cc/scheduler/scheduler.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 16 matching lines...) Expand all
27 namespace debug { 27 namespace debug {
28 class ConvertableToTraceFormat; 28 class ConvertableToTraceFormat;
29 } 29 }
30 class SingleThreadTaskRunner; 30 class SingleThreadTaskRunner;
31 } 31 }
32 32
33 namespace cc { 33 namespace cc {
34 34
35 class SchedulerClient { 35 class SchedulerClient {
36 public: 36 public:
37 virtual BeginFrameSource* ExternalBeginFrameSource() = 0;
38 virtual void WillBeginImplFrame(const BeginFrameArgs& args) = 0; 37 virtual void WillBeginImplFrame(const BeginFrameArgs& args) = 0;
39 virtual void ScheduledActionSendBeginMainFrame() = 0; 38 virtual void ScheduledActionSendBeginMainFrame() = 0;
40 virtual DrawResult ScheduledActionDrawAndSwapIfPossible() = 0; 39 virtual DrawResult ScheduledActionDrawAndSwapIfPossible() = 0;
41 virtual DrawResult ScheduledActionDrawAndSwapForced() = 0; 40 virtual DrawResult ScheduledActionDrawAndSwapForced() = 0;
42 virtual void ScheduledActionAnimate() = 0; 41 virtual void ScheduledActionAnimate() = 0;
43 virtual void ScheduledActionCommit() = 0; 42 virtual void ScheduledActionCommit() = 0;
44 virtual void ScheduledActionUpdateVisibleTiles() = 0; 43 virtual void ScheduledActionUpdateVisibleTiles() = 0;
45 virtual void ScheduledActionActivateSyncTree() = 0; 44 virtual void ScheduledActionActivateSyncTree() = 0;
46 virtual void ScheduledActionBeginOutputSurfaceCreation() = 0; 45 virtual void ScheduledActionBeginOutputSurfaceCreation() = 0;
47 virtual void ScheduledActionManageTiles() = 0; 46 virtual void ScheduledActionManageTiles() = 0;
(...skipping 26 matching lines...) Expand all
74 }; 73 };
75 74
76 class CC_EXPORT Scheduler : public BeginFrameObserverMixIn, 75 class CC_EXPORT Scheduler : public BeginFrameObserverMixIn,
77 public base::PowerObserver { 76 public base::PowerObserver {
78 public: 77 public:
79 static scoped_ptr<Scheduler> Create( 78 static scoped_ptr<Scheduler> Create(
80 SchedulerClient* client, 79 SchedulerClient* client,
81 const SchedulerSettings& scheduler_settings, 80 const SchedulerSettings& scheduler_settings,
82 int layer_tree_host_id, 81 int layer_tree_host_id,
83 const scoped_refptr<base::SingleThreadTaskRunner>& task_runner, 82 const scoped_refptr<base::SingleThreadTaskRunner>& task_runner,
84 base::PowerMonitor* power_monitor) { 83 base::PowerMonitor* power_monitor,
84 scoped_ptr<BeginFrameSource> external_begin_frame_source) {
85 SchedulerFrameSourcesConstructor frame_sources_constructor; 85 SchedulerFrameSourcesConstructor frame_sources_constructor;
86 return make_scoped_ptr(new Scheduler(client, 86 return make_scoped_ptr(new Scheduler(client,
87 scheduler_settings, 87 scheduler_settings,
88 layer_tree_host_id, 88 layer_tree_host_id,
89 task_runner, 89 task_runner,
90 power_monitor, 90 power_monitor,
91 external_begin_frame_source.Pass(),
91 &frame_sources_constructor)); 92 &frame_sources_constructor));
92 } 93 }
93 94
94 ~Scheduler() override; 95 ~Scheduler() override;
95 96
96 // base::PowerObserver method. 97 // base::PowerObserver method.
97 void OnPowerStateChange(bool on_battery_power) override; 98 void OnPowerStateChange(bool on_battery_power) override;
98 99
99 const SchedulerSettings& settings() const { return settings_; } 100 const SchedulerSettings& settings() const { return settings_; }
100 101
101 void CommitVSyncParameters(base::TimeTicks timebase, 102 void CommitVSyncParameters(base::TimeTicks timebase,
102 base::TimeDelta interval); 103 base::TimeDelta interval);
103 void SetEstimatedParentDrawTime(base::TimeDelta draw_time); 104 void SetEstimatedParentDrawTime(base::TimeDelta draw_time);
104 105
105 void SetCanStart(); 106 void SetCanStart();
106 107
107 void SetVisible(bool visible); 108 void SetVisible(bool visible);
108 void SetCanDraw(bool can_draw); 109 void SetCanDraw(bool can_draw);
109 void NotifyReadyToActivate(); 110 void NotifyReadyToActivate();
111 void NotifyReadyToDraw();
110 112
111 void SetNeedsCommit(); 113 void SetNeedsCommit();
112 114
113 void SetNeedsRedraw(); 115 void SetNeedsRedraw();
114 116
115 void SetNeedsAnimate(); 117 void SetNeedsAnimate();
116 118
117 void SetNeedsManageTiles(); 119 void SetNeedsManageTiles();
118 120
119 void SetMaxSwapsPending(int max); 121 void SetMaxSwapsPending(int max);
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
166 168
167 // BeginFrameObserverMixin 169 // BeginFrameObserverMixin
168 bool OnBeginFrameMixInDelegate(const BeginFrameArgs& args) override; 170 bool OnBeginFrameMixInDelegate(const BeginFrameArgs& args) override;
169 171
170 protected: 172 protected:
171 Scheduler(SchedulerClient* client, 173 Scheduler(SchedulerClient* client,
172 const SchedulerSettings& scheduler_settings, 174 const SchedulerSettings& scheduler_settings,
173 int layer_tree_host_id, 175 int layer_tree_host_id,
174 const scoped_refptr<base::SingleThreadTaskRunner>& task_runner, 176 const scoped_refptr<base::SingleThreadTaskRunner>& task_runner,
175 base::PowerMonitor* power_monitor, 177 base::PowerMonitor* power_monitor,
178 scoped_ptr<BeginFrameSource> external_begin_frame_source,
176 SchedulerFrameSourcesConstructor* frame_sources_constructor); 179 SchedulerFrameSourcesConstructor* frame_sources_constructor);
177 180
178 // virtual for testing - Don't call these in the constructor or 181 // virtual for testing - Don't call these in the constructor or
179 // destructor! 182 // destructor!
180 virtual base::TimeTicks Now() const; 183 virtual base::TimeTicks Now() const;
181 184
182 scoped_ptr<BeginFrameSourceMultiplexer> frame_source_; 185 scoped_ptr<BeginFrameSourceMultiplexer> frame_source_;
183 BeginFrameSource* primary_frame_source_; 186 BeginFrameSource* primary_frame_source_;
184 BeginFrameSource* background_frame_source_; 187 BeginFrameSource* background_frame_source_;
185 188
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
249 252
250 friend class SchedulerFrameSourcesConstructor; 253 friend class SchedulerFrameSourcesConstructor;
251 friend class TestSchedulerFrameSourcesConstructor; 254 friend class TestSchedulerFrameSourcesConstructor;
252 255
253 DISALLOW_COPY_AND_ASSIGN(Scheduler); 256 DISALLOW_COPY_AND_ASSIGN(Scheduler);
254 }; 257 };
255 258
256 } // namespace cc 259 } // namespace cc
257 260
258 #endif // CC_SCHEDULER_SCHEDULER_H_ 261 #endif // CC_SCHEDULER_SCHEDULER_H_
OLDNEW
« no previous file with comments | « cc/scheduler/begin_frame_source.cc ('k') | cc/scheduler/scheduler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698