OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2011 Google Inc. All rights reserved. | 2 * Copyright (C) 2011 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
156 // then we will ack the update at the next draw. | 156 // then we will ack the update at the next draw. |
157 m_updateMoreResourcesPending = false; | 157 m_updateMoreResourcesPending = false; |
158 m_stateMachine.beginUpdateMoreResourcesComplete(false); | 158 m_stateMachine.beginUpdateMoreResourcesComplete(false); |
159 } else | 159 } else |
160 m_updateMoreResourcesPending = true; | 160 m_updateMoreResourcesPending = true; |
161 break; | 161 break; |
162 case CCSchedulerStateMachine::ACTION_COMMIT: | 162 case CCSchedulerStateMachine::ACTION_COMMIT: |
163 m_client->scheduledActionCommit(); | 163 m_client->scheduledActionCommit(); |
164 break; | 164 break; |
165 case CCSchedulerStateMachine::ACTION_DRAW_IF_POSSIBLE: { | 165 case CCSchedulerStateMachine::ACTION_DRAW_IF_POSSIBLE: { |
166 bool drawSuccess = m_client->scheduledActionDrawAndSwapIfPossible(); | 166 CCScheduledActionDrawAndSwapResult result = m_client->scheduledActio
nDrawAndSwapIfPossible(); |
167 m_stateMachine.didDrawIfPossibleCompleted(drawSuccess); | 167 m_stateMachine.didDrawIfPossibleCompleted(result.didDraw); |
168 if (drawSuccess) | 168 if (result.didSwap) |
169 m_frameRateController->didBeginFrame(); | 169 m_frameRateController->didBeginFrame(); |
170 break; | 170 break; |
171 } | 171 } |
172 case CCSchedulerStateMachine::ACTION_DRAW_FORCED: | 172 case CCSchedulerStateMachine::ACTION_DRAW_FORCED: { |
173 m_client->scheduledActionDrawAndSwapForced(); | 173 CCScheduledActionDrawAndSwapResult result = m_client->scheduledActio
nDrawAndSwapForced(); |
174 m_frameRateController->didBeginFrame(); | 174 if (result.didSwap) |
| 175 m_frameRateController->didBeginFrame(); |
175 break; | 176 break; |
176 case CCSchedulerStateMachine::ACTION_BEGIN_CONTEXT_RECREATION: | 177 } case CCSchedulerStateMachine::ACTION_BEGIN_CONTEXT_RECREATION: |
177 m_client->scheduledActionBeginContextRecreation(); | 178 m_client->scheduledActionBeginContextRecreation(); |
178 break; | 179 break; |
179 } | 180 } |
180 } while (action != CCSchedulerStateMachine::ACTION_NONE); | 181 } while (action != CCSchedulerStateMachine::ACTION_NONE); |
181 | 182 |
182 // Activate or deactivate the frame rate controller. | 183 // Activate or deactivate the frame rate controller. |
183 m_frameRateController->setActive(m_stateMachine.vsyncCallbackNeeded()); | 184 m_frameRateController->setActive(m_stateMachine.vsyncCallbackNeeded()); |
184 } | 185 } |
185 | 186 |
186 } | 187 } |
OLD | NEW |