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

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

Issue 2778223005: Plumb activation time to main (Closed)
Patch Set: pass 0 for sync tree in NotifyReadyToActivate from SingleThreadProxy Created 3 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
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 <memory> 9 #include <memory>
10 #include <string> 10 #include <string>
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 void OnBeginFrameSourcePausedChanged(bool paused) override; 70 void OnBeginFrameSourcePausedChanged(bool paused) override;
71 bool OnBeginFrameDerivedImpl(const BeginFrameArgs& args) override; 71 bool OnBeginFrameDerivedImpl(const BeginFrameArgs& args) override;
72 72
73 void OnDrawForCompositorFrameSink(bool resourceless_software_draw); 73 void OnDrawForCompositorFrameSink(bool resourceless_software_draw);
74 74
75 const SchedulerSettings& settings() const { return settings_; } 75 const SchedulerSettings& settings() const { return settings_; }
76 76
77 void SetVisible(bool visible); 77 void SetVisible(bool visible);
78 bool visible() { return state_machine_.visible(); } 78 bool visible() { return state_machine_.visible(); }
79 void SetCanDraw(bool can_draw); 79 void SetCanDraw(bool can_draw);
80 void NotifyReadyToActivate(); 80 void NotifyReadyToActivate(int sync_tree);
brianderson 2017/04/10 23:12:47 sync_tree -> source_frame_number
panicker 2017/04/11 22:19:37 Done.
81 void NotifyReadyToDraw(); 81 void NotifyReadyToDraw();
82 void SetBeginFrameSource(BeginFrameSource* source); 82 void SetBeginFrameSource(BeginFrameSource* source);
83 83
84 void SetNeedsBeginMainFrame(); 84 void SetNeedsBeginMainFrame();
85 // Requests a single impl frame (after the current frame if there is one 85 // Requests a single impl frame (after the current frame if there is one
86 // active). 86 // active).
87 void SetNeedsOneBeginImplFrame(); 87 void SetNeedsOneBeginImplFrame();
88 88
89 void SetNeedsRedraw(); 89 void SetNeedsRedraw();
90 90
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
178 base::Closure begin_impl_frame_deadline_closure_; 178 base::Closure begin_impl_frame_deadline_closure_;
179 base::CancelableClosure begin_impl_frame_deadline_task_; 179 base::CancelableClosure begin_impl_frame_deadline_task_;
180 base::CancelableClosure missed_begin_frame_task_; 180 base::CancelableClosure missed_begin_frame_task_;
181 181
182 SchedulerStateMachine state_machine_; 182 SchedulerStateMachine state_machine_;
183 bool inside_process_scheduled_actions_; 183 bool inside_process_scheduled_actions_;
184 SchedulerStateMachine::Action inside_action_; 184 SchedulerStateMachine::Action inside_action_;
185 185
186 bool stopped_; 186 bool stopped_;
187 187
188 // This is to report Activation (ReadyToActivate signal) time back to Main.
189 // A vector of pairs of source_frame_number and timestamp is captured, and
190 // sent back in BeginFrameArgs with the next ProxyMain::BeginMainFrame. A
191 // vector is needed as there can be multiple ReadyToActivate signals before
192 // the next BeginMainFrame.
193 std::vector<std::pair<uint32_t, base::TimeTicks>> ready_to_activate_time_;
194
188 private: 195 private:
189 void ScheduleBeginImplFrameDeadline(); 196 void ScheduleBeginImplFrameDeadline();
190 void ScheduleBeginImplFrameDeadlineIfNeeded(); 197 void ScheduleBeginImplFrameDeadlineIfNeeded();
191 void BeginImplFrameNotExpectedSoon(); 198 void BeginImplFrameNotExpectedSoon();
192 void SetupNextBeginFrameIfNeeded(); 199 void SetupNextBeginFrameIfNeeded();
193 void DrawIfPossible(); 200 void DrawIfPossible();
194 void DrawForced(); 201 void DrawForced();
195 void ProcessScheduledActions(); 202 void ProcessScheduledActions();
196 void UpdateCompositorTimingHistoryRecordingEnabled(); 203 void UpdateCompositorTimingHistoryRecordingEnabled();
197 bool ShouldRecoverMainLatency(const BeginFrameArgs& args, 204 bool ShouldRecoverMainLatency(const BeginFrameArgs& args,
(...skipping 20 matching lines...) Expand all
218 } 225 }
219 226
220 base::WeakPtrFactory<Scheduler> weak_factory_; 227 base::WeakPtrFactory<Scheduler> weak_factory_;
221 228
222 DISALLOW_COPY_AND_ASSIGN(Scheduler); 229 DISALLOW_COPY_AND_ASSIGN(Scheduler);
223 }; 230 };
224 231
225 } // namespace cc 232 } // namespace cc
226 233
227 #endif // CC_SCHEDULER_SCHEDULER_H_ 234 #endif // CC_SCHEDULER_SCHEDULER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698