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

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

Issue 1051273003: Revert of cc: Make scheduling be driven by vsync for android webview. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 8 months 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/output/output_surface_client.h ('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 23 matching lines...) Expand all
34 public: 34 public:
35 virtual void WillBeginImplFrame(const BeginFrameArgs& args) = 0; 35 virtual void WillBeginImplFrame(const BeginFrameArgs& args) = 0;
36 virtual void ScheduledActionSendBeginMainFrame() = 0; 36 virtual void ScheduledActionSendBeginMainFrame() = 0;
37 virtual DrawResult ScheduledActionDrawAndSwapIfPossible() = 0; 37 virtual DrawResult ScheduledActionDrawAndSwapIfPossible() = 0;
38 virtual DrawResult ScheduledActionDrawAndSwapForced() = 0; 38 virtual DrawResult ScheduledActionDrawAndSwapForced() = 0;
39 virtual void ScheduledActionAnimate() = 0; 39 virtual void ScheduledActionAnimate() = 0;
40 virtual void ScheduledActionCommit() = 0; 40 virtual void ScheduledActionCommit() = 0;
41 virtual void ScheduledActionActivateSyncTree() = 0; 41 virtual void ScheduledActionActivateSyncTree() = 0;
42 virtual void ScheduledActionBeginOutputSurfaceCreation() = 0; 42 virtual void ScheduledActionBeginOutputSurfaceCreation() = 0;
43 virtual void ScheduledActionPrepareTiles() = 0; 43 virtual void ScheduledActionPrepareTiles() = 0;
44 virtual void ScheduledActionInvalidateOutputSurface() = 0;
45 virtual void DidAnticipatedDrawTimeChange(base::TimeTicks time) = 0; 44 virtual void DidAnticipatedDrawTimeChange(base::TimeTicks time) = 0;
46 virtual base::TimeDelta DrawDurationEstimate() = 0; 45 virtual base::TimeDelta DrawDurationEstimate() = 0;
47 virtual base::TimeDelta BeginMainFrameToCommitDurationEstimate() = 0; 46 virtual base::TimeDelta BeginMainFrameToCommitDurationEstimate() = 0;
48 virtual base::TimeDelta CommitToActivateDurationEstimate() = 0; 47 virtual base::TimeDelta CommitToActivateDurationEstimate() = 0;
49 // TODO(sunnyps): Rename DidBeginImplFrameDeadline to DidFinishImplFrame.
50 virtual void DidBeginImplFrameDeadline() = 0; 48 virtual void DidBeginImplFrameDeadline() = 0;
51 virtual void SendBeginFramesToChildren(const BeginFrameArgs& args) = 0; 49 virtual void SendBeginFramesToChildren(const BeginFrameArgs& args) = 0;
52 virtual void SendBeginMainFrameNotExpectedSoon() = 0; 50 virtual void SendBeginMainFrameNotExpectedSoon() = 0;
53 51
54 protected: 52 protected:
55 virtual ~SchedulerClient() {} 53 virtual ~SchedulerClient() {}
56 }; 54 };
57 55
58 class Scheduler; 56 class Scheduler;
59 // This class exists to allow tests to override the frame source construction. 57 // This class exists to allow tests to override the frame source construction.
(...skipping 30 matching lines...) Expand all
90 task_runner, 88 task_runner,
91 external_begin_frame_source.Pass(), 89 external_begin_frame_source.Pass(),
92 &frame_sources_constructor)); 90 &frame_sources_constructor));
93 } 91 }
94 92
95 ~Scheduler() override; 93 ~Scheduler() override;
96 94
97 // BeginFrameObserverMixin 95 // BeginFrameObserverMixin
98 bool OnBeginFrameMixInDelegate(const BeginFrameArgs& args) override; 96 bool OnBeginFrameMixInDelegate(const BeginFrameArgs& args) override;
99 97
100 void OnDrawForOutputSurface();
101
102 const SchedulerSettings& settings() const { return settings_; } 98 const SchedulerSettings& settings() const { return settings_; }
103 99
104 void CommitVSyncParameters(base::TimeTicks timebase, 100 void CommitVSyncParameters(base::TimeTicks timebase,
105 base::TimeDelta interval); 101 base::TimeDelta interval);
106 void SetEstimatedParentDrawTime(base::TimeDelta draw_time); 102 void SetEstimatedParentDrawTime(base::TimeDelta draw_time);
107 103
108 void SetCanStart(); 104 void SetCanStart();
109 105
110 void SetVisible(bool visible); 106 void SetVisible(bool visible);
111 void SetCanDraw(bool can_draw); 107 void SetCanDraw(bool can_draw);
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
209 205
210 base::TimeDelta estimated_parent_draw_time_; 206 base::TimeDelta estimated_parent_draw_time_;
211 207
212 std::deque<BeginFrameArgs> begin_retro_frame_args_; 208 std::deque<BeginFrameArgs> begin_retro_frame_args_;
213 BeginFrameArgs begin_impl_frame_args_; 209 BeginFrameArgs begin_impl_frame_args_;
214 SchedulerStateMachine::BeginImplFrameDeadlineMode 210 SchedulerStateMachine::BeginImplFrameDeadlineMode
215 begin_impl_frame_deadline_mode_; 211 begin_impl_frame_deadline_mode_;
216 212
217 base::Closure begin_retro_frame_closure_; 213 base::Closure begin_retro_frame_closure_;
218 base::Closure begin_impl_frame_deadline_closure_; 214 base::Closure begin_impl_frame_deadline_closure_;
215 base::Closure poll_for_draw_triggers_closure_;
219 base::Closure advance_commit_state_closure_; 216 base::Closure advance_commit_state_closure_;
220 base::CancelableClosure begin_retro_frame_task_; 217 base::CancelableClosure begin_retro_frame_task_;
221 base::CancelableClosure begin_impl_frame_deadline_task_; 218 base::CancelableClosure begin_impl_frame_deadline_task_;
219 base::CancelableClosure poll_for_draw_triggers_task_;
222 base::CancelableClosure advance_commit_state_task_; 220 base::CancelableClosure advance_commit_state_task_;
223 221
224 SchedulerStateMachine state_machine_; 222 SchedulerStateMachine state_machine_;
225 bool inside_process_scheduled_actions_; 223 bool inside_process_scheduled_actions_;
226 SchedulerStateMachine::Action inside_action_; 224 SchedulerStateMachine::Action inside_action_;
227 225
228 private: 226 private:
229 void ScheduleBeginImplFrameDeadline(); 227 void ScheduleBeginImplFrameDeadline();
230 void ScheduleBeginImplFrameDeadlineIfNeeded(); 228 void RescheduleBeginImplFrameDeadlineIfNeeded();
231 void SetupNextBeginFrameIfNeeded(); 229 void SetupNextBeginFrameIfNeeded();
232 void PostBeginRetroFrameIfNeeded(); 230 void PostBeginRetroFrameIfNeeded();
233 void SetupPollingMechanisms(); 231 void SetupPollingMechanisms();
234 void DrawAndSwapIfPossible(); 232 void DrawAndSwapIfPossible();
235 void ProcessScheduledActions(); 233 void ProcessScheduledActions();
236 bool CanCommitAndActivateBeforeDeadline() const; 234 bool CanCommitAndActivateBeforeDeadline() const;
237 void AdvanceCommitStateIfPossible(); 235 void AdvanceCommitStateIfPossible();
238 bool IsBeginMainFrameSentOrStarted() const; 236 bool IsBeginMainFrameSentOrStarted() const;
239 void BeginRetroFrame(); 237 void BeginRetroFrame();
240 void BeginImplFrameWithDeadline(const BeginFrameArgs& args);
241 void BeginImplFrameSynchronous(const BeginFrameArgs& args);
242 void BeginImplFrame(const BeginFrameArgs& args); 238 void BeginImplFrame(const BeginFrameArgs& args);
243 void FinishImplFrame();
244 void OnBeginImplFrameDeadline(); 239 void OnBeginImplFrameDeadline();
240 void PollForAnticipatedDrawTriggers();
245 void PollToAdvanceCommitState(); 241 void PollToAdvanceCommitState();
246 void UpdateActiveFrameSource(); 242 void UpdateActiveFrameSource();
247 243
248 base::TimeDelta EstimatedParentDrawTime() { 244 base::TimeDelta EstimatedParentDrawTime() {
249 return estimated_parent_draw_time_; 245 return estimated_parent_draw_time_;
250 } 246 }
251 247
252 bool IsInsideAction(SchedulerStateMachine::Action action) { 248 bool IsInsideAction(SchedulerStateMachine::Action action) {
253 return inside_action_ == action; 249 return inside_action_ == action;
254 } 250 }
255 251
256 base::WeakPtrFactory<Scheduler> weak_factory_; 252 base::WeakPtrFactory<Scheduler> weak_factory_;
257 253
258 friend class SchedulerFrameSourcesConstructor; 254 friend class SchedulerFrameSourcesConstructor;
259 friend class TestSchedulerFrameSourcesConstructor; 255 friend class TestSchedulerFrameSourcesConstructor;
260 256
261 DISALLOW_COPY_AND_ASSIGN(Scheduler); 257 DISALLOW_COPY_AND_ASSIGN(Scheduler);
262 }; 258 };
263 259
264 } // namespace cc 260 } // namespace cc
265 261
266 #endif // CC_SCHEDULER_SCHEDULER_H_ 262 #endif // CC_SCHEDULER_SCHEDULER_H_
OLDNEW
« no previous file with comments | « cc/output/output_surface_client.h ('k') | cc/scheduler/scheduler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698