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

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

Issue 548153004: Unified BeginFrame scheduling (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: git cl format Created 6 years, 3 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.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 28 matching lines...) Expand all
39 virtual void ScheduledActionCommit() = 0; 39 virtual void ScheduledActionCommit() = 0;
40 virtual void ScheduledActionUpdateVisibleTiles() = 0; 40 virtual void ScheduledActionUpdateVisibleTiles() = 0;
41 virtual void ScheduledActionActivateSyncTree() = 0; 41 virtual void ScheduledActionActivateSyncTree() = 0;
42 virtual void ScheduledActionBeginOutputSurfaceCreation() = 0; 42 virtual void ScheduledActionBeginOutputSurfaceCreation() = 0;
43 virtual void ScheduledActionManageTiles() = 0; 43 virtual void ScheduledActionManageTiles() = 0;
44 virtual void DidAnticipatedDrawTimeChange(base::TimeTicks time) = 0; 44 virtual void DidAnticipatedDrawTimeChange(base::TimeTicks time) = 0;
45 virtual base::TimeDelta DrawDurationEstimate() = 0; 45 virtual base::TimeDelta DrawDurationEstimate() = 0;
46 virtual base::TimeDelta BeginMainFrameToCommitDurationEstimate() = 0; 46 virtual base::TimeDelta BeginMainFrameToCommitDurationEstimate() = 0;
47 virtual base::TimeDelta CommitToActivateDurationEstimate() = 0; 47 virtual base::TimeDelta CommitToActivateDurationEstimate() = 0;
48 virtual void DidBeginImplFrameDeadline() = 0; 48 virtual void DidBeginImplFrameDeadline() = 0;
49 virtual void SendBeginFrameToChildren(const BeginFrameArgs& args) = 0;
49 50
50 protected: 51 protected:
51 virtual ~SchedulerClient() {} 52 virtual ~SchedulerClient() {}
52 }; 53 };
53 54
54 class CC_EXPORT Scheduler { 55 class CC_EXPORT Scheduler {
55 public: 56 public:
56 static scoped_ptr<Scheduler> Create( 57 static scoped_ptr<Scheduler> Create(
57 SchedulerClient* client, 58 SchedulerClient* client,
58 const SchedulerSettings& scheduler_settings, 59 const SchedulerSettings& scheduler_settings,
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
126 base::TimeTicks LastBeginImplFrameTime(); 127 base::TimeTicks LastBeginImplFrameTime();
127 128
128 void BeginFrame(const BeginFrameArgs& args); 129 void BeginFrame(const BeginFrameArgs& args);
129 130
130 scoped_refptr<base::debug::ConvertableToTraceFormat> AsValue() const; 131 scoped_refptr<base::debug::ConvertableToTraceFormat> AsValue() const;
131 132
132 void SetContinuousPainting(bool continuous_painting) { 133 void SetContinuousPainting(bool continuous_painting) {
133 state_machine_.SetContinuousPainting(continuous_painting); 134 state_machine_.SetContinuousPainting(continuous_painting);
134 } 135 }
135 136
137 // SetChildrenNeedBeginFrames() is only used when this Scheduler is acting
138 // as the publisher.
139 void SetChildrenNeedBeginFrames(bool need_begin_frame);
140 void SetAuthoritativeVSyncInterval(base::TimeDelta interval);
141
136 protected: 142 protected:
137 class CC_EXPORT SyntheticBeginFrameSource : public TimeSourceClient { 143 class CC_EXPORT SyntheticBeginFrameSource : public TimeSourceClient {
138 public: 144 public:
139 SyntheticBeginFrameSource(Scheduler* scheduler, 145 SyntheticBeginFrameSource(Scheduler* scheduler,
140 base::SingleThreadTaskRunner* task_runner); 146 base::SingleThreadTaskRunner* task_runner);
141 virtual ~SyntheticBeginFrameSource(); 147 virtual ~SyntheticBeginFrameSource();
142 148
143 // Updates the phase and frequency of the timer. 149 // Updates the phase and frequency of the timer.
144 void CommitVSyncParameters(base::TimeTicks timebase, 150 void CommitVSyncParameters(base::TimeTicks timebase,
145 base::TimeDelta interval); 151 base::TimeDelta interval);
(...skipping 21 matching lines...) Expand all
167 const SchedulerSettings& scheduler_settings, 173 const SchedulerSettings& scheduler_settings,
168 int layer_tree_host_id, 174 int layer_tree_host_id,
169 const scoped_refptr<base::SingleThreadTaskRunner>& task_runner); 175 const scoped_refptr<base::SingleThreadTaskRunner>& task_runner);
170 176
171 const SchedulerSettings settings_; 177 const SchedulerSettings settings_;
172 SchedulerClient* client_; 178 SchedulerClient* client_;
173 int layer_tree_host_id_; 179 int layer_tree_host_id_;
174 scoped_refptr<base::SingleThreadTaskRunner> task_runner_; 180 scoped_refptr<base::SingleThreadTaskRunner> task_runner_;
175 181
176 base::TimeDelta vsync_interval_; 182 base::TimeDelta vsync_interval_;
183 base::TimeDelta authoritative_vsync_interval_;
184 base::TimeTicks last_timebase_;
185
177 base::TimeDelta estimated_parent_draw_time_; 186 base::TimeDelta estimated_parent_draw_time_;
178 187
179 bool last_set_needs_begin_frame_; 188 bool last_set_needs_begin_frame_;
180 bool begin_unthrottled_frame_posted_; 189 bool begin_unthrottled_frame_posted_;
181 bool begin_retro_frame_posted_; 190 bool begin_retro_frame_posted_;
182 std::deque<BeginFrameArgs> begin_retro_frame_args_; 191 std::deque<BeginFrameArgs> begin_retro_frame_args_;
183 BeginFrameArgs begin_impl_frame_args_; 192 BeginFrameArgs begin_impl_frame_args_;
184 193
185 scoped_ptr<SyntheticBeginFrameSource> synthetic_begin_frame_source_; 194 scoped_ptr<SyntheticBeginFrameSource> synthetic_begin_frame_source_;
186 195
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
232 } 241 }
233 242
234 base::WeakPtrFactory<Scheduler> weak_factory_; 243 base::WeakPtrFactory<Scheduler> weak_factory_;
235 244
236 DISALLOW_COPY_AND_ASSIGN(Scheduler); 245 DISALLOW_COPY_AND_ASSIGN(Scheduler);
237 }; 246 };
238 247
239 } // namespace cc 248 } // namespace cc
240 249
241 #endif // CC_SCHEDULER_SCHEDULER_H_ 250 #endif // CC_SCHEDULER_SCHEDULER_H_
OLDNEW
« no previous file with comments | « cc/output/output_surface.cc ('k') | cc/scheduler/scheduler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698