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 26 matching lines...) Expand all Loading... |
37 ASSERT(m_client); | 37 ASSERT(m_client); |
38 m_frameRateController->setClient(this); | 38 m_frameRateController->setClient(this); |
39 m_frameRateController->setActive(m_stateMachine.vsyncCallbackNeeded()); | 39 m_frameRateController->setActive(m_stateMachine.vsyncCallbackNeeded()); |
40 } | 40 } |
41 | 41 |
42 CCScheduler::~CCScheduler() | 42 CCScheduler::~CCScheduler() |
43 { | 43 { |
44 m_frameRateController->setActive(false); | 44 m_frameRateController->setActive(false); |
45 } | 45 } |
46 | 46 |
| 47 void CCScheduler::setCanBeginFrame(bool can) |
| 48 { |
| 49 m_stateMachine.setCanBeginFrame(can); |
| 50 processScheduledActions(); |
| 51 } |
| 52 |
47 void CCScheduler::setVisible(bool visible) | 53 void CCScheduler::setVisible(bool visible) |
48 { | 54 { |
49 m_stateMachine.setVisible(visible); | 55 m_stateMachine.setVisible(visible); |
50 processScheduledActions(); | 56 processScheduledActions(); |
51 } | 57 } |
52 | 58 |
53 void CCScheduler::setNeedsCommit() | 59 void CCScheduler::setNeedsCommit() |
54 { | 60 { |
55 m_stateMachine.setNeedsCommit(); | 61 m_stateMachine.setNeedsCommit(); |
56 processScheduledActions(); | 62 processScheduledActions(); |
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
178 m_client->scheduledActionBeginContextRecreation(); | 184 m_client->scheduledActionBeginContextRecreation(); |
179 break; | 185 break; |
180 } | 186 } |
181 } while (action != CCSchedulerStateMachine::ACTION_NONE); | 187 } while (action != CCSchedulerStateMachine::ACTION_NONE); |
182 | 188 |
183 // Activate or deactivate the frame rate controller. | 189 // Activate or deactivate the frame rate controller. |
184 m_frameRateController->setActive(m_stateMachine.vsyncCallbackNeeded()); | 190 m_frameRateController->setActive(m_stateMachine.vsyncCallbackNeeded()); |
185 } | 191 } |
186 | 192 |
187 } | 193 } |
OLD | NEW |