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