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

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

Issue 2061273002: cc: Make BackToBackBeginFrameSource a SyntheticBeginFrameSource. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: syntheticbeginframesource: delete-DEBUG_FRAMES Created 4 years, 6 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/test/scheduler_test_common.h ('k') | cc/trees/proxy_impl.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 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 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 #include "cc/test/scheduler_test_common.h" 5 #include "cc/test/scheduler_test_common.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <string> 9 #include <string>
10 10
11 #include "base/logging.h" 11 #include "base/logging.h"
12 #include "base/memory/ptr_util.h" 12 #include "base/memory/ptr_util.h"
13 #include "cc/debug/rendering_stats_instrumentation.h" 13 #include "cc/debug/rendering_stats_instrumentation.h"
14 14
15 namespace cc { 15 namespace cc {
16 16
17 void FakeDelayBasedTimeSourceClient::OnTimerTick() { 17 void FakeDelayBasedTimeSourceClient::OnTimerTick() {
18 tick_called_ = true; 18 tick_called_ = true;
19 } 19 }
20 20
21 base::TimeTicks FakeDelayBasedTimeSource::Now() const { return now_; } 21 base::TimeTicks FakeDelayBasedTimeSource::Now() const { return now_; }
22 22
23 TestDelayBasedTimeSource::TestDelayBasedTimeSource( 23 TestDelayBasedTimeSource::TestDelayBasedTimeSource(
24 base::SimpleTestTickClock* now_src, 24 base::SimpleTestTickClock* now_src,
25 base::TimeDelta interval,
26 OrderedSimpleTaskRunner* task_runner) 25 OrderedSimpleTaskRunner* task_runner)
27 : DelayBasedTimeSource(interval, task_runner), now_src_(now_src) { 26 : DelayBasedTimeSource(task_runner), now_src_(now_src) {}
28 }
29 27
30 base::TimeTicks TestDelayBasedTimeSource::Now() const { 28 base::TimeTicks TestDelayBasedTimeSource::Now() const {
31 return now_src_->NowTicks(); 29 return now_src_->NowTicks();
32 } 30 }
33 31
34 std::string TestDelayBasedTimeSource::TypeString() const { 32 std::string TestDelayBasedTimeSource::TypeString() const {
35 return "TestDelayBasedTimeSource"; 33 return "TestDelayBasedTimeSource";
36 } 34 }
37 35
38 TestDelayBasedTimeSource::~TestDelayBasedTimeSource() { 36 TestDelayBasedTimeSource::~TestDelayBasedTimeSource() {
39 } 37 }
40 38
41 FakeBeginFrameSource::FakeBeginFrameSource() {}
42
43 FakeBeginFrameSource::~FakeBeginFrameSource() {}
44
45 TestBackToBackBeginFrameSource::TestBackToBackBeginFrameSource(
46 base::SimpleTestTickClock* now_src,
47 base::SingleThreadTaskRunner* task_runner)
48 : BackToBackBeginFrameSource(task_runner), now_src_(now_src) {
49 }
50
51 TestBackToBackBeginFrameSource::~TestBackToBackBeginFrameSource() {
52 }
53
54 base::TimeTicks TestBackToBackBeginFrameSource::Now() {
55 return now_src_->NowTicks();
56 }
57
58 TestSyntheticBeginFrameSource::TestSyntheticBeginFrameSource(
59 base::SimpleTestTickClock* now_src,
60 OrderedSimpleTaskRunner* task_runner,
61 base::TimeDelta initial_interval)
62 : SyntheticBeginFrameSource(
63 TestDelayBasedTimeSource::Create(now_src,
64 initial_interval,
65 task_runner)) {}
66
67 TestSyntheticBeginFrameSource::~TestSyntheticBeginFrameSource() {
68 }
69
70 std::unique_ptr<FakeCompositorTimingHistory> 39 std::unique_ptr<FakeCompositorTimingHistory>
71 FakeCompositorTimingHistory::Create( 40 FakeCompositorTimingHistory::Create(
72 bool using_synchronous_renderer_compositor) { 41 bool using_synchronous_renderer_compositor) {
73 std::unique_ptr<RenderingStatsInstrumentation> 42 std::unique_ptr<RenderingStatsInstrumentation>
74 rendering_stats_instrumentation = RenderingStatsInstrumentation::Create(); 43 rendering_stats_instrumentation = RenderingStatsInstrumentation::Create();
75 return base::WrapUnique(new FakeCompositorTimingHistory( 44 return base::WrapUnique(new FakeCompositorTimingHistory(
76 using_synchronous_renderer_compositor, 45 using_synchronous_renderer_compositor,
77 std::move(rendering_stats_instrumentation))); 46 std::move(rendering_stats_instrumentation)));
78 } 47 }
79 48
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
200 now_src_(now_src) {} 169 now_src_(now_src) {}
201 170
202 base::TimeTicks TestScheduler::Now() const { 171 base::TimeTicks TestScheduler::Now() const {
203 return now_src_->NowTicks(); 172 return now_src_->NowTicks();
204 } 173 }
205 174
206 TestScheduler::~TestScheduler() { 175 TestScheduler::~TestScheduler() {
207 } 176 }
208 177
209 } // namespace cc 178 } // namespace cc
OLDNEW
« no previous file with comments | « cc/test/scheduler_test_common.h ('k') | cc/trees/proxy_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698