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

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

Issue 1425973003: cc: Don't attempt main thread synchronization if it is slow. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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 | « no previous file | cc/scheduler/scheduler.cc » ('j') | cc/scheduler/scheduler.cc » ('J')
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 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
88 void SetNeedsRedraw(); 88 void SetNeedsRedraw();
89 89
90 void SetNeedsAnimate(); 90 void SetNeedsAnimate();
91 91
92 void SetNeedsPrepareTiles(); 92 void SetNeedsPrepareTiles();
93 93
94 void SetMaxSwapsPending(int max); 94 void SetMaxSwapsPending(int max);
95 void DidSwapBuffers(); 95 void DidSwapBuffers();
96 void DidSwapBuffersComplete(); 96 void DidSwapBuffersComplete();
97 97
98 void SetImplLatencyTakesPriority(bool impl_latency_takes_priority); 98 void SetSmoothnessMode(bool smoothness_takes_priority,
99 bool scroll_affects_scroll_handler);
99 100
100 void NotifyReadyToCommit(); 101 void NotifyReadyToCommit();
101 void BeginMainFrameAborted(CommitEarlyOutReason reason); 102 void BeginMainFrameAborted(CommitEarlyOutReason reason);
102 void DidCommit(); 103 void DidCommit();
103 104
104 void WillPrepareTiles(); 105 void WillPrepareTiles();
105 void DidPrepareTiles(); 106 void DidPrepareTiles();
106 void DidLoseOutputSurface(); 107 void DidLoseOutputSurface();
107 void DidCreateAndInitializeOutputSurface(); 108 void DidCreateAndInitializeOutputSurface();
108 109
109 // Tests do not want to shut down until all possible BeginMainFrames have 110 // Tests do not want to shut down until all possible BeginMainFrames have
110 // occured to prevent flakiness. 111 // occured to prevent flakiness.
111 bool MainFrameForTestingWillHappen() const { 112 bool MainFrameForTestingWillHappen() const {
112 return state_machine_.CommitPending() || 113 return state_machine_.CommitPending() ||
113 state_machine_.CouldSendBeginMainFrame(); 114 state_machine_.CouldSendBeginMainFrame();
114 } 115 }
115 116
116 bool CommitPending() const { return state_machine_.CommitPending(); } 117 bool CommitPending() const { return state_machine_.CommitPending(); }
117 bool RedrawPending() const { return state_machine_.RedrawPending(); } 118 bool RedrawPending() const { return state_machine_.RedrawPending(); }
118 bool PrepareTilesPending() const { 119 bool PrepareTilesPending() const {
119 return state_machine_.PrepareTilesPending(); 120 return state_machine_.PrepareTilesPending();
120 } 121 }
121 bool BeginImplFrameDeadlinePending() const { 122 bool BeginImplFrameDeadlinePending() const {
122 return !begin_impl_frame_deadline_task_.IsCancelled(); 123 return !begin_impl_frame_deadline_task_.IsCancelled();
123 } 124 }
124 bool ImplLatencyTakesPriority() const { 125 bool ImplLatencyTakesPriority() const {
125 return state_machine_.impl_latency_takes_priority(); 126 return state_machine_.ImplLatencyTakesPriority();
126 } 127 }
127 128
128 void NotifyBeginMainFrameStarted(); 129 void NotifyBeginMainFrameStarted();
129 130
130 base::TimeTicks LastBeginImplFrameTime(); 131 base::TimeTicks LastBeginImplFrameTime();
131 132
132 void SetDeferCommits(bool defer_commits); 133 void SetDeferCommits(bool defer_commits);
133 134
134 scoped_refptr<base::trace_event::ConvertableToTraceFormat> AsValue() const; 135 scoped_refptr<base::trace_event::ConvertableToTraceFormat> AsValue() const;
135 void AsValueInto(base::trace_event::TracedValue* value) const override; 136 void AsValueInto(base::trace_event::TracedValue* value) const override;
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
185 186
186 private: 187 private:
187 void ScheduleBeginImplFrameDeadline(); 188 void ScheduleBeginImplFrameDeadline();
188 void ScheduleBeginImplFrameDeadlineIfNeeded(); 189 void ScheduleBeginImplFrameDeadlineIfNeeded();
189 void SetupNextBeginFrameIfNeeded(); 190 void SetupNextBeginFrameIfNeeded();
190 void PostBeginRetroFrameIfNeeded(); 191 void PostBeginRetroFrameIfNeeded();
191 void DrawAndSwapIfPossible(); 192 void DrawAndSwapIfPossible();
192 void DrawAndSwapForced(); 193 void DrawAndSwapForced();
193 void ProcessScheduledActions(); 194 void ProcessScheduledActions();
194 void UpdateCompositorTimingHistoryRecordingEnabled(); 195 void UpdateCompositorTimingHistoryRecordingEnabled();
195 bool ShouldRecoverMainLatency(const BeginFrameArgs& args) const; 196 bool ShouldRecoverMainLatency(const BeginFrameArgs& args,
196 bool ShouldRecoverImplLatency(const BeginFrameArgs& args) const; 197 bool can_activate_before_deadline) const;
197 bool CanCommitAndActivateBeforeDeadline(const BeginFrameArgs& args) const; 198 bool ShouldRecoverImplLatency(const BeginFrameArgs& args,
199 bool can_activate_before_deadline) const;
200 bool CanCommitAndActivateBeforeDeadline(
201 const BeginFrameArgs& args,
202 base::TimeDelta bmf_to_activate_estimate) const;
198 void AdvanceCommitStateIfPossible(); 203 void AdvanceCommitStateIfPossible();
199 bool IsBeginMainFrameSentOrStarted() const; 204 bool IsBeginMainFrameSentOrStarted() const;
200 void BeginRetroFrame(); 205 void BeginRetroFrame();
201 void BeginImplFrameWithDeadline(const BeginFrameArgs& args); 206 void BeginImplFrameWithDeadline(const BeginFrameArgs& args);
202 void BeginImplFrameSynchronous(const BeginFrameArgs& args); 207 void BeginImplFrameSynchronous(const BeginFrameArgs& args);
203 void BeginImplFrame(const BeginFrameArgs& args); 208 void BeginImplFrame(const BeginFrameArgs& args);
204 void FinishImplFrame(); 209 void FinishImplFrame();
205 void OnBeginImplFrameDeadline(); 210 void OnBeginImplFrameDeadline();
206 void PollToAdvanceCommitState(); 211 void PollToAdvanceCommitState();
207 212
(...skipping 14 matching lines...) Expand all
222 } 227 }
223 228
224 base::WeakPtrFactory<Scheduler> weak_factory_; 229 base::WeakPtrFactory<Scheduler> weak_factory_;
225 230
226 DISALLOW_COPY_AND_ASSIGN(Scheduler); 231 DISALLOW_COPY_AND_ASSIGN(Scheduler);
227 }; 232 };
228 233
229 } // namespace cc 234 } // namespace cc
230 235
231 #endif // CC_SCHEDULER_SCHEDULER_H_ 236 #endif // CC_SCHEDULER_SCHEDULER_H_
OLDNEW
« no previous file with comments | « no previous file | cc/scheduler/scheduler.cc » ('j') | cc/scheduler/scheduler.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698