| 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 |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 TRACE_EVENT0("cc", "Scheduler::beginFrameAborted"); | 92 TRACE_EVENT0("cc", "Scheduler::beginFrameAborted"); |
| 93 m_stateMachine.beginFrameAborted(); | 93 m_stateMachine.beginFrameAborted(); |
| 94 processScheduledActions(); | 94 processScheduledActions(); |
| 95 } | 95 } |
| 96 | 96 |
| 97 void Scheduler::setMaxFramesPending(int maxFramesPending) | 97 void Scheduler::setMaxFramesPending(int maxFramesPending) |
| 98 { | 98 { |
| 99 m_frameRateController->setMaxFramesPending(maxFramesPending); | 99 m_frameRateController->setMaxFramesPending(maxFramesPending); |
| 100 } | 100 } |
| 101 | 101 |
| 102 int Scheduler::maxFramesPending() const |
| 103 { |
| 104 return m_frameRateController->maxFramesPending(); |
| 105 } |
| 106 |
| 102 void Scheduler::setSwapBuffersCompleteSupported(bool supported) | 107 void Scheduler::setSwapBuffersCompleteSupported(bool supported) |
| 103 { | 108 { |
| 104 m_frameRateController->setSwapBuffersCompleteSupported(supported); | 109 m_frameRateController->setSwapBuffersCompleteSupported(supported); |
| 105 } | 110 } |
| 106 | 111 |
| 107 void Scheduler::didSwapBuffersComplete() | 112 void Scheduler::didSwapBuffersComplete() |
| 108 { | 113 { |
| 109 TRACE_EVENT0("cc", "Scheduler::didSwapBuffersComplete"); | 114 TRACE_EVENT0("cc", "Scheduler::didSwapBuffersComplete"); |
| 110 m_frameRateController->didFinishFrame(); | 115 m_frameRateController->didFinishFrame(); |
| 111 } | 116 } |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 189 } | 194 } |
| 190 action = m_stateMachine.nextAction(); | 195 action = m_stateMachine.nextAction(); |
| 191 } | 196 } |
| 192 | 197 |
| 193 // Activate or deactivate the frame rate controller. | 198 // Activate or deactivate the frame rate controller. |
| 194 m_frameRateController->setActive(m_stateMachine.vsyncCallbackNeeded()); | 199 m_frameRateController->setActive(m_stateMachine.vsyncCallbackNeeded()); |
| 195 m_client->didAnticipatedDrawTimeChange(m_frameRateController->nextTickTime()
); | 200 m_client->didAnticipatedDrawTimeChange(m_frameRateController->nextTickTime()
); |
| 196 } | 201 } |
| 197 | 202 |
| 198 } // namespace cc | 203 } // namespace cc |
| OLD | NEW |