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/scheduler.h" | 9 #include "cc/scheduler.h" |
10 | 10 |
11 namespace cc { | 11 namespace cc { |
12 | 12 |
13 SchedulerStateMachine::SchedulerStateMachine(const SchedulerSettings* const sett
ings) | 13 SchedulerStateMachine::SchedulerStateMachine(const SchedulerSettings* const sett
ings) |
14 : m_settings(settings) | 14 : m_settings(settings) |
15 , m_commitState(COMMIT_STATE_IDLE) | 15 , m_commitState(COMMIT_STATE_IDLE) |
16 , m_currentFrameNumber(0) | 16 , m_currentFrameNumber(0) |
17 , m_lastFrameNumberWhereDrawWasCalled(-1) | 17 , m_lastFrameNumberWhereDrawWasCalled(-1) |
18 , m_lastFrameNumberWhereTreeActivationAttempted(-1) | 18 , m_lastFrameNumberWhereTreeActivationAttempted(-1) |
| 19 , m_lastFrameNumberWhereCheckForNewTexturesCalled(-1) |
19 , m_consecutiveFailedDraws(0) | 20 , m_consecutiveFailedDraws(0) |
20 , m_maximumNumberOfFailedDrawsBeforeDrawIsForced(3) | 21 , m_maximumNumberOfFailedDrawsBeforeDrawIsForced(3) |
21 , m_needsRedraw(false) | 22 , m_needsRedraw(false) |
| 23 , m_needsRedrawOnVisibleTextureUpload(false) |
22 , m_needsForcedRedraw(false) | 24 , m_needsForcedRedraw(false) |
23 , m_needsForcedRedrawAfterNextCommit(false) | 25 , m_needsForcedRedrawAfterNextCommit(false) |
24 , m_needsCommit(false) | 26 , m_needsCommit(false) |
25 , m_needsForcedCommit(false) | 27 , m_needsForcedCommit(false) |
26 , m_expectImmediateBeginFrame(false) | 28 , m_expectImmediateBeginFrame(false) |
27 , m_mainThreadNeedsLayerTextures(false) | 29 , m_mainThreadNeedsLayerTextures(false) |
28 , m_insideVSync(false) | 30 , m_insideVSync(false) |
29 , m_visible(false) | 31 , m_visible(false) |
30 , m_canBeginFrame(false) | 32 , m_canBeginFrame(false) |
31 , m_canDraw(false) | 33 , m_canDraw(false) |
32 , m_hasPendingTree(false) | 34 , m_hasPendingTree(false) |
33 , m_drawIfPossibleFailed(false) | 35 , m_drawIfPossibleFailed(false) |
34 , m_textureState(LAYER_TEXTURE_STATE_UNLOCKED) | 36 , m_textureState(LAYER_TEXTURE_STATE_UNLOCKED) |
35 , m_outputSurfaceState(OUTPUT_SURFACE_ACTIVE) | 37 , m_outputSurfaceState(OUTPUT_SURFACE_ACTIVE) |
36 { | 38 { |
37 } | 39 } |
38 | 40 |
39 std::string SchedulerStateMachine::toString() | 41 std::string SchedulerStateMachine::toString() |
40 { | 42 { |
41 std::string str; | 43 std::string str; |
| 44 base::StringAppendF(&str, "m_settings.implSidePainting = %d; ", m_settings->
implSidePainting); |
42 base::StringAppendF(&str, "m_commitState = %d; ", m_commitState); | 45 base::StringAppendF(&str, "m_commitState = %d; ", m_commitState); |
43 base::StringAppendF(&str, "m_currentFrameNumber = %d; ", m_currentFrameNumbe
r); | 46 base::StringAppendF(&str, "m_currentFrameNumber = %d; ", m_currentFrameNumbe
r); |
44 base::StringAppendF(&str, "m_lastFrameNumberWhereDrawWasCalled = %d; ", m_la
stFrameNumberWhereDrawWasCalled); | 47 base::StringAppendF(&str, "m_lastFrameNumberWhereDrawWasCalled = %d; ", m_la
stFrameNumberWhereDrawWasCalled); |
| 48 base::StringAppendF(&str, "m_lastFrameNumberWhereTreeActivationAttempted = %
d; ", m_lastFrameNumberWhereTreeActivationAttempted); |
| 49 base::StringAppendF(&str, "m_lastFrameNumberWhereCheckForNewTexturesCalled =
%d; ", m_lastFrameNumberWhereCheckForNewTexturesCalled); |
45 base::StringAppendF(&str, "m_consecutiveFailedDraws = %d; ", m_consecutiveFa
iledDraws); | 50 base::StringAppendF(&str, "m_consecutiveFailedDraws = %d; ", m_consecutiveFa
iledDraws); |
46 base::StringAppendF(&str, "m_maximumNumberOfFailedDrawsBeforeDrawIsForced =
%d; ", m_maximumNumberOfFailedDrawsBeforeDrawIsForced); | 51 base::StringAppendF(&str, "m_maximumNumberOfFailedDrawsBeforeDrawIsForced =
%d; ", m_maximumNumberOfFailedDrawsBeforeDrawIsForced); |
47 base::StringAppendF(&str, "m_needsRedraw = %d; ", m_needsRedraw); | 52 base::StringAppendF(&str, "m_needsRedraw = %d; ", m_needsRedraw); |
| 53 base::StringAppendF(&str, "m_needsRedrawOnVisibleTextureUpload = %d; ", m_ne
edsRedrawOnVisibleTextureUpload); |
48 base::StringAppendF(&str, "m_needsForcedRedraw = %d; ", m_needsForcedRedraw)
; | 54 base::StringAppendF(&str, "m_needsForcedRedraw = %d; ", m_needsForcedRedraw)
; |
49 base::StringAppendF(&str, "m_needsForcedRedrawAfterNextCommit = %d; ", m_nee
dsForcedRedrawAfterNextCommit); | 55 base::StringAppendF(&str, "m_needsForcedRedrawAfterNextCommit = %d; ", m_nee
dsForcedRedrawAfterNextCommit); |
50 base::StringAppendF(&str, "m_needsCommit = %d; ", m_needsCommit); | 56 base::StringAppendF(&str, "m_needsCommit = %d; ", m_needsCommit); |
51 base::StringAppendF(&str, "m_needsForcedCommit = %d; ", m_needsForcedCommit)
; | 57 base::StringAppendF(&str, "m_needsForcedCommit = %d; ", m_needsForcedCommit)
; |
52 base::StringAppendF(&str, "m_expectImmediateBeginFrame = %d; ", m_expectImme
diateBeginFrame); | 58 base::StringAppendF(&str, "m_expectImmediateBeginFrame = %d; ", m_expectImme
diateBeginFrame); |
53 base::StringAppendF(&str, "m_mainThreadNeedsLayerTextures = %d; ", m_mainThr
eadNeedsLayerTextures); | 59 base::StringAppendF(&str, "m_mainThreadNeedsLayerTextures = %d; ", m_mainThr
eadNeedsLayerTextures); |
54 base::StringAppendF(&str, "m_insideVSync = %d; ", m_insideVSync); | 60 base::StringAppendF(&str, "m_insideVSync = %d; ", m_insideVSync); |
55 base::StringAppendF(&str, "m_visible = %d; ", m_visible); | 61 base::StringAppendF(&str, "m_visible = %d; ", m_visible); |
56 base::StringAppendF(&str, "m_canBeginFrame = %d; ", m_canBeginFrame); | 62 base::StringAppendF(&str, "m_canBeginFrame = %d; ", m_canBeginFrame); |
57 base::StringAppendF(&str, "m_canDraw = %d; ", m_canDraw); | 63 base::StringAppendF(&str, "m_canDraw = %d; ", m_canDraw); |
58 base::StringAppendF(&str, "m_drawIfPossibleFailed = %d; ", m_drawIfPossibleF
ailed); | 64 base::StringAppendF(&str, "m_drawIfPossibleFailed = %d; ", m_drawIfPossibleF
ailed); |
59 base::StringAppendF(&str, "m_hasPendingTree = %d; ", m_hasPendingTree); | 65 base::StringAppendF(&str, "m_hasPendingTree = %d; ", m_hasPendingTree); |
60 base::StringAppendF(&str, "m_textureState = %d; ", m_textureState); | 66 base::StringAppendF(&str, "m_textureState = %d; ", m_textureState); |
61 base::StringAppendF(&str, "m_outputSurfaceState = %d; ", m_outputSurfaceStat
e); | 67 base::StringAppendF(&str, "m_outputSurfaceState = %d; ", m_outputSurfaceStat
e); |
62 return str; | 68 return str; |
63 } | 69 } |
64 | 70 |
65 bool SchedulerStateMachine::hasDrawnThisFrame() const | 71 bool SchedulerStateMachine::hasDrawnThisFrame() const |
66 { | 72 { |
67 return m_currentFrameNumber == m_lastFrameNumberWhereDrawWasCalled; | 73 return m_currentFrameNumber == m_lastFrameNumberWhereDrawWasCalled; |
68 } | 74 } |
69 | 75 |
70 bool SchedulerStateMachine::hasAttemptedTreeActivationThisFrame() const | 76 bool SchedulerStateMachine::hasAttemptedTreeActivationThisFrame() const |
71 { | 77 { |
72 return m_currentFrameNumber == m_lastFrameNumberWhereTreeActivationAttempted
; | 78 return m_currentFrameNumber == m_lastFrameNumberWhereTreeActivationAttempted
; |
73 } | 79 } |
74 | 80 |
| 81 bool SchedulerStateMachine::hasCheckedForNewTexturesThisFrame() const |
| 82 { |
| 83 return m_currentFrameNumber == |
| 84 m_lastFrameNumberWhereCheckForNewTexturesCalled; |
| 85 } |
| 86 |
75 bool SchedulerStateMachine::drawSuspendedUntilCommit() const | 87 bool SchedulerStateMachine::drawSuspendedUntilCommit() const |
76 { | 88 { |
77 if (!m_canDraw) | 89 if (!m_canDraw) |
78 return true; | 90 return true; |
79 if (!m_visible) | 91 if (!m_visible) |
80 return true; | 92 return true; |
81 if (m_textureState == LAYER_TEXTURE_STATE_ACQUIRED_BY_MAIN_THREAD) | 93 if (m_textureState == LAYER_TEXTURE_STATE_ACQUIRED_BY_MAIN_THREAD) |
82 return true; | 94 return true; |
83 return false; | 95 return false; |
84 } | 96 } |
(...skipping 18 matching lines...) Expand all Loading... |
103 return false; | 115 return false; |
104 if (hasDrawnThisFrame()) | 116 if (hasDrawnThisFrame()) |
105 return false; | 117 return false; |
106 if (m_outputSurfaceState != OUTPUT_SURFACE_ACTIVE) | 118 if (m_outputSurfaceState != OUTPUT_SURFACE_ACTIVE) |
107 return false; | 119 return false; |
108 return true; | 120 return true; |
109 } | 121 } |
110 | 122 |
111 bool SchedulerStateMachine::shouldAttemptTreeActivation() const | 123 bool SchedulerStateMachine::shouldAttemptTreeActivation() const |
112 { | 124 { |
113 return m_hasPendingTree && m_insideVSync && !hasAttemptedTreeActivationThisFra
me(); | 125 return m_hasPendingTree && m_insideVSync && !hasAttemptedTreeActivationThisF
rame(); |
| 126 } |
| 127 |
| 128 bool SchedulerStateMachine::shouldCheckForNewTextures() const |
| 129 { |
| 130 if (!m_settings->implSidePainting) |
| 131 return false; |
| 132 if (hasCheckedForNewTexturesThisFrame()) |
| 133 return false; |
| 134 |
| 135 return shouldAttemptTreeActivation() || |
| 136 shouldDraw() || |
| 137 m_needsRedrawOnVisibleTextureUpload; |
114 } | 138 } |
115 | 139 |
116 bool SchedulerStateMachine::shouldAcquireLayerTexturesForMainThread() const | 140 bool SchedulerStateMachine::shouldAcquireLayerTexturesForMainThread() const |
117 { | 141 { |
118 if (!m_mainThreadNeedsLayerTextures) | 142 if (!m_mainThreadNeedsLayerTextures) |
119 return false; | 143 return false; |
120 if (m_textureState == LAYER_TEXTURE_STATE_UNLOCKED) | 144 if (m_textureState == LAYER_TEXTURE_STATE_UNLOCKED) |
121 return true; | 145 return true; |
122 DCHECK(m_textureState == LAYER_TEXTURE_STATE_ACQUIRED_BY_IMPL_THREAD); | 146 DCHECK(m_textureState == LAYER_TEXTURE_STATE_ACQUIRED_BY_IMPL_THREAD); |
123 // Transfer the lock from impl thread to main thread immediately if the | 147 // Transfer the lock from impl thread to main thread immediately if the |
(...skipping 14 matching lines...) Expand all Loading... |
138 case COMMIT_STATE_IDLE: | 162 case COMMIT_STATE_IDLE: |
139 if (m_outputSurfaceState != OUTPUT_SURFACE_ACTIVE && m_needsForcedRedraw
) | 163 if (m_outputSurfaceState != OUTPUT_SURFACE_ACTIVE && m_needsForcedRedraw
) |
140 return ACTION_DRAW_FORCED; | 164 return ACTION_DRAW_FORCED; |
141 if (m_outputSurfaceState != OUTPUT_SURFACE_ACTIVE && m_needsForcedCommit
) | 165 if (m_outputSurfaceState != OUTPUT_SURFACE_ACTIVE && m_needsForcedCommit
) |
142 // TODO(enne): Should probably drop the active tree on force commit | 166 // TODO(enne): Should probably drop the active tree on force commit |
143 return m_hasPendingTree ? ACTION_NONE : ACTION_BEGIN_FRAME; | 167 return m_hasPendingTree ? ACTION_NONE : ACTION_BEGIN_FRAME; |
144 if (m_outputSurfaceState == OUTPUT_SURFACE_LOST) | 168 if (m_outputSurfaceState == OUTPUT_SURFACE_LOST) |
145 return ACTION_BEGIN_OUTPUT_SURFACE_RECREATION; | 169 return ACTION_BEGIN_OUTPUT_SURFACE_RECREATION; |
146 if (m_outputSurfaceState == OUTPUT_SURFACE_RECREATING) | 170 if (m_outputSurfaceState == OUTPUT_SURFACE_RECREATING) |
147 return ACTION_NONE; | 171 return ACTION_NONE; |
| 172 if (shouldCheckForNewTextures()) |
| 173 return ACTION_CHECK_FOR_NEW_TEXTURES; |
148 if (shouldAttemptTreeActivation()) | 174 if (shouldAttemptTreeActivation()) |
149 return ACTION_ACTIVATE_PENDING_TREE_IF_NEEDED; | 175 return ACTION_ACTIVATE_PENDING_TREE_IF_NEEDED; |
150 if (shouldDraw()) | 176 if (shouldDraw()) |
151 return m_needsForcedRedraw ? ACTION_DRAW_FORCED : ACTION_DRAW_IF_POS
SIBLE; | 177 return m_needsForcedRedraw ? ACTION_DRAW_FORCED : ACTION_DRAW_IF_POS
SIBLE; |
152 if (m_needsCommit && ((m_visible && m_canBeginFrame) || m_needsForcedCom
mit)) | 178 if (m_needsCommit && ((m_visible && m_canBeginFrame) || m_needsForcedCom
mit)) |
153 // TODO(enne): Should probably drop the active tree on force commit | 179 // TODO(enne): Should probably drop the active tree on force commit |
154 return m_hasPendingTree ? ACTION_NONE : ACTION_BEGIN_FRAME; | 180 return m_hasPendingTree ? ACTION_NONE : ACTION_BEGIN_FRAME; |
155 return ACTION_NONE; | 181 return ACTION_NONE; |
156 | 182 |
157 case COMMIT_STATE_FRAME_IN_PROGRESS: | 183 case COMMIT_STATE_FRAME_IN_PROGRESS: |
| 184 if (shouldCheckForNewTextures()) |
| 185 return ACTION_CHECK_FOR_NEW_TEXTURES; |
158 if (shouldAttemptTreeActivation()) | 186 if (shouldAttemptTreeActivation()) |
159 return ACTION_ACTIVATE_PENDING_TREE_IF_NEEDED; | 187 return ACTION_ACTIVATE_PENDING_TREE_IF_NEEDED; |
160 if (shouldDraw()) | 188 if (shouldDraw()) |
161 return m_needsForcedRedraw ? ACTION_DRAW_FORCED : ACTION_DRAW_IF_POS
SIBLE; | 189 return m_needsForcedRedraw ? ACTION_DRAW_FORCED : ACTION_DRAW_IF_POS
SIBLE; |
162 return ACTION_NONE; | 190 return ACTION_NONE; |
163 | 191 |
164 case COMMIT_STATE_READY_TO_COMMIT: | 192 case COMMIT_STATE_READY_TO_COMMIT: |
165 return ACTION_COMMIT; | 193 return ACTION_COMMIT; |
166 | 194 |
167 case COMMIT_STATE_WAITING_FOR_FIRST_DRAW: { | 195 case COMMIT_STATE_WAITING_FOR_FIRST_DRAW: { |
| 196 if (shouldCheckForNewTextures()) |
| 197 return ACTION_CHECK_FOR_NEW_TEXTURES; |
168 if (shouldAttemptTreeActivation()) | 198 if (shouldAttemptTreeActivation()) |
169 return ACTION_ACTIVATE_PENDING_TREE_IF_NEEDED; | 199 return ACTION_ACTIVATE_PENDING_TREE_IF_NEEDED; |
170 if (shouldDraw() || m_outputSurfaceState == OUTPUT_SURFACE_LOST) | 200 if (shouldDraw() || m_outputSurfaceState == OUTPUT_SURFACE_LOST) |
171 return m_needsForcedRedraw ? ACTION_DRAW_FORCED : ACTION_DRAW_IF_POS
SIBLE; | 201 return m_needsForcedRedraw ? ACTION_DRAW_FORCED : ACTION_DRAW_IF_POS
SIBLE; |
172 // COMMIT_STATE_WAITING_FOR_FIRST_DRAW wants to enforce a draw. If m_can
Draw is false | 202 // COMMIT_STATE_WAITING_FOR_FIRST_DRAW wants to enforce a draw. If m_can
Draw is false |
173 // or textures are not available, proceed to the next step (similar as i
n COMMIT_STATE_IDLE). | 203 // or textures are not available, proceed to the next step (similar as i
n COMMIT_STATE_IDLE). |
174 bool canCommit = m_visible || m_needsForcedCommit; | 204 bool canCommit = m_visible || m_needsForcedCommit; |
175 if (m_needsCommit && canCommit && drawSuspendedUntilCommit()) | 205 if (m_needsCommit && canCommit && drawSuspendedUntilCommit()) |
176 return m_hasPendingTree ? ACTION_NONE : ACTION_BEGIN_FRAME; | 206 return m_hasPendingTree ? ACTION_NONE : ACTION_BEGIN_FRAME; |
177 return ACTION_NONE; | 207 return ACTION_NONE; |
178 } | 208 } |
179 | 209 |
180 case COMMIT_STATE_WAITING_FOR_FIRST_FORCED_DRAW: | 210 case COMMIT_STATE_WAITING_FOR_FIRST_FORCED_DRAW: |
| 211 if (shouldCheckForNewTextures()) |
| 212 return ACTION_CHECK_FOR_NEW_TEXTURES; |
181 if (shouldAttemptTreeActivation()) | 213 if (shouldAttemptTreeActivation()) |
182 return ACTION_ACTIVATE_PENDING_TREE_IF_NEEDED; | 214 return ACTION_ACTIVATE_PENDING_TREE_IF_NEEDED; |
183 if (m_needsForcedRedraw) | 215 if (m_needsForcedRedraw) |
184 return ACTION_DRAW_FORCED; | 216 return ACTION_DRAW_FORCED; |
185 return ACTION_NONE; | 217 return ACTION_NONE; |
186 } | 218 } |
187 NOTREACHED(); | 219 NOTREACHED(); |
188 return ACTION_NONE; | 220 return ACTION_NONE; |
189 } | 221 } |
190 | 222 |
191 void SchedulerStateMachine::updateState(Action action) | 223 void SchedulerStateMachine::updateState(Action action) |
192 { | 224 { |
193 switch (action) { | 225 switch (action) { |
194 case ACTION_NONE: | 226 case ACTION_NONE: |
195 return; | 227 return; |
196 | 228 |
| 229 case ACTION_CHECK_FOR_NEW_TEXTURES: |
| 230 m_lastFrameNumberWhereCheckForNewTexturesCalled = m_currentFrameNumber; |
| 231 return; |
| 232 |
197 case ACTION_ACTIVATE_PENDING_TREE_IF_NEEDED: | 233 case ACTION_ACTIVATE_PENDING_TREE_IF_NEEDED: |
198 m_lastFrameNumberWhereTreeActivationAttempted = m_currentFrameNumber; | 234 m_lastFrameNumberWhereTreeActivationAttempted = m_currentFrameNumber; |
199 return; | 235 return; |
200 | 236 |
201 case ACTION_BEGIN_FRAME: | 237 case ACTION_BEGIN_FRAME: |
202 DCHECK(!m_hasPendingTree); | 238 DCHECK(!m_hasPendingTree); |
203 DCHECK(m_visible || m_needsForcedCommit); | 239 DCHECK(m_visible || m_needsForcedCommit); |
204 m_commitState = COMMIT_STATE_FRAME_IN_PROGRESS; | 240 m_commitState = COMMIT_STATE_FRAME_IN_PROGRESS; |
205 m_needsCommit = false; | 241 m_needsCommit = false; |
206 m_needsForcedCommit = false; | 242 m_needsForcedCommit = false; |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
271 if (m_hasPendingTree) | 307 if (m_hasPendingTree) |
272 return true; | 308 return true; |
273 | 309 |
274 // If we can't draw, don't tick until we are notified that we can draw again
. | 310 // If we can't draw, don't tick until we are notified that we can draw again
. |
275 if (!m_canDraw) | 311 if (!m_canDraw) |
276 return false; | 312 return false; |
277 | 313 |
278 if (m_needsForcedRedraw) | 314 if (m_needsForcedRedraw) |
279 return true; | 315 return true; |
280 | 316 |
| 317 if (m_visible && m_needsRedrawOnVisibleTextureUpload) |
| 318 return true; |
| 319 |
281 return m_needsRedraw && m_visible && m_outputSurfaceState == OUTPUT_SURFACE_
ACTIVE; | 320 return m_needsRedraw && m_visible && m_outputSurfaceState == OUTPUT_SURFACE_
ACTIVE; |
282 } | 321 } |
283 | 322 |
284 void SchedulerStateMachine::didEnterVSync() | 323 void SchedulerStateMachine::didEnterVSync() |
285 { | 324 { |
286 m_insideVSync = true; | 325 m_insideVSync = true; |
287 } | 326 } |
288 | 327 |
289 void SchedulerStateMachine::didLeaveVSync() | 328 void SchedulerStateMachine::didLeaveVSync() |
290 { | 329 { |
291 m_currentFrameNumber++; | 330 m_currentFrameNumber++; |
292 m_insideVSync = false; | 331 m_insideVSync = false; |
293 } | 332 } |
294 | 333 |
295 void SchedulerStateMachine::setVisible(bool visible) | 334 void SchedulerStateMachine::setVisible(bool visible) |
296 { | 335 { |
297 m_visible = visible; | 336 m_visible = visible; |
298 } | 337 } |
299 | 338 |
300 void SchedulerStateMachine::setNeedsRedraw() | 339 void SchedulerStateMachine::setNeedsRedraw() |
301 { | 340 { |
302 m_needsRedraw = true; | 341 m_needsRedraw = true; |
303 } | 342 } |
304 | 343 |
| 344 void SchedulerStateMachine::setNeedsRedrawOnVisibleTextureUpload() |
| 345 { |
| 346 m_needsRedrawOnVisibleTextureUpload = true; |
| 347 } |
| 348 |
305 void SchedulerStateMachine::setNeedsForcedRedraw() | 349 void SchedulerStateMachine::setNeedsForcedRedraw() |
306 { | 350 { |
307 m_needsForcedRedraw = true; | 351 m_needsForcedRedraw = true; |
308 } | 352 } |
309 | 353 |
310 void SchedulerStateMachine::didDrawIfPossibleCompleted(bool success) | 354 void SchedulerStateMachine::didDrawIfPossibleCompleted(bool success) |
311 { | 355 { |
312 m_drawIfPossibleFailed = !success; | 356 m_drawIfPossibleFailed = !success; |
313 if (m_drawIfPossibleFailed) { | 357 if (m_drawIfPossibleFailed) { |
314 m_needsRedraw = true; | 358 m_needsRedraw = true; |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
376 m_outputSurfaceState = OUTPUT_SURFACE_ACTIVE; | 420 m_outputSurfaceState = OUTPUT_SURFACE_ACTIVE; |
377 setNeedsCommit(); | 421 setNeedsCommit(); |
378 } | 422 } |
379 | 423 |
380 void SchedulerStateMachine::setMaximumNumberOfFailedDrawsBeforeDrawIsForced(int
numDraws) | 424 void SchedulerStateMachine::setMaximumNumberOfFailedDrawsBeforeDrawIsForced(int
numDraws) |
381 { | 425 { |
382 m_maximumNumberOfFailedDrawsBeforeDrawIsForced = numDraws; | 426 m_maximumNumberOfFailedDrawsBeforeDrawIsForced = numDraws; |
383 } | 427 } |
384 | 428 |
385 } // namespace cc | 429 } // namespace cc |
OLD | NEW |