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

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

Issue 1012853003: Add DisplayScheduler for Surfaces (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: actually add unit tests Created 5 years, 8 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/trace_event/trace_event.h" 10 #include "base/trace_event/trace_event.h"
(...skipping 807 matching lines...) Expand 10 before | Expand all | Expand 10 after
818 } else { 818 } else {
819 // The impl thread doesn't have anything it wants to draw and we are just 819 // The impl thread doesn't have anything it wants to draw and we are just
820 // waiting for a new active tree or we are swap throttled. In short we are 820 // waiting for a new active tree or we are swap throttled. In short we are
821 // blocked. 821 // blocked.
822 return BEGIN_IMPL_FRAME_DEADLINE_MODE_LATE; 822 return BEGIN_IMPL_FRAME_DEADLINE_MODE_LATE;
823 } 823 }
824 } 824 }
825 825
826 bool SchedulerStateMachine::ShouldTriggerBeginImplFrameDeadlineImmediately() 826 bool SchedulerStateMachine::ShouldTriggerBeginImplFrameDeadlineImmediately()
827 const { 827 const {
828 // TODO(brianderson): This should take into account multiple commit sources.
829
830 if (begin_impl_frame_state_ != BEGIN_IMPL_FRAME_STATE_INSIDE_BEGIN_FRAME) 828 if (begin_impl_frame_state_ != BEGIN_IMPL_FRAME_STATE_INSIDE_BEGIN_FRAME)
831 return false; 829 return false;
832 830
833 // If we've lost the output surface, end the current BeginImplFrame ASAP 831 // If we've lost the output surface, end the current BeginImplFrame ASAP
834 // so we can start creating the next output surface. 832 // so we can start creating the next output surface.
835 if (output_surface_state_ == OUTPUT_SURFACE_LOST) 833 if (output_surface_state_ == OUTPUT_SURFACE_LOST)
836 return true; 834 return true;
837 835
838 // SwapAck throttle the deadline since we wont draw and swap anyway. 836 // SwapAck throttle the deadline since we wont draw and swap anyway.
839 if (pending_swaps_ >= max_pending_swaps_) 837 if (pending_swaps_ >= max_pending_swaps_)
(...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after
1083 static_cast<int>(begin_impl_frame_state_), 1081 static_cast<int>(begin_impl_frame_state_),
1084 static_cast<int>(commit_state_), 1082 static_cast<int>(commit_state_),
1085 has_pending_tree_ ? 'T' : 'F', 1083 has_pending_tree_ ? 'T' : 'F',
1086 pending_tree_is_ready_for_activation_ ? 'T' : 'F', 1084 pending_tree_is_ready_for_activation_ ? 'T' : 'F',
1087 active_tree_needs_first_draw_ ? 'T' : 'F', 1085 active_tree_needs_first_draw_ ? 'T' : 'F',
1088 max_pending_swaps_, 1086 max_pending_swaps_,
1089 pending_swaps_); 1087 pending_swaps_);
1090 } 1088 }
1091 1089
1092 } // namespace cc 1090 } // namespace cc
OLDNEW
« no previous file with comments | « cc/scheduler/scheduler.cc ('k') | cc/surfaces/BUILD.gn » ('j') | cc/surfaces/display.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698