Chromium Code Reviews| 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_state_machine.h" | 5 #include "cc/scheduler_state_machine.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/stringprintf.h" | 8 #include "base/stringprintf.h" |
| 9 | 9 |
| 10 namespace cc { | 10 namespace cc { |
| 11 | 11 |
| 12 SchedulerStateMachine::SchedulerStateMachine() | 12 SchedulerStateMachine::SchedulerStateMachine(bool implSidePaintingEnabled) |
| 13 : m_commitState(COMMIT_STATE_IDLE) | 13 : m_implSidePaintingEnabled(implSidePaintingEnabled) |
|
nduca
2013/01/11 04:07:31
this makes sense to stay as a bool...
brianderson
2013/01/12 00:38:34
I'm just going to pass it all the way down, just i
| |
| 14 , m_commitState(COMMIT_STATE_IDLE) | |
| 14 , m_currentFrameNumber(0) | 15 , m_currentFrameNumber(0) |
| 15 , m_lastFrameNumberWhereDrawWasCalled(-1) | 16 , m_lastFrameNumberWhereDrawWasCalled(-1) |
| 16 , m_lastFrameNumberWhereTreeActivationAttempted(-1) | 17 , m_lastFrameNumberWhereTreeActivationAttempted(-1) |
| 17 , m_consecutiveFailedDraws(0) | 18 , m_consecutiveFailedDraws(0) |
| 18 , m_maximumNumberOfFailedDrawsBeforeDrawIsForced(3) | 19 , m_maximumNumberOfFailedDrawsBeforeDrawIsForced(3) |
| 19 , m_needsRedraw(false) | 20 , m_needsRedraw(false) |
| 20 , m_needsForcedRedraw(false) | 21 , m_needsForcedRedraw(false) |
| 21 , m_needsForcedRedrawAfterNextCommit(false) | 22 , m_needsForcedRedrawAfterNextCommit(false) |
| 22 , m_needsCommit(false) | 23 , m_needsCommit(false) |
| 23 , m_needsForcedCommit(false) | 24 , m_needsForcedCommit(false) |
| (...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 191 m_commitState = COMMIT_STATE_FRAME_IN_PROGRESS; | 192 m_commitState = COMMIT_STATE_FRAME_IN_PROGRESS; |
| 192 m_needsCommit = false; | 193 m_needsCommit = false; |
| 193 m_needsForcedCommit = false; | 194 m_needsForcedCommit = false; |
| 194 return; | 195 return; |
| 195 | 196 |
| 196 case ACTION_COMMIT: | 197 case ACTION_COMMIT: |
| 197 if (m_expectImmediateBeginFrame) | 198 if (m_expectImmediateBeginFrame) |
| 198 m_commitState = COMMIT_STATE_WAITING_FOR_FIRST_FORCED_DRAW; | 199 m_commitState = COMMIT_STATE_WAITING_FOR_FIRST_FORCED_DRAW; |
| 199 else | 200 else |
| 200 m_commitState = COMMIT_STATE_WAITING_FOR_FIRST_DRAW; | 201 m_commitState = COMMIT_STATE_WAITING_FOR_FIRST_DRAW; |
| 201 m_needsRedraw = true; | 202 if (!m_implSidePaintingEnabled) |
| 203 m_needsRedraw = true; | |
| 202 if (m_drawIfPossibleFailed) | 204 if (m_drawIfPossibleFailed) |
| 203 m_lastFrameNumberWhereDrawWasCalled = -1; | 205 m_lastFrameNumberWhereDrawWasCalled = -1; |
| 204 | 206 |
| 205 if (m_needsForcedRedrawAfterNextCommit) { | 207 if (m_needsForcedRedrawAfterNextCommit) { |
| 206 m_needsForcedRedrawAfterNextCommit = false; | 208 m_needsForcedRedrawAfterNextCommit = false; |
| 207 m_needsForcedRedraw = true; | 209 m_needsForcedRedraw = true; |
| 208 } | 210 } |
| 209 | 211 |
| 210 m_textureState = LAYER_TEXTURE_STATE_ACQUIRED_BY_IMPL_THREAD; | 212 m_textureState = LAYER_TEXTURE_STATE_ACQUIRED_BY_IMPL_THREAD; |
| 211 return; | 213 return; |
| (...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 361 m_outputSurfaceState = OUTPUT_SURFACE_ACTIVE; | 363 m_outputSurfaceState = OUTPUT_SURFACE_ACTIVE; |
| 362 setNeedsCommit(); | 364 setNeedsCommit(); |
| 363 } | 365 } |
| 364 | 366 |
| 365 void SchedulerStateMachine::setMaximumNumberOfFailedDrawsBeforeDrawIsForced(int numDraws) | 367 void SchedulerStateMachine::setMaximumNumberOfFailedDrawsBeforeDrawIsForced(int numDraws) |
| 366 { | 368 { |
| 367 m_maximumNumberOfFailedDrawsBeforeDrawIsForced = numDraws; | 369 m_maximumNumberOfFailedDrawsBeforeDrawIsForced = numDraws; |
| 368 } | 370 } |
| 369 | 371 |
| 370 } // namespace cc | 372 } // namespace cc |
| OLD | NEW |