| 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 "CCFrameRateController.h" | 7 #include "CCFrameRateController.h" |
| 8 | 8 |
| 9 #include "CCDelayBasedTimeSource.h" | 9 #include "CCDelayBasedTimeSource.h" |
| 10 #include "CCTimeSource.h" | 10 #include "CCTimeSource.h" |
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 123 m_manualTicker->startOneShot(0); | 123 m_manualTicker->startOneShot(0); |
| 124 } | 124 } |
| 125 | 125 |
| 126 void CCFrameRateController::onTimerFired() | 126 void CCFrameRateController::onTimerFired() |
| 127 { | 127 { |
| 128 onTimerTick(); | 128 onTimerTick(); |
| 129 } | 129 } |
| 130 | 130 |
| 131 void CCFrameRateController::didBeginFrame() | 131 void CCFrameRateController::didBeginFrame() |
| 132 { | 132 { |
| 133 ASSERT(m_active); |
| 134 |
| 133 if (m_swapBuffersCompleteSupported) | 135 if (m_swapBuffersCompleteSupported) |
| 134 m_numFramesPending++; | 136 m_numFramesPending++; |
| 135 else if (!m_isTimeSourceThrottling) | 137 else if (!m_isTimeSourceThrottling) |
| 136 postManualTick(); | 138 postManualTick(); |
| 137 } | 139 } |
| 138 | 140 |
| 139 void CCFrameRateController::didFinishFrame() | 141 void CCFrameRateController::didFinishFrame() |
| 140 { | 142 { |
| 141 ASSERT(m_swapBuffersCompleteSupported); | 143 ASSERT(m_swapBuffersCompleteSupported); |
| 142 | 144 |
| 143 m_numFramesPending--; | 145 m_numFramesPending--; |
| 144 if (!m_isTimeSourceThrottling) | 146 if (!m_isTimeSourceThrottling) |
| 145 postManualTick(); | 147 postManualTick(); |
| 146 } | 148 } |
| 147 | 149 |
| 148 void CCFrameRateController::didAbortAllPendingFrames() | 150 void CCFrameRateController::didAbortAllPendingFrames() |
| 149 { | 151 { |
| 150 m_numFramesPending = 0; | 152 m_numFramesPending = 0; |
| 151 } | 153 } |
| 152 | 154 |
| 153 base::TimeTicks CCFrameRateController::nextTickTime() | 155 base::TimeTicks CCFrameRateController::nextTickTime() |
| 154 { | 156 { |
| 155 if (m_isTimeSourceThrottling) | 157 if (m_isTimeSourceThrottling) |
| 156 return m_timeSource->nextTickTime(); | 158 return m_timeSource->nextTickTime(); |
| 157 | 159 |
| 158 return base::TimeTicks(); | 160 return base::TimeTicks(); |
| 159 } | 161 } |
| 160 | 162 |
| 161 } | 163 } |
| OLD | NEW |