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

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

Issue 23892022: cc: Always use SetNeedsBeginFrame to request the next BeginFrame (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 7 years, 3 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
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/format_macros.h" 7 #include "base/format_macros.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/strings/stringprintf.h" 9 #include "base/strings/stringprintf.h"
10 #include "base/values.h" 10 #include "base/values.h"
(...skipping 722 matching lines...) Expand 10 before | Expand all | Expand 10 after
733 // We should proactively request a BeginFrame if a commit is pending 733 // We should proactively request a BeginFrame if a commit is pending
734 // because we will want to draw if the commit completes quickly. 734 // because we will want to draw if the commit completes quickly.
735 if (needs_commit_ || commit_state_ != COMMIT_STATE_IDLE) 735 if (needs_commit_ || commit_state_ != COMMIT_STATE_IDLE)
736 return true; 736 return true;
737 737
738 // If the pending tree activates quickly, we'll want a BeginFrame soon 738 // If the pending tree activates quickly, we'll want a BeginFrame soon
739 // to draw the new active tree. 739 // to draw the new active tree.
740 if (has_pending_tree_) 740 if (has_pending_tree_)
741 return true; 741 return true;
742 742
743 // If we just swapped, it's likely that we are going to produce another
744 // frame soon.
745 if (last_frame_number_swap_performed_ == current_frame_number_)
enne (OOO) 2013/09/13 17:48:44 Just as a sanity check, the bugfix here is that al
brianderson 2013/09/13 18:24:46 Your understand is correct. The Scheduler can acce
746 return true;
747
743 return false; 748 return false;
744 } 749 }
745 750
746 void SchedulerStateMachine::DidEnterBeginFrame(const BeginFrameArgs& args) { 751 void SchedulerStateMachine::DidEnterBeginFrame(const BeginFrameArgs& args) {
747 current_frame_number_++; 752 current_frame_number_++;
748 inside_begin_frame_ = true; 753 inside_begin_frame_ = true;
749 last_begin_frame_args_ = args; 754 last_begin_frame_args_ = args;
750 } 755 }
751 756
752 void SchedulerStateMachine::DidLeaveBeginFrame() { 757 void SchedulerStateMachine::DidLeaveBeginFrame() {
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
861 case OUTPUT_SURFACE_ACTIVE: 866 case OUTPUT_SURFACE_ACTIVE:
862 case OUTPUT_SURFACE_WAITING_FOR_FIRST_COMMIT: 867 case OUTPUT_SURFACE_WAITING_FOR_FIRST_COMMIT:
863 case OUTPUT_SURFACE_WAITING_FOR_FIRST_ACTIVATION: 868 case OUTPUT_SURFACE_WAITING_FOR_FIRST_ACTIVATION:
864 return true; 869 return true;
865 } 870 }
866 NOTREACHED(); 871 NOTREACHED();
867 return false; 872 return false;
868 } 873 }
869 874
870 } // namespace cc 875 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698