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

Side by Side Diff: cc/test/scheduler_test_common.h

Issue 1765723002: Hoist begin frame sources out of scheduler (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@scheduler_remove_throttle_flag
Patch Set: Created 4 years, 9 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_TEST_SCHEDULER_TEST_COMMON_H_ 5 #ifndef CC_TEST_SCHEDULER_TEST_COMMON_H_
6 #define CC_TEST_SCHEDULER_TEST_COMMON_H_ 6 #define CC_TEST_SCHEDULER_TEST_COMMON_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 9
10 #include <string> 10 #include <string>
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after
206 base::TimeDelta prepare_tiles_duration_; 206 base::TimeDelta prepare_tiles_duration_;
207 base::TimeDelta activate_duration_; 207 base::TimeDelta activate_duration_;
208 base::TimeDelta draw_duration_; 208 base::TimeDelta draw_duration_;
209 209
210 private: 210 private:
211 DISALLOW_COPY_AND_ASSIGN(FakeCompositorTimingHistory); 211 DISALLOW_COPY_AND_ASSIGN(FakeCompositorTimingHistory);
212 }; 212 };
213 213
214 class TestScheduler : public Scheduler { 214 class TestScheduler : public Scheduler {
215 public: 215 public:
216 static scoped_ptr<TestScheduler> Create( 216 TestScheduler(base::SimpleTestTickClock* now_src,
217 base::SimpleTestTickClock* now_src, 217 SchedulerClient* client,
218 SchedulerClient* client, 218 const SchedulerSettings& scheduler_settings,
219 const SchedulerSettings& scheduler_settings, 219 int layer_tree_host_id,
220 int layer_tree_host_id, 220 OrderedSimpleTaskRunner* task_runner,
221 OrderedSimpleTaskRunner* task_runner, 221 BeginFrameSource* begin_frame_source,
222 BeginFrameSource* external_frame_source, 222 scoped_ptr<CompositorTimingHistory> compositor_timing_history);
223 scoped_ptr<CompositorTimingHistory> compositor_timing_history);
224 223
225 // Extra test helper functionality 224 // Extra test helper functionality
226 bool IsBeginRetroFrameArgsEmpty() const { 225 bool IsBeginRetroFrameArgsEmpty() const {
227 return begin_retro_frame_args_.empty(); 226 return begin_retro_frame_args_.empty();
228 } 227 }
229 228
230 bool SwapThrottled() const { return state_machine_.SwapThrottled(); } 229 bool SwapThrottled() const { return state_machine_.SwapThrottled(); }
231 230
232 bool NeedsBeginMainFrame() const { 231 bool NeedsBeginMainFrame() const {
233 return state_machine_.needs_begin_main_frame(); 232 return state_machine_.needs_begin_main_frame();
(...skipping 22 matching lines...) Expand all
256 // to Activation is fast. 255 // to Activation is fast.
257 void SetCriticalBeginMainFrameToActivateIsFast(bool is_fast) { 256 void SetCriticalBeginMainFrameToActivateIsFast(bool is_fast) {
258 state_machine_.SetCriticalBeginMainFrameToActivateIsFast(is_fast); 257 state_machine_.SetCriticalBeginMainFrameToActivateIsFast(is_fast);
259 } 258 }
260 259
261 protected: 260 protected:
262 // Overridden from Scheduler. 261 // Overridden from Scheduler.
263 base::TimeTicks Now() const override; 262 base::TimeTicks Now() const override;
264 263
265 private: 264 private:
266 TestScheduler(
267 base::SimpleTestTickClock* now_src,
268 SchedulerClient* client,
269 const SchedulerSettings& scheduler_settings,
270 int layer_tree_host_id,
271 OrderedSimpleTaskRunner* task_runner,
272 BeginFrameSource* external_frame_source,
273 scoped_ptr<TestSyntheticBeginFrameSource> synthetic_frame_source,
274 scoped_ptr<TestBackToBackBeginFrameSource> unthrottled_frame_source,
275 scoped_ptr<CompositorTimingHistory> compositor_timing_history);
276
277 base::SimpleTestTickClock* now_src_; 265 base::SimpleTestTickClock* now_src_;
278 266
279 DISALLOW_COPY_AND_ASSIGN(TestScheduler); 267 DISALLOW_COPY_AND_ASSIGN(TestScheduler);
280 }; 268 };
281 269
282 } // namespace cc 270 } // namespace cc
283 271
284 #endif // CC_TEST_SCHEDULER_TEST_COMMON_H_ 272 #endif // CC_TEST_SCHEDULER_TEST_COMMON_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698