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 #include "cc/layer_tree_settings.h" |
10 | 11 |
11 namespace cc { | 12 namespace cc { |
12 | 13 |
13 Scheduler::Scheduler(SchedulerClient* client, scoped_ptr<FrameRateController> fr
ameRateController) | 14 Scheduler::Scheduler(SchedulerClient* client, |
| 15 scoped_ptr<FrameRateController> frameRateController, |
| 16 const LayerTreeSettings& layerTreeSettings) |
14 : m_client(client) | 17 : m_client(client) |
15 , m_frameRateController(frameRateController.Pass()) | 18 , m_frameRateController(frameRateController.Pass()) |
| 19 , m_layerTreeSettings(layerTreeSettings) |
| 20 , m_stateMachine(layerTreeSettings) |
16 , m_insideProcessScheduledActions(false) | 21 , m_insideProcessScheduledActions(false) |
17 { | 22 { |
18 DCHECK(m_client); | 23 DCHECK(m_client); |
19 m_frameRateController->setClient(this); | 24 m_frameRateController->setClient(this); |
20 DCHECK(!m_stateMachine.vsyncCallbackNeeded()); | 25 DCHECK(!m_stateMachine.vsyncCallbackNeeded()); |
21 } | 26 } |
22 | 27 |
23 Scheduler::~Scheduler() | 28 Scheduler::~Scheduler() |
24 { | 29 { |
25 m_frameRateController->setActive(false); | 30 m_frameRateController->setActive(false); |
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
192 } | 197 } |
193 action = m_stateMachine.nextAction(); | 198 action = m_stateMachine.nextAction(); |
194 } | 199 } |
195 | 200 |
196 // Activate or deactivate the frame rate controller. | 201 // Activate or deactivate the frame rate controller. |
197 m_frameRateController->setActive(m_stateMachine.vsyncCallbackNeeded()); | 202 m_frameRateController->setActive(m_stateMachine.vsyncCallbackNeeded()); |
198 m_client->didAnticipatedDrawTimeChange(m_frameRateController->nextTickTime()
); | 203 m_client->didAnticipatedDrawTimeChange(m_frameRateController->nextTickTime()
); |
199 } | 204 } |
200 | 205 |
201 } // namespace cc | 206 } // namespace cc |
OLD | NEW |