OLD | NEW |
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 #include "cc/scheduler.h" | 5 #include "cc/scheduler.h" |
6 | 6 |
7 #include "base/auto_reset.h" | 7 #include "base/auto_reset.h" |
8 #include "base/debug/trace_event.h" | 8 #include "base/debug/trace_event.h" |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 | 10 |
11 namespace cc { | 11 namespace cc { |
12 | 12 |
13 Scheduler::Scheduler(SchedulerClient* client, scoped_ptr<FrameRateController> fr
ameRateController) | 13 Scheduler::Scheduler(SchedulerClient* client, scoped_ptr<FrameRateController> fr
ameRateController) |
14 : m_client(client) | 14 : m_client(client) |
15 , m_frameRateController(frameRateController.Pass()) | 15 , m_frameRateController(frameRateController.Pass()) |
16 , m_insideProcessScheduledActions(false) | 16 , m_insideProcessScheduledActions(false) |
17 { | 17 { |
18 DCHECK(m_client); | 18 DCHECK(m_client); |
19 m_frameRateController->setClient(this); | 19 m_frameRateController->setClient(this); |
20 DCHECK(!m_stateMachine.vsyncCallbackNeeded()); | 20 DCHECK(!m_stateMachine.vsyncCallbackNeeded()); |
| 21 |
| 22 m_stateMachine.setSettingsJankInsteadOfCheckerboard(m_client->settings().jan
kInsteadOfCheckerboard); |
21 } | 23 } |
22 | 24 |
23 Scheduler::~Scheduler() | 25 Scheduler::~Scheduler() |
24 { | 26 { |
25 m_frameRateController->setActive(false); | 27 m_frameRateController->setActive(false); |
26 } | 28 } |
27 | 29 |
28 void Scheduler::setCanBeginFrame(bool can) | 30 void Scheduler::setCanBeginFrame(bool can) |
29 { | 31 { |
30 m_stateMachine.setCanBeginFrame(can); | 32 m_stateMachine.setCanBeginFrame(can); |
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
182 } | 184 } |
183 action = m_stateMachine.nextAction(); | 185 action = m_stateMachine.nextAction(); |
184 } | 186 } |
185 | 187 |
186 // Activate or deactivate the frame rate controller. | 188 // Activate or deactivate the frame rate controller. |
187 m_frameRateController->setActive(m_stateMachine.vsyncCallbackNeeded()); | 189 m_frameRateController->setActive(m_stateMachine.vsyncCallbackNeeded()); |
188 m_client->didAnticipatedDrawTimeChange(m_frameRateController->nextTickTime()
); | 190 m_client->didAnticipatedDrawTimeChange(m_frameRateController->nextTickTime()
); |
189 } | 191 } |
190 | 192 |
191 } // namespace cc | 193 } // namespace cc |
OLD | NEW |