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

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

Issue 311353003: cc: Don't swap throttle BeginMainFrame within deadline (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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
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 448 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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 if (pending_swaps_ >= max_pending_swaps_ &&
470 begin_impl_frame_state_ != BEGIN_IMPL_FRAME_STATE_INSIDE_DEADLINE)
470 return false; 471 return false;
471 472
472 if (skip_begin_main_frame_to_reduce_latency_) 473 if (skip_begin_main_frame_to_reduce_latency_)
473 return false; 474 return false;
474 475
475 return true; 476 return true;
476 } 477 }
477 478
478 bool SchedulerStateMachine::ShouldCommit() const { 479 bool SchedulerStateMachine::ShouldCommit() const {
479 if (commit_state_ != COMMIT_STATE_READY_TO_COMMIT) 480 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: 1068 case OUTPUT_SURFACE_ACTIVE:
1068 case OUTPUT_SURFACE_WAITING_FOR_FIRST_COMMIT: 1069 case OUTPUT_SURFACE_WAITING_FOR_FIRST_COMMIT:
1069 case OUTPUT_SURFACE_WAITING_FOR_FIRST_ACTIVATION: 1070 case OUTPUT_SURFACE_WAITING_FOR_FIRST_ACTIVATION:
1070 return true; 1071 return true;
1071 } 1072 }
1072 NOTREACHED(); 1073 NOTREACHED();
1073 return false; 1074 return false;
1074 } 1075 }
1075 1076
1076 } // namespace cc 1077 } // namespace cc
OLDNEW
« no previous file with comments | « no previous file | cc/scheduler/scheduler_state_machine_unittest.cc » ('j') | cc/scheduler/scheduler_state_machine_unittest.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698