Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(314)

Side by Side Diff: cc/scheduler_state_machine.cc

Issue 11294003: cc: Make --jank-instead-of-checkerboard jank more often (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Just prohibit force-after-commit Created 8 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "config.h" 5 #include "config.h"
6 6
7 #include "cc/scheduler_state_machine.h" 7 #include "cc/scheduler_state_machine.h"
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/stringprintf.h" 10 #include "base/stringprintf.h"
11 #include "cc/settings.h"
11 12
12 namespace cc { 13 namespace cc {
13 14
14 SchedulerStateMachine::SchedulerStateMachine() 15 SchedulerStateMachine::SchedulerStateMachine()
15 : m_commitState(COMMIT_STATE_IDLE) 16 : m_commitState(COMMIT_STATE_IDLE)
16 , m_currentFrameNumber(0) 17 , m_currentFrameNumber(0)
17 , m_lastFrameNumberWhereDrawWasCalled(-1) 18 , m_lastFrameNumberWhereDrawWasCalled(-1)
18 , m_consecutiveFailedDraws(0) 19 , m_consecutiveFailedDraws(0)
19 , m_maximumNumberOfFailedDrawsBeforeDrawIsForced(3) 20 , m_maximumNumberOfFailedDrawsBeforeDrawIsForced(3)
20 , m_needsRedraw(false) 21 , m_needsRedraw(false)
(...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after
256 m_needsForcedRedraw = true; 257 m_needsForcedRedraw = true;
257 } 258 }
258 259
259 void SchedulerStateMachine::didDrawIfPossibleCompleted(bool success) 260 void SchedulerStateMachine::didDrawIfPossibleCompleted(bool success)
260 { 261 {
261 m_drawIfPossibleFailed = !success; 262 m_drawIfPossibleFailed = !success;
262 if (m_drawIfPossibleFailed) { 263 if (m_drawIfPossibleFailed) {
263 m_needsRedraw = true; 264 m_needsRedraw = true;
264 m_needsCommit = true; 265 m_needsCommit = true;
265 m_consecutiveFailedDraws++; 266 m_consecutiveFailedDraws++;
266 if (m_consecutiveFailedDraws >= m_maximumNumberOfFailedDrawsBeforeDrawIs Forced) { 267 if (!Settings::jankInsteadOfCheckerboard() && m_consecutiveFailedDraws > = m_maximumNumberOfFailedDrawsBeforeDrawIsForced) {
267 m_consecutiveFailedDraws = 0; 268 m_consecutiveFailedDraws = 0;
268 // We need to force a draw, but it doesn't make sense to do this unt il 269 // We need to force a draw, but it doesn't make sense to do this unt il
269 // we've committed and have new textures. 270 // we've committed and have new textures.
270 m_needsForcedRedrawAfterNextCommit = true; 271 m_needsForcedRedrawAfterNextCommit = true;
271 } 272 }
272 } else 273 } else
273 m_consecutiveFailedDraws = 0; 274 m_consecutiveFailedDraws = 0;
274 } 275 }
275 276
276 void SchedulerStateMachine::setNeedsCommit() 277 void SchedulerStateMachine::setNeedsCommit()
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
309 m_contextState = CONTEXT_ACTIVE; 310 m_contextState = CONTEXT_ACTIVE;
310 setNeedsCommit(); 311 setNeedsCommit();
311 } 312 }
312 313
313 void SchedulerStateMachine::setMaximumNumberOfFailedDrawsBeforeDrawIsForced(int numDraws) 314 void SchedulerStateMachine::setMaximumNumberOfFailedDrawsBeforeDrawIsForced(int numDraws)
314 { 315 {
315 m_maximumNumberOfFailedDrawsBeforeDrawIsForced = numDraws; 316 m_maximumNumberOfFailedDrawsBeforeDrawIsForced = numDraws;
316 } 317 }
317 318
318 } 319 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698