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 #include "cc/layer_tree_settings.h" | |
| 9 | 10 |
| 10 namespace cc { | 11 namespace cc { |
| 11 | 12 |
| 12 SchedulerStateMachine::SchedulerStateMachine() | 13 SchedulerStateMachine::SchedulerStateMachine(const LayerTreeSettings &layerTreeS ettings) |
|
nduca
2013/01/15 01:54:54
I'm not liking the machine having access to all th
brianderson
2013/01/15 02:01:56
Sounds good.
| |
| 13 : m_commitState(COMMIT_STATE_IDLE) | 14 : m_layerTreeSettings(layerTreeSettings) |
| 15 , m_commitState(COMMIT_STATE_IDLE) | |
| 14 , m_currentFrameNumber(0) | 16 , m_currentFrameNumber(0) |
| 15 , m_lastFrameNumberWhereDrawWasCalled(-1) | 17 , m_lastFrameNumberWhereDrawWasCalled(-1) |
| 16 , m_lastFrameNumberWhereTreeActivationAttempted(-1) | 18 , m_lastFrameNumberWhereTreeActivationAttempted(-1) |
| 17 , m_consecutiveFailedDraws(0) | 19 , m_consecutiveFailedDraws(0) |
| 18 , m_maximumNumberOfFailedDrawsBeforeDrawIsForced(3) | 20 , m_maximumNumberOfFailedDrawsBeforeDrawIsForced(3) |
| 19 , m_needsRedraw(false) | 21 , m_needsRedraw(false) |
| 20 , m_needsForcedRedraw(false) | 22 , m_needsForcedRedraw(false) |
| 21 , m_needsForcedRedrawAfterNextCommit(false) | 23 , m_needsForcedRedrawAfterNextCommit(false) |
| 22 , m_needsCommit(false) | 24 , m_needsCommit(false) |
| 23 , m_needsForcedCommit(false) | 25 , m_needsForcedCommit(false) |
| (...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 202 m_commitState = COMMIT_STATE_FRAME_IN_PROGRESS; | 204 m_commitState = COMMIT_STATE_FRAME_IN_PROGRESS; |
| 203 m_needsCommit = false; | 205 m_needsCommit = false; |
| 204 m_needsForcedCommit = false; | 206 m_needsForcedCommit = false; |
| 205 return; | 207 return; |
| 206 | 208 |
| 207 case ACTION_COMMIT: | 209 case ACTION_COMMIT: |
| 208 if (m_expectImmediateBeginFrame) | 210 if (m_expectImmediateBeginFrame) |
| 209 m_commitState = COMMIT_STATE_WAITING_FOR_FIRST_FORCED_DRAW; | 211 m_commitState = COMMIT_STATE_WAITING_FOR_FIRST_FORCED_DRAW; |
| 210 else | 212 else |
| 211 m_commitState = COMMIT_STATE_WAITING_FOR_FIRST_DRAW; | 213 m_commitState = COMMIT_STATE_WAITING_FOR_FIRST_DRAW; |
| 212 m_needsRedraw = true; | 214 if (!m_layerTreeSettings.implSidePainting) |
| 215 m_needsRedraw = true; | |
| 213 if (m_drawIfPossibleFailed) | 216 if (m_drawIfPossibleFailed) |
| 214 m_lastFrameNumberWhereDrawWasCalled = -1; | 217 m_lastFrameNumberWhereDrawWasCalled = -1; |
| 215 | 218 |
| 216 if (m_needsForcedRedrawAfterNextCommit) { | 219 if (m_needsForcedRedrawAfterNextCommit) { |
| 217 m_needsForcedRedrawAfterNextCommit = false; | 220 m_needsForcedRedrawAfterNextCommit = false; |
| 218 m_needsForcedRedraw = true; | 221 m_needsForcedRedraw = true; |
| 219 } | 222 } |
| 220 | 223 |
| 221 m_textureState = LAYER_TEXTURE_STATE_ACQUIRED_BY_IMPL_THREAD; | 224 m_textureState = LAYER_TEXTURE_STATE_ACQUIRED_BY_IMPL_THREAD; |
| 222 return; | 225 return; |
| (...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 372 m_outputSurfaceState = OUTPUT_SURFACE_ACTIVE; | 375 m_outputSurfaceState = OUTPUT_SURFACE_ACTIVE; |
| 373 setNeedsCommit(); | 376 setNeedsCommit(); |
| 374 } | 377 } |
| 375 | 378 |
| 376 void SchedulerStateMachine::setMaximumNumberOfFailedDrawsBeforeDrawIsForced(int numDraws) | 379 void SchedulerStateMachine::setMaximumNumberOfFailedDrawsBeforeDrawIsForced(int numDraws) |
| 377 { | 380 { |
| 378 m_maximumNumberOfFailedDrawsBeforeDrawIsForced = numDraws; | 381 m_maximumNumberOfFailedDrawsBeforeDrawIsForced = numDraws; |
| 379 } | 382 } |
| 380 | 383 |
| 381 } // namespace cc | 384 } // namespace cc |
| OLD | NEW |