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

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

Issue 1052103002: 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 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
207 203
208 base::TimeDelta estimated_parent_draw_time_; 204 base::TimeDelta estimated_parent_draw_time_;
209 205
210 std::deque<BeginFrameArgs> begin_retro_frame_args_; 206 std::deque<BeginFrameArgs> begin_retro_frame_args_;
211 BeginFrameArgs begin_impl_frame_args_; 207 BeginFrameArgs begin_impl_frame_args_;
212 SchedulerStateMachine::BeginImplFrameDeadlineMode 208 SchedulerStateMachine::BeginImplFrameDeadlineMode
213 begin_impl_frame_deadline_mode_; 209 begin_impl_frame_deadline_mode_;
214 210
215 base::Closure begin_retro_frame_closure_; 211 base::Closure begin_retro_frame_closure_;
216 base::Closure begin_impl_frame_deadline_closure_; 212 base::Closure begin_impl_frame_deadline_closure_;
213 base::Closure poll_for_draw_triggers_closure_;
217 base::Closure advance_commit_state_closure_; 214 base::Closure advance_commit_state_closure_;
218 base::CancelableClosure begin_retro_frame_task_; 215 base::CancelableClosure begin_retro_frame_task_;
219 base::CancelableClosure begin_impl_frame_deadline_task_; 216 base::CancelableClosure begin_impl_frame_deadline_task_;
217 base::CancelableClosure poll_for_draw_triggers_task_;
220 base::CancelableClosure advance_commit_state_task_; 218 base::CancelableClosure advance_commit_state_task_;
221 219
222 SchedulerStateMachine state_machine_; 220 SchedulerStateMachine state_machine_;
223 bool inside_process_scheduled_actions_; 221 bool inside_process_scheduled_actions_;
224 SchedulerStateMachine::Action inside_action_; 222 SchedulerStateMachine::Action inside_action_;
225 223
226 private: 224 private:
227 void ScheduleBeginImplFrameDeadline(); 225 void ScheduleBeginImplFrameDeadline();
228 void ScheduleBeginImplFrameDeadlineIfNeeded(); 226 void RescheduleBeginImplFrameDeadlineIfNeeded();
229 void SetupNextBeginFrameIfNeeded(); 227 void SetupNextBeginFrameIfNeeded();
230 void PostBeginRetroFrameIfNeeded(); 228 void PostBeginRetroFrameIfNeeded();
231 void SetupPollingMechanisms(); 229 void SetupPollingMechanisms();
232 void DrawAndSwapIfPossible(); 230 void DrawAndSwapIfPossible();
233 void ProcessScheduledActions(); 231 void ProcessScheduledActions();
234 bool CanCommitAndActivateBeforeDeadline() const; 232 bool CanCommitAndActivateBeforeDeadline() const;
235 void AdvanceCommitStateIfPossible(); 233 void AdvanceCommitStateIfPossible();
236 bool IsBeginMainFrameSentOrStarted() const; 234 bool IsBeginMainFrameSentOrStarted() const;
237 void BeginRetroFrame(); 235 void BeginRetroFrame();
238 void BeginImplFrameWithDeadline(const BeginFrameArgs& args);
239 void BeginImplFrameSynchronous(const BeginFrameArgs& args);
240 void BeginImplFrame(const BeginFrameArgs& args); 236 void BeginImplFrame(const BeginFrameArgs& args);
241 void FinishImplFrame();
242 void OnBeginImplFrameDeadline(); 237 void OnBeginImplFrameDeadline();
238 void PollForAnticipatedDrawTriggers();
243 void PollToAdvanceCommitState(); 239 void PollToAdvanceCommitState();
244 void UpdateActiveFrameSource(); 240 void UpdateActiveFrameSource();
245 241
246 base::TimeDelta EstimatedParentDrawTime() { 242 base::TimeDelta EstimatedParentDrawTime() {
247 return estimated_parent_draw_time_; 243 return estimated_parent_draw_time_;
248 } 244 }
249 245
250 bool IsInsideAction(SchedulerStateMachine::Action action) { 246 bool IsInsideAction(SchedulerStateMachine::Action action) {
251 return inside_action_ == action; 247 return inside_action_ == action;
252 } 248 }
253 249
254 base::WeakPtrFactory<Scheduler> weak_factory_; 250 base::WeakPtrFactory<Scheduler> weak_factory_;
255 251
256 friend class SchedulerFrameSourcesConstructor; 252 friend class SchedulerFrameSourcesConstructor;
257 friend class TestSchedulerFrameSourcesConstructor; 253 friend class TestSchedulerFrameSourcesConstructor;
258 254
259 DISALLOW_COPY_AND_ASSIGN(Scheduler); 255 DISALLOW_COPY_AND_ASSIGN(Scheduler);
260 }; 256 };
261 257
262 } // namespace cc 258 } // namespace cc
263 259
264 #endif // CC_SCHEDULER_SCHEDULER_H_ 260 #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