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

Side by Side Diff: cc/scheduler/scheduler_state_machine.cc

Issue 325303002: cc: Don't swap throttle BeginMainFrame just after swapping (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: git Created 6 years, 6 months 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 | cc/scheduler/scheduler_state_machine_unittest.cc » ('j') | 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 "cc/scheduler/scheduler_state_machine.h" 5 #include "cc/scheduler/scheduler_state_machine.h"
6 6
7 #include "base/debug/trace_event.h" 7 #include "base/debug/trace_event.h"
8 #include "base/format_macros.h" 8 #include "base/format_macros.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/strings/stringprintf.h" 10 #include "base/strings/stringprintf.h"
(...skipping 446 matching lines...) Expand 10 before | Expand all | Expand 10 after
457 return true; 457 return true;
458 458
459 // After this point, we only start a commit once per frame. 459 // After this point, we only start a commit once per frame.
460 if (HasSentBeginMainFrameThisFrame()) 460 if (HasSentBeginMainFrameThisFrame())
461 return false; 461 return false;
462 462
463 // We shouldn't normally accept commits if there isn't an OutputSurface. 463 // We shouldn't normally accept commits if there isn't an OutputSurface.
464 if (!HasInitializedOutputSurface()) 464 if (!HasInitializedOutputSurface())
465 return false; 465 return false;
466 466
467 // SwapAck throttle the BeginMainFrames 467 // SwapAck throttle the BeginMainFrames unless we just swapped.
468 // TODO(brianderson): Remove this restriction to improve throughput. 468 // TODO(brianderson): Remove this restriction to improve throughput.
469 if (pending_swaps_ >= max_pending_swaps_) 469 bool just_swapped_in_deadline =
470 begin_impl_frame_state_ == BEGIN_IMPL_FRAME_STATE_INSIDE_DEADLINE &&
471 HasSwappedThisFrame();
472 if (pending_swaps_ >= max_pending_swaps_ && !just_swapped_in_deadline)
470 return false; 473 return false;
471 474
472 if (skip_begin_main_frame_to_reduce_latency_) 475 if (skip_begin_main_frame_to_reduce_latency_)
473 return false; 476 return false;
474 477
475 return true; 478 return true;
476 } 479 }
477 480
478 bool SchedulerStateMachine::ShouldCommit() const { 481 bool SchedulerStateMachine::ShouldCommit() const {
479 if (commit_state_ != COMMIT_STATE_READY_TO_COMMIT) 482 if (commit_state_ != COMMIT_STATE_READY_TO_COMMIT)
(...skipping 587 matching lines...) Expand 10 before | Expand all | Expand 10 after
1067 case OUTPUT_SURFACE_ACTIVE: 1070 case OUTPUT_SURFACE_ACTIVE:
1068 case OUTPUT_SURFACE_WAITING_FOR_FIRST_COMMIT: 1071 case OUTPUT_SURFACE_WAITING_FOR_FIRST_COMMIT:
1069 case OUTPUT_SURFACE_WAITING_FOR_FIRST_ACTIVATION: 1072 case OUTPUT_SURFACE_WAITING_FOR_FIRST_ACTIVATION:
1070 return true; 1073 return true;
1071 } 1074 }
1072 NOTREACHED(); 1075 NOTREACHED();
1073 return false; 1076 return false;
1074 } 1077 }
1075 1078
1076 } // namespace cc 1079 } // namespace cc
OLDNEW
« no previous file with comments | « no previous file | cc/scheduler/scheduler_state_machine_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698