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 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
65 m_stateMachine.setNeedsForcedCommit(); | 65 m_stateMachine.setNeedsForcedCommit(); |
66 processScheduledActions(); | 66 processScheduledActions(); |
67 } | 67 } |
68 | 68 |
69 void Scheduler::setNeedsRedraw() | 69 void Scheduler::setNeedsRedraw() |
70 { | 70 { |
71 m_stateMachine.setNeedsRedraw(); | 71 m_stateMachine.setNeedsRedraw(); |
72 processScheduledActions(); | 72 processScheduledActions(); |
73 } | 73 } |
74 | 74 |
| 75 void Scheduler::didSwapUseIncompleteTexture() |
| 76 { |
| 77 m_stateMachine.didSwapUseIncompleteTexture(); |
| 78 processScheduledActions(); |
| 79 } |
| 80 |
75 void Scheduler::setNeedsForcedRedraw() | 81 void Scheduler::setNeedsForcedRedraw() |
76 { | 82 { |
77 m_stateMachine.setNeedsForcedRedraw(); | 83 m_stateMachine.setNeedsForcedRedraw(); |
78 processScheduledActions(); | 84 processScheduledActions(); |
79 } | 85 } |
80 | 86 |
81 void Scheduler::setMainThreadNeedsLayerTextures() | 87 void Scheduler::setMainThreadNeedsLayerTextures() |
82 { | 88 { |
83 m_stateMachine.setMainThreadNeedsLayerTextures(); | 89 m_stateMachine.setMainThreadNeedsLayerTextures(); |
84 processScheduledActions(); | 90 processScheduledActions(); |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
170 | 176 |
171 switch (action) { | 177 switch (action) { |
172 case SchedulerStateMachine::ACTION_NONE: | 178 case SchedulerStateMachine::ACTION_NONE: |
173 break; | 179 break; |
174 case SchedulerStateMachine::ACTION_BEGIN_FRAME: | 180 case SchedulerStateMachine::ACTION_BEGIN_FRAME: |
175 m_client->scheduledActionBeginFrame(); | 181 m_client->scheduledActionBeginFrame(); |
176 break; | 182 break; |
177 case SchedulerStateMachine::ACTION_COMMIT: | 183 case SchedulerStateMachine::ACTION_COMMIT: |
178 m_client->scheduledActionCommit(); | 184 m_client->scheduledActionCommit(); |
179 break; | 185 break; |
| 186 case SchedulerStateMachine::ACTION_CHECK_FOR_NEW_TEXTURES: |
| 187 m_client->scheduledActionCheckForCompletedTextures(); |
| 188 break; |
180 case SchedulerStateMachine::ACTION_ACTIVATE_PENDING_TREE_IF_NEEDED: | 189 case SchedulerStateMachine::ACTION_ACTIVATE_PENDING_TREE_IF_NEEDED: |
181 m_client->scheduledActionActivatePendingTreeIfNeeded(); | 190 m_client->scheduledActionActivatePendingTreeIfNeeded(); |
182 break; | 191 break; |
183 case SchedulerStateMachine::ACTION_DRAW_IF_POSSIBLE: { | 192 case SchedulerStateMachine::ACTION_DRAW_IF_POSSIBLE: { |
184 ScheduledActionDrawAndSwapResult result = m_client->scheduledActionD
rawAndSwapIfPossible(); | 193 ScheduledActionDrawAndSwapResult result = m_client->scheduledActionD
rawAndSwapIfPossible(); |
185 m_stateMachine.didDrawIfPossibleCompleted(result.didDraw); | 194 m_stateMachine.didDrawIfPossibleCompleted(result.didDraw); |
186 if (result.didSwap) | 195 if (result.didSwap) |
187 m_frameRateController->didBeginFrame(); | 196 m_frameRateController->didBeginFrame(); |
188 break; | 197 break; |
189 } | 198 } |
(...skipping 11 matching lines...) Expand all Loading... |
201 } | 210 } |
202 action = m_stateMachine.nextAction(); | 211 action = m_stateMachine.nextAction(); |
203 } | 212 } |
204 | 213 |
205 // Activate or deactivate the frame rate controller. | 214 // Activate or deactivate the frame rate controller. |
206 m_frameRateController->setActive(m_stateMachine.vsyncCallbackNeeded()); | 215 m_frameRateController->setActive(m_stateMachine.vsyncCallbackNeeded()); |
207 m_client->didAnticipatedDrawTimeChange(m_frameRateController->nextTickTime()
); | 216 m_client->didAnticipatedDrawTimeChange(m_frameRateController->nextTickTime()
); |
208 } | 217 } |
209 | 218 |
210 } // namespace cc | 219 } // namespace cc |
OLD | NEW |