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 80 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 |